Skip to content

Proper XML Namespaces support #367

@ddevienne

Description

@ddevienne

I've searched issues, and although there are a few related to namespaces, they do not tackle the real issue,
which is that all node's namespace URI should be available. Knowing a node's namespace-qualified name
(i.e. NS-Prefix colon Local-Name) is insufficient, because of default namespaces, and the fact prefixes are arbitrary
and only namespace URIs matter. Namespaces in XML are pretty essential.

The XML parser is best suited to keep track of in-scope namespaces, and assign them to nodes.
Client code would need to scan the whole document for all namespace-related attributes, and for
all element names, maintain a stack of in-scope namespace, and keep an external shadow DOM
(i.e. a map) to know the NS URI of all nodes, which is possible, but cumbersome and inefficient.

(BTW, I don't see how the namespace-uri() = X XPath predicate can be correct and efficient w/o the
parse-tree knowing about the NS of all nodes, as described above)

I'm currently using https://github.com/svgpp/rapidxml_ns, but would welcome being able to replace it with pugixml,
provided proper XML Namespaces support. Please consider this a formal request for Enhancement. Thanks, --DD

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions