Reading Complex XML Attributes

kachrico

New Member
I have an XML file that uses a combination of attributes and tags that have data in them.I don't have control over the structure of the XML file but I am currently switching gears to look at LINQ for parsing this and wondering if there are opinions on how best to approach this structure:\[code\]<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE call_flow SYSTEM "../../../../dtds/Callflow_1-1.dtd"><call_flow version="1.1" serial="13903" first_element="Element1"> <element_def name="Element1"> <voice class="com.classname.Name"> <static>Element1.xml</static> </voice> <exit_state name="done"> <next_element>Element2</next_element> </exit_state> </element_def> <element_def name="Element2"> <voice class="com.classname.Name2"> <static>Element2.xml</static> </voice> <exit_state name="option1"> <next_element>Element3</next_element> </exit_state> <exit_state name="option2"> <next_element>Element4</next_element> </exit_state> </element_def> <element_def name="Element3"> <voice class="com.classname.Name3"> <static>Element3.xml</static> </voice> <exit_state name="done"> <next_element>Element4</next_element> </exit_state> </element_def> <element_def name="Element4"> <decision> <class src="http://stackoverflow.com/questions/13783191/com.classname.Name4"/> </decision> <exit_state name="0"> <next_element>Element3</next_element> </exit_state> <exit_state name="1"> <next_element>Element5</next_element> </exit_state> </element_def> <element_def name="Element5"> <voice class="com.classname.Name5"> <static>element5.xml</static> </voice> </element_def></call_flow>\[/code\]I can find plenty of samples of LINQ code but am not really seeing how I'd get both the values for Next_Element and the element_def "name" property.If someone can assist and maybe point me in the right direction, I'd appreciate it.
 
Back
Top