I have the following example XML:
<Table>
<Row Position="0" Name="FName" />
<Row Position="1" Name="LName" />
<Row Position="2" Name="Email" />
<Row Position="3" Name="Phone" />
<Row Position="4" Name="Address" />
</Table>
I want to be able to read this into an output of:
Row: FName
Row: LName
Row: Email
Row: Phone
Row: Address
The ordering for this list however should be based off the Position attribute of the row, so that the output order can be changed by simply changing the number ordering.
I guess this will take a variable or two to complete but not entirely sure on the execution.
Cheers
Example:
Input
<Table>
<Row Position="0" Name="FName" />
<Row Position="1" Name="LName" />
<Row Position="4" Name="Email" />
<Row Position="2" Name="Phone" />
<Row Position="3" Name="Address" />
</Table>
Output
Row: FName
Row: LName
Row: Phone
Row: Address
Row: Email
1 Answer