Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   XML (http://www.velocityreviews.com/forums/f32-xml.html)
-   -   Xalan transform output to string (http://www.velocityreviews.com/forums/t168281-xalan-transform-output-to-string.html)

Rene van Hoek 11-22-2004 04:42 PM

Xalan transform output to string
 
Hi,

I am using Xalan to transform XML with XSL stylesheets. I don't know
how too put the output into a string (e.g. std::wstring).

I know that there are classes like DOMStringPrintWriter and
XalanOutputStreamPrintWriter but I do not know how to use them.

Can someone give an example?

Thanks.

Rene

Rene van Hoek 11-23-2004 10:47 AM

Re: Xalan transform output to string
 
rvanhoek@hotmail.com (Rene van Hoek) wrote in message news:<1061bb5.0411220842.34cef288@posting.google.c om>...
> Hi,
>
> I am using Xalan to transform XML with XSL stylesheets. I don't know
> how too put the output into a string (e.g. std::wstring).
>
> I know that there are classes like DOMStringPrintWriter and
> XalanOutputStreamPrintWriter but I do not know how to use them.
>
> Can someone give an example?
>
> Thanks.
>
> Rene

Oke I found the answer, it is very simple. Use the outputstream classes from stl.

std::ostringstream ostream;

XSLTResultTarget result(ostream);
int run_result = theXalanTransformer.transform(theSource, xsl.c_str(), result);
ostream.str();


Rene


All times are GMT. The time now is 03:14 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57