Thanks a lot for the reply.I am actually new to Chatbots.Org, this is the first time I posted a code portion.
And I have actually searched the whole last night for a solution and I got an answer, but not that much satisfactory.
Here are the results:
In an aiml document if the categories considered as the child nodes and the pattern and template tags considered as child nodes of the category nodes then I can access the 0 th category template as follows:
string path = “E:\WebSite1\my.aiml”;
FileStream reader = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
XmlDocument aiml = new XmlDocument();
aiml.Load(reader);
XmlNodeList nodelist = aiml.GetElementsByTagName(“category”);
DropDownList3.Items.Add(nodelist[0].ChildNodes[1].InnerText);
Above code solved the problem for some extent.
But I have some more questions.
I wanted to read a XML file and get the contents to a GridView. Say the file is as follows:
<?xml version="1.0" encoding="ISO-8859-1"?>
<aiml version="1.0">
<category>
<pattern>WHERE</pattern>
<template>Where the heart is.</template>
</category>
<category>
<pattern>Hi</pattern>
<template>Hello there</template>
</category>
<category>
<pattern>WHEREISIS *</pattern>
<template>
<random>
<li>Where the heart is.</li>
<li>Where it belongs.</li>
<li>Where <star/> is hard to find.</li>
<li>I do not know where <star/> is.</li>
</random>
</template>
</category>
</aiml>
When I read the XML file using the following code, it only displays the contents which are similar to every category node in the file.This moment it shows only the patterns because in the third category, the template tag contains some other tags.
XmlDataDocument doc = new XmlDataDocument();
doc.DataSet.ReadXml(“E:\WebSite1\std-pickup.aiml”);
DataSet ds = new DataSet();
ds=doc.DataSet ;
GridView1.DataSource = ds;
GridView1.DataMember = “category”;
this.GridView1.DataBind();
So my questions are:
*Is there a way to read all the categories to a GridView???Because in an AIML file, the template tag can have other various sub tags also.Any sugesstions???
*Say I have two AIML files called courses.aiml and fee.aiml. Can a category in the courses.aiml file redirect to a category in the fee.aiml file using the <srai> tag or vise versa. Or <sarai> tag related categories should be in the same file???
Two files may be:
fee.aiml category:
<category>
<pattern>FEE</pattern>
<template>1000 per month</template>
</category>
courses.aiml category:
<category>
<pattern>MONTHLY FEE</pattern>
<template><srai>FEE</srai></template>
</category>
Need help on this matter.Thank you very much.