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

http://issues.apache.org/bugzilla/show_bug.cgi?id=27867

DTM does not parse attribute namespaces properly

           Summary: DTM does not parse attribute namespaces properly
           Product: XalanJ2
           Version: CurrentCVS
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: org.apache.xml.dtm
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


The org.apache.xml.dtm.ref.DTMDocumentImpl class does not seem to handle
attribute namespaces properly. This small XML document can be used to
reproduce the bug:

    <?xml version="1.0" encoding="utf-8"?>
    <!-- Initial declaration mapping 'a' to 'www.aaa.com' -->
    <a:foo xmlns:a="www.aaa.com">
        <!--
          New declaration mapping 'a' to 'www.bbb.com'.
          This declaration applies to the whole element
          and all its attributes!
          -->
        <a:bar a:attr1="one" xmlns:a="www.bbb.com" a:attr2="two"/>
    </a:foo>

The DTM will be created with the attribute 'a:attr1' on the namespace
'www.aaa.com' while it should be in namespace 'www.bbb.com'. Two things need
to be done in the DTMDocumentImpl class to correct this problem. Firstly the
startPrefixMapping() method should be implemented to support SAX parsers that
properly implement the SAX interface (namespace declarations are not really
attributes). Then, the startElement() method should be changed to traverse
the 'Attributes' parameter twice; first for all namespace declarations and
then for all real attributes.

Reply via email to