| Suraaj Vyas 2005-03-14, 6:40 pm |
| Hello guys,
<?xml version=\"1.0\" encoding=\"utf-16\"?>
<Inventory xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">
<name xmlns=\"http://tempuri.org/\">Macho man </name>
<eventInfo xmlns=\"http://tempuri.org/\">
<venueName>Circus</venueName>
<talent>
<anyType xsi:type=\"EventTalentInfo\">
<id>0</id>
</anyType>
</talent>
</eventInfo>
</Inventory>
In the above XML file I want to get the values of the nodes but I am not
able to find a suitable XPath expression for name , venueName.
object obj = doc.CreateNavigator().Evaluate(XPath Expression);
if (obj is XPathNodeIterator)
{
XPathNodeIterator it = (XPathNodeIterator) obj;
it.MoveNext();
txt = it.Current.ToString();
}
Please help me for getting tht expression and if you can tell me that how
can I get the XPath expression from the tag name so that i can cross check
with what value I am using for a certain tag name
Secondly you can see the weak typing the XML Serializer has done as there
are fields with "anyType" as the name . Please let me know how can I strong
type the XML to get the actual types there.
Thanx for any help I get from you guys.
Suraaj
|