#583 NAMESPACE_ERR when creating default namespace in DOM

v8.8
closed
Michael Kay
5
2012-10-08
2006-09-13
Michael Kay
No

When creating a DOM as the result of a transformation
or query, Saxon 8.8 incorrectly changed the way that a
default namespace declaration such as xmlns="some.uri"
is written from

element.setAttributeNS(NamespaceConstant.XMLNS,
"xmlns", "some.uri");

to

element.setAttributeNS(null, "xmlns", "some.uri");

Although the latter form is much more logical, given
that an unprefixed name is never in a namespace, the
DOM spec says that this should result in the exception
NAMESPACE_ERR being thrown, and at least one
implementation apparently does so. The code will
therefore change back to its earlier form.

Module net.sf.saxon.dom.DOMWriter will be updated in
Subversion.

Discussion