Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attribute parsing for XML response #44

Open
shahdhiren opened this issue Oct 1, 2015 · 1 comment
Open

Attribute parsing for XML response #44

shahdhiren opened this issue Oct 1, 2015 · 1 comment

Comments

@shahdhiren
Copy link

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>
@nicklockwood
Copy link
Owner

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants