[ http://nagoya.apache.org/jira/browse/XALANJ-745?page=history ]

Henry Zongaro updated XALANJ-745:
---------------------------------

    Priority: Major  (was: Blocker)

> DOMBuilder mixes DOM Level 1 and 2
> ----------------------------------
>
>          Key: XALANJ-745
>          URL: http://nagoya.apache.org/jira/browse/XALANJ-745
>      Project: XalanJ2
>         Type: Bug
>   Components: DOM
>     Versions: CurrentCVS
>  Environment: Operating System: All
> Platform: All
>     Reporter: Carsten Ziegeler
>  Attachments: dombuilder.txt
>
> There are several namespace problems in the DOMBuilder which all result
> in DOMs which can have mixed Level 1 and Level 2 objects!
> 1. If I use the JAXP Interface with a DOMResult object which gets
>    a Document/Node object in the constructor, the underlying DOMBuilder
>    does not test whether this Document/Node supports namespaces or not!
>    This results in DOM trees having DOM Level 1 mixed with DOM Level 2
> nodes!
> 2. The startElement() method tests itself which DOM Level is used by looking
>    at the namespace parameter.
>    This test is not correct. The SAX spec states, that if an element has no
>    namespace (but namespaces are used) the namespace parameter is the empty
>    string. The startElement() method assumes in this case that DOM Level 1
>    is used instead!
>    >>> CODE SNIPPET FROM DOMBUILDER <<<<
>    public void startElement(
>           String ns, String localName, String name, Attributes atts)
>             throws org.xml.sax.SAXException
>    {
>        Element elem;
>        if ((null == ns) || (ns.length() == 0))
>            elem = m_doc.createElement(name);
>        else
>            elem = m_doc.createElementNS(ns, name);
>     ....
>     >>> END CODE SNIPPET FROM DOMBUILDER <<<<
> 3. The handling of the attributes of the element in the startElement() does
>    not reflect the namespace handling for the element.  Here again for each
>    attribute the namespace uri is tested against the empty string. If it is
>    the empty string, DOM Level 1 methods are used otherwise DOM Level 2.
>    Again, this results in mixed objects!
> Attached is a patch which fixes all these problems. The incoming document is 
> checked once if it is DOM  Level 1 or 2 and from that one the same set of 
> methods is used

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to