From general-return-5262-apmail-xml-general-archive=xml.apache.org@xml.apache.org Wed Nov 07 22:15:53 2001 Return-Path: Delivered-To: apmail-xml-general-archive@xml.apache.org Received: (qmail 34772 invoked by uid 500); 7 Nov 2001 22:15:53 -0000 Mailing-List: contact general-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: general@xml.apache.org Delivered-To: mailing list general@xml.apache.org Received: (qmail 34761 invoked from network); 7 Nov 2001 22:15:53 -0000 Message-ID: <580DF4AEAC15D411A1D200508BA0E7E40274453A@mail> From: Bentley Drake To: "'general@xml.apache.org'" Subject: FW: FW: Crimson 1.1.3 bug and behavior changes? Date: Wed, 7 Nov 2001 14:16:45 -0800 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="ISO-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N -----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? Edwin, 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. Thanks, Bentley -----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 part > 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 Javasoft > site. > > I've managed to reproduce the problem that I emailed you about earlier using > 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. -Edwin --------------------------------------------------------------------- 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