Xalan transform output to string

R

Rene van Hoek

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
 
R

Rene van Hoek

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::eek:stringstream ostream;

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


Rene
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top