Sure enough, I looked at CoreDocumentImpl and importNode(Node,
boolean, boolean, HashTable), where it deals with DOCUMENT_TYPE_NODE
in the switch statement, and it doesn't copy the internal subset
string from the srcdoctype to the newdoctype. Adding the following
line solves the issue...
newdoctype.setInternalSubset(srcdoctype.getInternalSubset());
I've reported the bug and attached a very simple patch. I hope it
can be applied for the next release!
http://issues.apache.org/jira/browse/XERCESJ-1181
I'm still curious about the Entity node that gets created as a child
of the DocumentType. Is that supposed to get created? Is it necessary?
Jake
At 12:31 AM 8/23/2006, you wrote:
>
>I think I'm seeing an issue in Xerces2 Java that was previously
>reported and fixed in XercesC++.
>
>internal subset lost after using cloneNode
>http://issues.apache.org/jira/browse/XERCESC-1170
>
>Is this a known problem in Xerces2 Java? The internal subset exists
>perfectly intact until I call Document.cloneNode(true). When I
>perform a print of the nodes, here's what the document type looks
>like, first before the clone (expected) and then after (actual)....
>
>Expected....
>
> DocumentTypeImpl: name=document
> internalSubset=
> <!ENTITY erh "Elliotte Rusty Harold">
> <!ELEMENT document (title, signature)>
> <!ELEMENT title (#PCDATA)>
> <!ELEMENT copyright (#PCDATA)>
> <!ELEMENT email (#PCDATA)>
> <!ELEMENT hr EMPTY>
> <!ELEMENT lastmodified (#PCDATA)>
> <!ELEMENT signature (hr, copyright, email, lastmodified)>
>
>Actual....
>
> DocumentTypeImpl: name=document
> EntityImpl: name=erh
> TextImpl: Elliotte Rusty Harold
>
>
>As you can see, Document.cloneNode(true) seems to turn the internal
>subset <!ENTITY> into an actual Entity Node and the rest of the
>internal subset (the <!ELEMENT>'s) is discarded.
>
>Any ideas about this one?
>
>Jake
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]