Skip to content

Unable to parse one-layer deep strings #23

Description

@mattBrzezinski

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions