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”>
   <pattern> WHERE</pattern>
  <template>Where the heart is.</template>

  <template>Hello there</template>

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;
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.

Use System.Xml.SelectNodes( strXPath ) or System.Xml.SelectSingleNode( strXPath ). Construct the strXPath something like this "/aiml/category/pattern"
Good luck.