D
Dinçer
I need to parse an XML file and print the contents of it on an aspx page. My
XML file structure is like this:
<QueryResult>
<messageNo>1</messageNo>
<messageText />
<HERE>
<ExternalIntegrator><Entities>
<name>John</name>
<surname>Carpenter</surname>
<age>47</age>
</Entities></ExternalIntegrator>
</HERE>
<status>statusFound</status>
</QueryResult>
What I want to do is to get the data within "HERE" tags first. Then, I need
to parse this xml and get the name, surname etc. I mean, I need to parse the
xml document within the xml document.
I am trying to do it using XmlTextReader but when I use it second time (for
inner xml) I get the error PathTooLongException.
How can I parse this XML within XML and get the NAME value?
PS: What I basically do->
....
XmlTextReader reader = null;
reader = new XmlTextReader(UrlToXmlFile);
object oMyTag = reader.NameTable.Add("HERE");
while (reader.Read())
{
if (reader.NodeType == XmlNodeType.Element)
{
if (reader.Name.Equals(oMyTag))
{
return ReadXML2(reader.ReadString()); // here I want to do the same
thing for inner xml but get the error
}
....
XML file structure is like this:
<QueryResult>
<messageNo>1</messageNo>
<messageText />
<HERE>
<ExternalIntegrator><Entities>
<name>John</name>
<surname>Carpenter</surname>
<age>47</age>
</Entities></ExternalIntegrator>
</HERE>
<status>statusFound</status>
</QueryResult>
What I want to do is to get the data within "HERE" tags first. Then, I need
to parse this xml and get the name, surname etc. I mean, I need to parse the
xml document within the xml document.
I am trying to do it using XmlTextReader but when I use it second time (for
inner xml) I get the error PathTooLongException.
How can I parse this XML within XML and get the NAME value?
PS: What I basically do->
....
XmlTextReader reader = null;
reader = new XmlTextReader(UrlToXmlFile);
object oMyTag = reader.NameTable.Add("HERE");
while (reader.Read())
{
if (reader.NodeType == XmlNodeType.Element)
{
if (reader.Name.Equals(oMyTag))
{
return ReadXML2(reader.ReadString()); // here I want to do the same
thing for inner xml but get the error

}
....