Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am having an XL file having several nodes of same name.

I want to select these nodes one by one for further purpose.

XML
<Shapes>

<Square>
<Vertex x="221" y="12" z="432">
</Square>

<Square>
<Vertex x="123" y="42" z="645">
</Square>

<Square>
<Vertex x="987" y="512" z="667">
</Square>

</Shapes>



Here I want to select attribute values in all nodes named Square.

I want to select nodes one by one.

How to do this
Posted
Updated 20-Mar-14 0:17am
v2
Comments
gggustafson 20-Mar-14 13:34pm    
XPath
KUMAR619 21-Mar-14 1:31am    
Thanks for answering

1 solution

I would use the XDocument or you could also use the XmlDocument. The XDocument is newer and supports Linq.

http://msdn.microsoft.com/en-us/library/system.xml.linq.xdocument_methods(v=vs.110).aspx[^]

You can use Elements() or Descendants() etc.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900