cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastien Sahuc <ssa...@imediation.com>
Subject RE: [C2] Short TODO list [was CLI almost there]
Date Tue, 03 Oct 2000 10:03:56 GMT


> -----Original Message-----
> From: Davanum Srinivas [mailto:dims@yahoo.com]
> Sent: Tuesday, October 03, 2000 12:42 AM
> To: cocoon-dev@xml.apache.org
> Cc: Scott_Boag@lotus.com
> Subject: Re: [C2] Short TODO list [was CLI almost there]
> 
> 
> Scott,
> 
> Just trying to help. Though am unable to test anything, here 
> are the C2 files with modifications
> for Xalan2. You can use them if you want to :) 
> 

I had a quick look at your XalanTranformer, and I kind of disagree the way
you're using DOM to load the StyleSheet document. 
Why don't you use the trax.TemplatesBuilder which purpose is precisely to
build a cleaner-lighweight-internal Object model from a SAX2 XMLReader ?

So instead of writing (starting at line 85 of XalanTransformer.java) :
			
			DocumentBuilderFactory dfactory =
DocumentBuilderFactory.newInstance();
			DocumentBuilder docBuilder =
dfactory.newDocumentBuilder();
			org.w3c.dom.Document outNode =
docBuilder.newDocument();
			InputSource xslsrc =
resolver.resolveEntity(null,xsluri);
			org.w3c.dom.Node doc = docBuilder.parse(xslsrc);
			trax.Templates templates =
processor.processFromNode(doc);
			transformer = templates.newTransformer();

You should write :
			
			XMLREader reader =
XMLReaderFactory.createXMLReader();
			trax.TemplatesBuilder templatesBuilder =
processor.getTemplatesBuilder();
			reader.setContentHandler (templatesBuilder);
			reader.parse(resolver.resolveEntity(null,xsluri));
			trax.Templates templates =
templatesBuilder.getTemplates();
			trax.Transformer transformer =
templates.newTransformer();
			
And so on.

This approach would allow you to set the templates object in the 'store'
component, and every new request will make a call to the method
templates.newTransformer() since the 'templates' instance is thread safe
from spec.

All the best,

Sebastien
			
			



> One file that i did not attach is a helper for converting 
> NodeIterator to NodeList as i wrote to
> you in my prev. e-mail. 
> 
> Thanks,
> dims
> 
> --- Scott_Boag@lotus.com wrote:
> > 
> > The other issue that will effect Cocoon 2 is that we've 
> moved to use the
> > serialize.* interfaces instead of the Xerces interfaces 
> (see my previous
> > note on this).  I suspect this will be a pretty dramatic 
> impact, though I
> > hope I'm wrong.
> > 
> > > The problem is that extensions are used and Xalan2 is not 
> up to snuff,
> > 
> > Yep, sorry, still not done in spite of my promise.  I hope 
> to get this
> > fixed by tomorrow.
> > 
> > -scott
> > 
> > 
> > 
> > 
> >                                                             
>                                     
> >                   
> >                     "Nicola Ken                             
>                                     
> >                   
> >                     Barozzi"             To:     
> <cocoon-dev@xml.apache.org>, <dims@yahoo.com>  
> >                   
> >                     <nicolaken@su        cc:     (bcc: 
> Scott Boag/CAM/Lotus)                    
> >                   
> >                     pereva.it>           Subject:     Re: 
> [C2] Short TODO list [was CLI almost
> > there]              
> >                                                             
>                                     
> >                   
> >                     10/02/00                                
>                                     
> >                   
> >                     07:47 AM                                
>                                     
> >                   
> >                     Please                                  
>                                     
> >                   
> >                     respond to                              
>                                     
> >                   
> >                     cocoon-dev                              
>                                     
> >                   
> >                                                             
>                                     
> >                   
> >                                                             
>                                     
> >                   
> > 
> > 
> > 
> > 
> > ----- Original Message -----
> > From: "Davanum Srinivas" <dims@yahoo.com>
> > To: <cocoon-dev@xml.apache.org>; <Giacomo.Pati@pwr.ch>
> > Sent: Monday, October 02, 2000 1:40 PM
> > Subject: Re: [C2] Short TODO list [was CLI almost there]
> > 
> > 
> > > > > Is there anyone that wants to help replacing Xalan1 
> with Xalan2 using
> > > > > the TRaX interfaces?
> > > >
> > > > +100000
> > >
> > > Does this mean just replacing XSLTProcessor with 
> trax.Processor? anything
> > else?
> > 
> > No, unfortunately things go much deeper, that is just the tip of the
> > iceberg.
> > The problem is that extensions are used and Xalan2 is not 
> up to snuff,
> > AFAIK, but mostly the ting is that Xalan support was hardcoded.
> > I agree with Stefano, that XSL use in C2 code should be pluggable.
> > 
> > nicola_ken
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
> http://photos.yahoo.com/
> 

Mime
View raw message