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=28367>.
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=28367

No attributes added using setAttributeNS in HTML environment

           Summary: No attributes added using setAttributeNS in HTML
                    environment
           Product: XalanJ2
           Version: 2.5
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: org.apache.xml.utils
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


This may not actually be a bug and the situation is pretty specific but I
thought it was worthwhile to point it out.

We have a Java application that renders HTML and we also support rendering HTML
based on an XML transformation using Xalan.  We have our own parser and
implementation of a level 2 DOM plus some simple glue code to tie in the Xalan
library.

The problem is that, according to the JavaDocs for
org.w3c.dom.Element.setAttributeNS():
<snip>
HTML-only DOM implementations do not need to implement this method.
</snip>

This statement is actually present in most of the namespace related methods. 
Since our HTML renderer is an HTML-only DOM implementation, those methods are
generally not implemented.

However, in the org.apache.xml.utils.DOMBuilder class, I found the following in
the startElement method:

          // ALWAYS use the DOM Level 2 call!
          elem.setAttributeNS(attrNS,attrQName, atts.getValue(i));

The bottom line is that the transformation ends up losing all the attributes
since the callback to our implementation does nothing.  The namespace is null so 
there are things I can do on my end to fix this but I was wondering if some
check should be made to see whether we're in HTML mode before deciding whether
to use the setAttribute or setAttributeNS calls?

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

Reply via email to