This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Fw: getting the transformation results as a string ( XT )
- To: XSL-list at mulberrytech dot com
- Subject: Fw: getting the transformation results as a string ( XT )
- From: Paul Tchistopolskii <paul at qub dot com>
- Date: Wed, 12 Apr 2000 19:13:49 -0700
- Organization: The Qub Group
- Reply-To: xsl-list at mulberrytech dot com
I feel that I'm missing something and probably there is some
simpler way?
From: Paul Tchistopolskii
Sent: Wednesday, April 12, 2000 7:03 PM
Subject: Re: getting the transformation results as a string
1. It depends on what part of XT you want to use ( there are 2 engines
inside XT, one is om-based and another is dom-based ).
2. The basic solution should be to use FileDestination, redirecting
the output into ByteArrayOutputStream, I think. Another way could be to
assign OutputHandler that will capture resulting stream of
SAX events and then accumulate those events in your
string or byte array.
3. Also, I think you could place the transformation into the variable
and then play with produced result-tree-fragment ( passing it to your
extenstion function for example ).
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:variable name='result'>
<!-- transformation starts here -->
<A>
<xsl:value-of select="a"/>
</A>
<!-- transformation ends here -->
</xsl:variable>
<!-- $result now contains <A> </A> tags -->
<xsl:copy-of select="$result"/>
</xsl:template>
</xsl:stylesheet>
Rgds.Paul.
> ----- Original Message -----
> Sent: Wednesday, April 12, 2000 3:00 PM
> Subject: getting the transformation results as a string
> > Paul,
> >
> > Is there a method that returns the transformation as a string or a byte
> > array using xt?
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list