xsl-list
[Top] [All Lists]

Re: [xsl] [saxon - Help] SystemID always empty String

2008-02-18 05:48:15
Johannes Neubauer wrote:

  Hi

source = new StreamSource(new
ByteArrayInputStream(out.toByteArray()));
Templates secondTemplates = saxFactory.newTemplates(source);

  So if I am right, you are generating a stylesheet in the first
transform, and you want to compile this generated stylesheet.  In
general, passing by byte buffers is not a good idea.  It involves
serializing and deserializing for nothing.  Usually piping SAX events
is better.

  JAXP has TemplatesHandler that compiles SAX events representing a
stylesheet.  From the top of my head, the idea is as following:

    // you need a SAX factory
    SAXTransformerFactory factory = ...;
    // this is a ContentHandler
    TemplatesHandler compiler = factory.newTemplatesHandler();
    // the transform
    Transformer trans = ...;
    trans.transform(..., new SAXResult(compiler));
    // get the compiled stylesheet generated by the transform
    Templates generated = compiler.getTemplates();

  Regards,

--drkm























      
_____________________________________________________________________________ 
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 
http://mail.yahoo.fr


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--