I am developing my knowledge base files these days and also I am trying to make an interface to update the templates in the knowledge base.
Say I have the following AIML file.
<?xml version=“1.0” encoding=“ISO-8859-1”?>
<aiml version=“1.0”>
<category>
<pattern> WHERE</pattern>
<template>Where the heart is.</template>
</category>
<category>
<category>
<pattern>Hi</pattern>
<template>Hello there</template>
</category>
<category>
</aiml>
I want to access the first pattern template. I am using c# for the development and the following coded gives only the InnterText of the specified Tag.
XmlNodeList nodelist = aiml.GetElementsByTagName(“pattern”);
TextBox1.Text = nodelist[0].InnerText;
or
TextBox1.Text = nodelist[0].FirstChild.ChildNodes[0].InnerText;
But what I want is; if I give the pattern node list no as 0 or 1 then I need to read the InnerText of the related template.
Is there a way that I can get the access like that??
Any suggestions????
Thank you.