Sub-query with XmlNodeList
-
Hi. I'm writing a C# program and I'm using XML like a DB for storing structured information. After a query in XPath, I obtain a list of XmlNode (or, in other words, an instance of XmlNodeList) and I would like to make another query inside this list. Maybe this is confused; here's an example. Let's suppose we have this XML fragment:
<items>
<item val="1"/>
<item val="0"/>
<item val="1"/>
</items>and after a query like
./item[@val='1']
we retrive this list:<item val="1"/>
<item val="1"/>Now, How can I convert easily this XmlNodeList in a node without creating a new XmlDocument (I need to have the right reference to nodes) so I will make another query on it? Or maybe how to call SelectNodes directly in the XmlNodeList (Yeah, I know: there's no SelectNodes in XmlNodeList)? Again, maybe it is possible to create a temporary node and insert the selected nodes into it. Thanks in advance, Atropo P.S. Sorry if the question is a bit confusing: I'm not very good with english.
-
Hi. I'm writing a C# program and I'm using XML like a DB for storing structured information. After a query in XPath, I obtain a list of XmlNode (or, in other words, an instance of XmlNodeList) and I would like to make another query inside this list. Maybe this is confused; here's an example. Let's suppose we have this XML fragment:
<items>
<item val="1"/>
<item val="0"/>
<item val="1"/>
</items>and after a query like
./item[@val='1']
we retrive this list:<item val="1"/>
<item val="1"/>Now, How can I convert easily this XmlNodeList in a node without creating a new XmlDocument (I need to have the right reference to nodes) so I will make another query on it? Or maybe how to call SelectNodes directly in the XmlNodeList (Yeah, I know: there's no SelectNodes in XmlNodeList)? Again, maybe it is possible to create a temporary node and insert the selected nodes into it. Thanks in advance, Atropo P.S. Sorry if the question is a bit confusing: I'm not very good with english.