Hello. When parsing this xml:
<MatchData uID="g695008">
<Stat Type="total tackle ranking">100</Stat>
<Stat Type="total tackle">29</Stat>
<Stat Type="total fouls ranking">84</Stat>
<Stat Type="total fouls">19</Stat>
<Stat Type="total accurate pass ranking">13</Stat>
<Stat Type="total accurate pass">872</Stat>
<Stat Type="total goals ranking">81</Stat>
<Stat Type="total goals">1</Stat>
<Stat Type="total goals conceded ranking">81</Stat>
<Stat Type="total goals conceded">1</Stat>
<Stat Type="total scoring att ranking">28</Stat>
<Stat Type="total scoring att">29</Stat>
<Stat Type="total was fouled ranking">76</Stat>
<Stat Type="total was fouled">19</Stat>
<Stat Type="total attempts conceded obox ranking">12</Stat>
<Stat Type="total attempts conceded obox">17</Stat>
<Stat Type="total pass ranking">15</Stat>
<Stat Type="total pass">1013</Stat>
<Stat Type="total won tackle ranking">111</Stat>
<Stat Type="total won tackle">20</Stat>
<Stat Type="total goals conceded ibox ranking">68</Stat>
<Stat Type="total goals conceded ibox">1</Stat>
<Stat Type="total attempts conceded ibox ranking">79</Stat>
<Stat Type="total attempts conceded ibox">12</Stat>
<Stat Type="total yellow card ranking">97</Stat>
<Stat Type="total yellow card">1</Stat>
<TeamData Side="Home" uID="t56" />
<TeamData Side="Away" uID="t43" />
</MatchData>
{"MatchData"=>{"Stat"=>["100", "29", "84", "19", "13", "872", "81", "1", "81", "1", "28", "29", "76", "19", "12", "17", "15", "1013", "111", "20", "68", "1", "79", "12", "97", "1"], "TeamData"=>[{"Side"=>"Home", "uID"=>"t56"}, {"Side"=>"Away", "uID"=>"t43"}], "uID"=>"g695008"}}
And actually the Type is a value I want to retain. I have found a way to fix it, by wrapping the Stat value with like this:
<Stat Type="total yellow card ranking"><value>97</value></Stat>
But that means passing through the whole XML twice, And I wanted to ask if there was a better way to do it.