Groups | Blog | Home
all groups > dotnet sdk > may 2006 >

dotnet sdk : Regarding XML Doc Class


Ramu
5/20/2006 4:22:01 AM
Hi ,

I need some help regarding XML Doc Class.

Suppose i have one xml as follows :

<ABC>
<xyz>
<Code>0</Code><Message>RESULT_MESSAGE</Message>
</xyz>
</ABC>


In this XML , If i will give input xyz, then i should get

<Code>0</Code><Message>RESULT_MESSAGE</Message>

as output .

It would be great if any body will give suggestion


Thanks & Regards
Ramanatha Reddy




dhanvanth NO[at]SPAM gmail.com
5/23/2006 11:18:00 AM
Did you try using XPATH expressions?
Ben Voigt
5/24/2006 6:38:17 PM

[quoted text, click to view]

Specifically:

XPathDocument doc;
XPathNavigator root = doc.CreateNavigator();
root.moveToFirstChild(); //get the single document element ABC
string result = root.SelectSingleNode("abc").Value;

AddThis Social Bookmark Button