I am having xml with following structure
<ruleDefinition appId="3" customerId = "acf">
<node alias="element1" id="1" name="department">
<node alias="element2" id="101" name="mike" />
<node alias="element2" id="102" name="ricky" />
<node alias="element2" id="103" name="jim" />
</node>
</ruleDefinition>
Here nodes are differentiated using alias and not with node tag. As you can see top level node element1 has same node name “node” as element2. I want to parse this XML based on attribute alias.
What should be the Linq-To-Xml code (using C#)to acheive this?
This is a method of parsing the data structure into items that contain an Element1 string property and an IEnumerable Element2 property, which contains your multiple pieces of element2 data.