[ http://issues.apache.org/jira/browse/XALANJ-2071?page=comments#action_12367488 ]
Christian Roth commented on XALANJ-2071: ---------------------------------------- The same issue also exists for attributes, line #244 in DOM2SAX: Passing a null value is likely in the code, but probably should be "". However, this may well be a problem of AttributesImpl which should never return a null value when calling getURI(int) except for when the index is out of range. I haven't investigated this issue further, but for me fixed it at the above location. > DOM2SAX reports Null-Namespace via 'null' value, should be empty String "" > -------------------------------------------------------------------------- > > Key: XALANJ-2071 > URL: http://issues.apache.org/jira/browse/XALANJ-2071 > Project: XalanJ2 > Type: Bug > Components: XSLTC > Versions: 2.6 > Reporter: Christian Roth > Assignee: Brian Minchau > Priority: Critical > > When converting a DOM tree to SAX events using the DOM2SAX adapter, elements > with null namespace are reported using a SAX call like > _sax.startElement( null, "element", "element", ... ) > According to the SAX specification, this must be: > _sax.startElement( "", "element", "element", ... ) > i.e. the null namespace must be passed as an empty String instead of a NP. > Relevant SAX reference: > <http://xml.apache.org/xerces2-j/javadocs/api/org/xml/sax/ContentHandler.html#startElement(java.lang.String,%20java.lang.String,%20java.lang.String,%20org.xml.sax.Attributes)> > Offending method: > private void parse(Node), line 283 in: > $Id: DOM2SAX.java,v 1.21 2004/02/16 22:57:21 minchau Exp $ > Though Xalan seems to be able to cope with the wrong SAX call, Saxon e.g. > doesn't. > A suggested fix would be to add code similar to > _sax.startElement( (uri == null ? "" : uri), localName, qname, attrs ) > Regards, Christian. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
