Project

Profile

Help

ns undeclarations in dom model - wrapper of NodeInfo even for xml 1.0

Added by Petr K almost 8 years ago

in 9.7 i get namespace undeclarations in xquery result in NodeInfo and in wrapped dom object - i set all configuration params to xml 1.0 how can i setup saxon to produce NodeInfo without namespace undeclarations??

thnx Petr


Replies (7)

Please register to reply

RE: ns undeclarations in dom model - wrapper of NodeInfo even for xml 1.0 - Added by Michael Kay almost 8 years ago

Please supply a simple repro that demonstrates the problem.

RE: ns undeclarations in dom model - wrapper of NodeInfo even for xml 1.0 - Added by Petr K almost 8 years ago

it is NodeOverNodeInfo.getAttributes() that returns all undeclarations too ( DOMAttributeMap use parent.getDeclaredNamespaces ) i'll prepare a case for this

RE: ns undeclarations in dom model - wrapper of NodeInfo even for xml 1.0 - Added by Petr K almost 8 years ago

here we go the problem output is

xmlns:people:

RE: ns undeclarations in dom model - wrapper of NodeInfo even for xml 1.0 - Added by Michael Kay almost 8 years ago

Thanks, I'm looking at it.

For future reference, you don't need to include the Saxon JAR file in a problem upload, and you CERTAINLY don't need to include a license file!

RE: ns undeclarations in dom model - wrapper of NodeInfo even for xml 1.0 - Added by Michael Kay almost 8 years ago

First, note the XQuery rules for constructed elements in section 3.9.4 In-scope Namespaces of a Constructed Element. The rules make it clear that the "person" element in your example does not have an in-scope namespace binding for the "people" prefix. This is not dependent on whether or not the processor supports XML 1.1. So at the level of the XDM tree, Saxon is certainly getting it right.

Now the question becomes what should happen when you wrap the XDM tree as a DOM. There's nothing in any of the specs about how an XDM tree is represented as a DOM (unless perhaps you take the mapping of both specs to the Infoset as your guide), so Saxon has a fairly free choice here, especially since the DOM specification is very liberal about consistency constraints.

Logged as bug 3048 and fixed.

https://saxonica.plan.io/issues/3048

RE: ns undeclarations in dom model - wrapper of NodeInfo even for xml 1.0 - Added by Petr K almost 8 years ago

thank you for the patch can we expect a release in near future or there is a nightly build to download?

RE: ns undeclarations in dom model - wrapper of NodeInfo even for xml 1.0 - Added by Michael Kay almost 8 years ago

We do maintenance releases every four weeks or so, but the next one is imminent.

    (1-7/7)

    Please register to reply