Manipulating xml with c# using xpath, a little help needed please
Posted on 2006-06-01
I have an xml file stored as a string in a variable.... it looks exactly like this
<t id="11" s="2" /><t id="1" s="5." />
currently there is 2 records but there will be many more..
I need to extract the contents of id and s... i.e. first record id=11 and s=2
I got so far ... just need a little help with the expression i think
XPathDocument document = new XPathDocument(xmlFields); // CAN I DO THIS WHEN ITS A STRING?
XPathNavigator navigator = document.CreateNavigator();
XPathNavigator expr = navigator.Compile("/t id); // ???????????
XPathNodeIterator nodes = navigator.Select(expr);
// need to add each value to a local variable