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

RE: Using a StreamResult as a StreamSource

Subject: RE: Using a StreamResult as a StreamSource
From: "Andrew Welch" <AWelch@xxxxxxxxxxxxxxx>
Date: Tue, 12 Aug 2003 09:25:42 +0100
streamresult

> > How can I use a StreamResult for a StreamSource. I am
> > transforming an xml document twice. The result of the first
> > transform is used to generate the transformer object for the
> > second transform. What is the best way to accomplish this
> > task. Please include examples with your suggestions.
> 
> We're talking JAXP here, for those who are mystified...
> 
> The best way to pipeline the output of one transformation as the input
> of another is not using StreamResult/StreamSource, but using SAX.
There
> are various mechanisms in JAXP to allow such pipelining. You can
compile
> a transformation as a SAXFilter, in which case it can be inserted into
a
> SAX pipeline along with other SAXFilters (which may or may not be XSLT
> transformations). You can also wrap a Transformer into a SAX
> ContentHandler, which you can then use as the SAXResult of another
> transformation.
> 
> But if you must use StreamResult/StreamSource, then you can always
> create a StreamResult for the first transformation based on a
> StringWriter, and the use a StringReader over the same String as the
> basis for the StreamSource for the next transformation.

How can I pass parameters to a SAXFilter in the middle of a pipeline?
Is that feasible?

>From my reading of your last paragraph, using a
StringWriter/StringReader combination isn't *that* wasteful... so its
not quite the same as writing something out to read back in?

I ask because I want to use XMLFilters on the way into the transform,
perform a transformation with some parameters, then use more XMLFilters
on the result.

Currently I use a StringWriter, then convert that to an InputSource for
the XMLFilters that work on the result.

cheers
andrew

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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-2013 All Rights Reserved.