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

cloneNode does not copy default attributes

           Summary: cloneNode does not copy default attributes
           Product: Xerces-J
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Core
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


xerces-J 2.1.0
org.apache.xerces.dom.CoreDocumentImpl, CVS version 1.28

When cloning a document that has elements with default attributes values from a
schema, the default attributes are not cloned. But the 
org.w3c.dom.Document.cloneNode method specification mentions:

    "Note: When Elements are cloned, all attribute nodes are
                cloned, including those generated by the XML processor
                to represent defaulted attributes".

The implementation of cloneNode in a document is implemented by calling the 
method importNode in CoreDocumentImpl. This method filters attributes like 
this, at line 1531:

    ...
    // Copy the attribute only if it is not a default.
    if (attr.getSpecified()) {
      ... // cloning of attributes here


This seems to be the opposite to what the spec says.

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

Reply via email to