You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Sriram Rao <sr...@informix.com> on 2001/08/16 21:53:16 UTC

Losing Internal Subset When Cloning

Hi,

When deep cloning a DOCUMENT_NODE (of a DOM created using Xerces parser), I 
loose the 'internal subset' property of its DOCUMENT_TYPE_NODE child. That 
is, docType.getInternalSubset() (where docType is of type 
DOCUMENT_TYPE_NODE) returns null. This method however returns the correct 
internal subset for the DOCUMENT_TYPE_NODE child of the DOCUMENT_NODE 
(created by parsing XML document into a DOM) from which the clone was created.

Any idea why this is happening? Any work-arounds?

This may not be the correct alias to talk about the Crimson parser (anyone 
aware of the correct alias?). However, when using the Crimson parser, deep 
clone of the DOCUMENT_NODE completely looses its DOCUMENT_TYPE_NODE child. 
Also, the internal subset is not set for the DOCUMENT_TYPE_NODE child of 
the DOCUMENT_NODE originally created by parsing an XML document.

I would appreciate any help in resolving these issues with Xerces and 
Crimson parsers.

Thanks,
Sriram




---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Re: Losing Internal Subset When Cloning

Posted by Sriram Rao <sr...@informix.com>.
Thanks Elena, but the I don't see set methods in the DocumentType 
interface. Also, the 'value' property of a DocumentType node is null.

Is there a way to set the internal subset for a DOCUMENT_TYPE_NODE?

Thanks Again,
Sriram

At 04:40 PM 8/16/01 -0400, you wrote:
>Sriram,
>
> > When deep cloning a DOCUMENT_NODE (of a DOM created using Xerces parser), I
> > loose the 'internal subset' property of its DOCUMENT_TYPE_NODE child. That
> > is, docType.getInternalSubset() (where docType is of type
> > DOCUMENT_TYPE_NODE) returns null. This method however returns the correct
> > internal subset for the DOCUMENT_TYPE_NODE child of the DOCUMENT_NODE
> > (created by parsing XML document into a DOM) from which the clone was 
> created.
> >
> > Any idea why this is happening? Any work-arounds?
>
>DOM L2 Core specifies for "cloneNode" that "cloning Document,
>DocumentType, Entity, and Notation nodes is implementation dependent".
>In our implementation we choose not to clone internalSubset.
>The easiest work-around is get it and set it yourself on the cloned
>node.
>
>Elena
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-j-user-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Losing Internal Subset When Cloning

Posted by Elena Litani <el...@ca.ibm.com>.
Sriram,

> When deep cloning a DOCUMENT_NODE (of a DOM created using Xerces parser), I
> loose the 'internal subset' property of its DOCUMENT_TYPE_NODE child. That
> is, docType.getInternalSubset() (where docType is of type
> DOCUMENT_TYPE_NODE) returns null. This method however returns the correct
> internal subset for the DOCUMENT_TYPE_NODE child of the DOCUMENT_NODE
> (created by parsing XML document into a DOM) from which the clone was created.
> 
> Any idea why this is happening? Any work-arounds?

DOM L2 Core specifies for "cloneNode" that "cloning Document,
DocumentType, Entity, and Notation nodes is implementation dependent".
In our implementation we choose not to clone internalSubset.
The easiest work-around is get it and set it yourself on the cloned
node.

Elena

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org