Return-Path: Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-dev@xml.apache.org Delivered-To: moderator for cocoon-dev@xml.apache.org Received: (qmail 98423 invoked from network); 10 Nov 2000 16:27:01 -0000 Received: from chicken.prod.itd.earthlink.net (207.217.120.114) by locus.apache.org with SMTP; 10 Nov 2000 16:27:01 -0000 Received: from firstech.com (hsa172.pool011.at001.earthlink.net [216.249.74.172]) by chicken.prod.itd.earthlink.net (8.9.3/8.9.3) with ESMTP id IAA19984; Fri, 10 Nov 2000 08:25:38 -0800 (PST) Message-ID: <3A0C218F.DDA6E9C0@firstech.com> Date: Fri, 10 Nov 2000 08:25:51 -0800 From: Gary L Peskin Organization: The Firstech Corporation X-Mailer: Mozilla 4.76 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: dims@yahoo.com CC: xalan-dev@xml.apache.org, cocoon-dev@xml.apache.org Subject: Re: [XalanJ2][C2] javax.xml.tranform API References: <20001110124443.3442.qmail@web110.yahoomail.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Davanum Srinivas wrote: > > Gary, > The newTransformerHandler/SAXResult combination worked. The XMLFilter code for replacing > TRaXFilter didn't. So changed our sources to use the newTransformerHandler/SAXResult combination > and cleaned up references to org.apache.xalan in C2. > > Thanks, > dims > --- Gary L Peskin wrote: > > > Problem #1: We need an explicit import of "org.apache.xalan.transformer.TrAXFilter" as we cache > > > templates and need to get an XMLFilter to work with in our code. We do this as follows: > > > > > > public XMLFilter getXMLFilter() throws TransformerConfigurationException > > > { > > > return new TrAXFilter(templates); > > > } > > > > My first answer here was obviously totally wrong. I think you could > > implement this with cached templates like this: > > > > private SAXTransformerFactory transformerFactory = > > (SAXTransformerFactory) > > TransformerFactory.newInstance(); > > > > public XMLFilter getXMLFilter() throws > > TransformerConfigurationException > > { > > XMLFilter retFilter = new XMLFilterImpl(); > > TransformerHandler th = > > transformerFactory.newTransformerHandler(templates); > > retFilter.setContentHandler(th); > > return retFilter; > > } Dims -- What about this didn't work? If you have time, I'd like to work through it with you to see if we can figure out the problem. That way, cocoon could use straight javax.xml.transform and SAX capabilities without being dependent on Xalan. And we could uncover any problems with the Xalan javax.xml.transform capabilities sooner rather than later. Gary