XMLDictionary
XMLDictionary copied to clipboard
Attribute parsing for XML response
Hi,
Is there attribute parsing support for XML response? I looked at all the methods and properties, but did not get any such methods. Also, I gone through the sample example, but it does not contain such scenarios as below:
<SrcGeos>
<Geo>
<Level1 DisplayText="Sao Paulo" Code="saopaulo"/>
<Level2 DisplayText="Sao Paulo" Code="saopaulo"/>
<City DisplayText="Sao Paulo" Code="saopaulo"/>
<Country DisplayText="Brazil" Code="brazil"/>
<Latitude>-23.5475</Latitude>
<Longitude>-46.63611</Longitude>
<Region DisplayText="Latin America" Code="latinamerica"/>
</Geo>
</SrcGeos>
Yes, there's an "attributes" property added to NSDictionary by the category. You can also refer to attributes with an underscore prefix by default, e.g
xmlDict[@"_foo"] // returns attribute "foo"