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

Unable to parse one-layer deep strings #23

Open
mattBrzezinski opened this issue May 8, 2020 · 1 comment
Open

Unable to parse one-layer deep strings #23

mattBrzezinski opened this issue May 8, 2020 · 1 comment

Comments

@mattBrzezinski
Copy link
Member

I recently came across this problem when trying to get the location of an AWS S3 Bucket. XMLDict appears to not be able to parse one-layer deep strings (for lack of better terminology?)

using XMLDict

xml_response = """
           <?xml version="1.0" encoding="UTF-8"?>
           <LocationConstraint xmlns="http://s3.amazonaws.com/doc/2006-03-01/">eu-west 1</LocationConstraint>"""

parse_xml(xml_response)
XMLDict.XMLDictElement with 0 entries

However, if the xml_response is two-layers deep it works fine:

using XMLDict

 xml_response = """
           <?xml version="1.0" encoding="UTF-8"?>
           <LocationConstraint xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Location>eu-west 1</Location></LocationConstraint>"""

parse_xml(xml_response)
XMLDict.XMLDictElement with 1 entry:
  "Location" => "eu-west 1"
@mattBrzezinski
Copy link
Member Author

Following-up using the xml_dict() function will resolve this issue for one-layer deep structs.

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

1 participant