Return-Path: Delivered-To: apmail-xml-xerces-j-dev-archive@www.apache.org Received: (qmail 50806 invoked from network); 4 Feb 2004 22:30:18 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 4 Feb 2004 22:30:18 -0000 Received: (qmail 61674 invoked by uid 500); 4 Feb 2004 22:29:49 -0000 Delivered-To: apmail-xml-xerces-j-dev-archive@xml.apache.org Received: (qmail 61538 invoked by uid 500); 4 Feb 2004 22:29:48 -0000 Mailing-List: contact xerces-j-dev-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: xerces-j-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list xerces-j-dev@xml.apache.org Received: (qmail 61433 invoked from network); 4 Feb 2004 22:29:47 -0000 Received: from unknown (HELO e5.ny.us.ibm.com) (32.97.182.105) by daedalus.apache.org with SMTP; 4 Feb 2004 22:29:47 -0000 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e5.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id i14MTr0J682162; Wed, 4 Feb 2004 17:29:53 -0500 Received: from d25ml06.torolab.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by northrelay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i14MTqtR128208; Wed, 4 Feb 2004 17:29:53 -0500 To: xerces-j-dev@xml.apache.org, xalan-dev@xml.apache.org From: Elena Litani Subject: Moving towards common serialization code... Date: Wed, 4 Feb 2004 17:29:48 -0500 Message-ID: X-MIMETrack: Serialize by Router on D25ML06/25/M/IBM(Release 6.0.2CF1|June 9, 2003) at 02/04/2004 17:29:50 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi all, As you might know, currently both Xalan and Xerces include their own version of serialization code. In Xerces the code is located in org.apache.xml.serialize package [1] and in Xalan it is in org.apache.xml.serializer package [2]. Historically, the serialization code was first contributed to the Xerces project. Later given Xalan specific needs, the Xalan team decided to take this code into their repository and develop it further. So the code has diverged and the development continued in both code bases. As you can imagine, this situation is unfortunate. It is a waste to have two projects continuing separate development on the same functionality. Ideally, all common components should live in the xml-commons repository. A week ago Michael Glavassevich, Henry Zongaro, Brian Minchau, Lisa Martin and I looked at the differences in the Xerces/Xalan serializer code base. We found that Xalan's serializers have basically the same capability as the Xerces ones. In addition, during last year there has been a significant effort to improve performance and fix bugs in the Xalan code base. Therefore, it seems that Xalan's serializers should become *the main code base* for development and Xerces' serializer should be deprecated (for at least a year) and later if possible removed. We've compared the HTML and XHTML serializers and found that Xalan's serializers have better performance and conformance to the HTML specification. Therefore, as a first step, we would like to deprecate the HTML and XHTML serializers in Xerces. To migrate, users should start using the JAXP Transformation API, for example: // Create an "identity" transformer - copies input to output Transformer t = TransformerFactory.newInstance().newTransformer(); // for "XHTML" serialization, use the output method "xml" // and set publicId as shown t.setOutputProperty(OutputKeys.METHOD, "xml"); t.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, "-//W3C//DTD XHTML 1.0 Transitional//EN"); t.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"); // For "HTML" serialization, use t.setOutputProperty(OutputKeys.METHOD, "html"); // Serialize DOM tree t.transform(new DOMSource(doc), new StreamResult(System.out)); Currently, we are investigating what it would take for us to deprecate Xerces' XMLSerializer, since our serializer provides a DOM Level 3 implementation and Xalan's serializer does not have this functionality. In general, as JAXP 1.3 comes out users should not be using Xerces or Xalan serialization code directly. Instead, the JAXP Transformer API should be used to serialize HTML, XHTML, and the SAX and DOM Level 3 API should be used to serialize DOM. Any thoughts? [1] http://cvs.apache.org/viewcvs.cgi/xml-xerces/java/src/org/apache/xml/serialize/ [2] http://cvs.apache.org/viewcvs.cgi/xml-xalan/java/src/org/apache/xml/serializer/ Thank you, -- Elena Litani/ IBM Toronto --------------------------------------------------------------------- To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org For additional commands, e-mail: xerces-j-dev-help@xml.apache.org