[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: [saxon - Help] SystemID always empty String

Subject: Re: [saxon - Help] SystemID always empty String
From: Florent Georges <lists@xxxxxxxxxxxx>
Date: Mon, 18 Feb 2008 13:47:51 +0100 (CET)
Re:  [saxon - Help] SystemID always empty String
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.