xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bentley Drake <bent...@nightfire.com>
Subject FW: FW: Crimson 1.1.3 bug and behavior changes?
Date Wed, 07 Nov 2001 22:16:45 GMT

-----Original Message-----
From: Bentley Drake 
Sent: Tuesday, November 06, 2001 7:21 PM
To: 'Edwin Goei'
Subject: RE: FW: Crimson 1.1.3 bug and behavior changes?


I tried an alternative Document copy implementation using Crimson v 1.1.3
that appears to work.  Here is the code snippet:

        XmlDocument copy = new XmlDocument( );
        DocumentType dt = source.getDoctype( );
        if ( dt != null )
            copy.setDoctype( dt.getPublicId(), dt.getSystemId(),
dt.getInternalSubset() );
        copy.appendChild( copy.importNode( source.getDocumentElement(), true
) );

The code shown above doesn't throw the exception seen earlier when executed.
Unfortunately, it uses one XmlDocument-specific call (setDocType()).  If
there is an alternative means of setting the DOCTYPE information on the
cloned document, i'd appreciate knowing about it.



-----Original Message-----
From: Edwin Goei [mailto:edwingo@sun.com]
Sent: Tuesday, November 06, 2001 9:09 AM
To: Bentley Drake
Subject: Re: FW: Crimson 1.1.3 bug and behavior changes?

Bentley Drake wrote:
> Edwin,
> I didn't try Xerces2 because its a development branch whose APIs might be
> changing. Also, we currently use the Sun ProjectX tr-2 parser, and I was
> hoping the Crimson port would be easier (not to mention that it will be
> of JDK 1.4).  As I mentioned previously, the code ran fine under the
> ProjectX tr-2 parser as well as the version of the Crimson parser that
> shipped with the JAXP-1.1 reference implementation available on the
> site.
> I've managed to reproduce the problem that I emailed you about earlier
> the simplest-possible Java application and XML example.  I've attached the
> source.  The main() method has all of the relevant code.  The following
> statement is throwing the exception:
>             Document copy = (Document)src.cloneNode( true );

What happens when you run this w/ Xerces2 or Xerces1?  cloneNode is a
DOM method which other parsers support.


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

View raw message