You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2003/09/24 20:32:32 UTC

DO NOT REPLY [Bug 16286] - Odd error when using Identity Transformation to build DOM

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16286>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16286

Odd error when using Identity Transformation to build DOM





------- Additional Comments From richcao@ca.ibm.com  2003-09-24 18:32 -------
This is the error message:
javax.xml.transform.TransformerException: org.w3c.dom.DOMException:
NAMESPACE_ERR: An attempt is made to create or change an object in a way which
is incorrect with regard to namespaces.

It looks like the problem originates inside of DOMBuilder.startElem on the call
to  elem.setAttributeNS(attrNS,attrQName, atts.getValue(i)). 

The problem occurs when we try to add an attribute with qname =
xmlns:<something>. The SAX parser gives us a null (empty string) attrNS.
According to the JavaDocs [1] for Element, if the qname starts with xmlns, the
namespace must be http://www.w3.org/2000/xmlns/. (the specs also confirm this
[2]) or else the NAMESPACE_ERR exception is thrown.

So it looks like this bug is Xerces related. I will test with the latest Xerces
code to see if this still an issue.

[1]
http://xml.apache.org/xalan-j/apidocs/org/w3c/dom/Element.html#setAttributeNS(java.lang.String,%20java.lang.String,%20java.lang.String)
[2] http://www.w3.org/2000/xmlns/