Skip to content

namespace aliases somehow do not work #870

@grindhold

Description

@grindhold

I load a custom XSD-file for a schema extension. It has a namespace long namespace assigned, however in the saml-messages this long namespace is not used in the tags, instead, they just are like <q1:TagName>. I resolved this by patching override_lookup_type and override_lookup_element like this:

orig_lookup_element = xmlschema.validators.global_maps.XsdGlobals.lookup_element
def override_lookup_element(self, qname):
    if qname.startswith("q1:"):
        qname = qname.replace("q1:", "{urn:foo:long:namespace}",1)
    return orig_lookup_element(self, qname)
xmlschema.validators.global_maps.XsdGlobals.lookup_element = override_lookup_element

This seems very wrong to me. Is there another way to tell the thing that "q1" is an alias for the long namespace?

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