Skip to content

Provide ability to ignore namespaces when parsing #130

Description

@jpd236

I'm dealing with parsing XML in the wild that is occasionally inconsistent about specifying the correct/expected namespace for certain tags, or for that matter, any namespace at all. While I'd like serialization to include the correct namespace, when deserializing, I really only want to look at the tag name and can safely ignore the namespace value altogether. (Most other applications parsing this particular type of XML file already do so).

I'm not seeing an easy way to accomplish this; I don't think an unknown child handler can work here because the child isn't treated as unknown; it matches the expected @Serializable class with that tag name but then fails because the namespace doesn't match the expected one for that class, resulting in this error.

Did I miss an API for this? If not, this would be a helpful feature request. In the mean time, I've resorted to manually doing find-and-replace tweaks to the raw content to try to normalize the namespaces before parsing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions