Any idea how I can capture both id and name from the xml below
<person>
<id>3</id>
<name>gareth</name>
</person>
<person>
<name>fred</name>
<id>4</id>
</person>
I have tried to do this
<id>(?<the_id>[^<]*)</id>.+?<name>(?<the_name>[^<]*)</name>
Notice the ordering of the second persons nodes
I don't want to specify all the ordering options like this (see below) as this gets out of control for large numbers of combinations
<id>(?<the_id>[^<]*)</id>.+?<name>(?<the_name>[^<]*)</name>|<name>(?<the_name>[^<]*)</name>.+?<id>(?<the_id>[^<]*)</id>
Any help would be appreciated
<person>
<id>3</id>
<name>gareth</name>
</person>
<person>
<name>fred</name>
<id>4</id>
</person>
I have tried to do this
<id>(?<the_id>[^<]*)</id>.+?<name>(?<the_name>[^<]*)</name>
Notice the ordering of the second persons nodes
I don't want to specify all the ordering options like this (see below) as this gets out of control for large numbers of combinations
<id>(?<the_id>[^<]*)</id>.+?<name>(?<the_name>[^<]*)</name>|<name>(?<the_name>[^<]*)</name>.+?<id>(?<the_id>[^<]*)</id>
Any help would be appreciated