.net - How to read xml childs from a closed tag parent in c# -
I know how to read general XML files using XmlDocument with C # but this time the XML file is different Different, this is the structure:
2010 & lt; / Year & gt; & Lt; Price & gt; 20000 & lt; / Pricing & gt; & Lt; Exp & gt; K (x + y) / m & Lt; Items & gt; 30 & lt; / Item & gt; & Lt; Law & gt; Le 10, Art 40 & lt; / Law & gt; & Lt; Law & gt; Le 10, Art 50 & lt; / Law & gt; & Lt; Items & gt; 140 & lt; / Item & gt; & Lt; Law & gt; Le 10, Art 40 & lt; / Law & gt; & Lt; Years & gt; 2011 & lt; / Year & gt; As you can see, year value, XP and item's parent node and items are child's parents. So it's not like normal
& lt; Parent & gt; & Lt; Children & gt; & Lt; / Children & gt; & Lt; / Parent & gt;
XML file structure can you please give me an indication Thank you.
In your example, there is no parent of year Value , exp , and items as you rule; This is a brother node. This structure is not well-formed XML because there are several root nodes, which are not allowed. To parse it, you will need to wrap it in the outer set of the tag.
Comments
Post a Comment