Xalan transform output to string

Discussion in 'XML' started by Rene van Hoek, Nov 22, 2004.

  1. 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, Nov 22, 2004
    #1
    1. Advertising

  2. (Rene van Hoek) wrote in message news:<>...
    > 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
     
    Rene van Hoek, Nov 23, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Dobby
    Replies:
    0
    Views:
    421
    Brian Dobby
    Nov 28, 2003
  2. cvissy
    Replies:
    0
    Views:
    631
    cvissy
    Nov 16, 2004
  3. edgekaos
    Replies:
    3
    Views:
    541
    Andrey Tarasevich
    Nov 4, 2005
  4. Replies:
    3
    Views:
    519
    Joe Kesselman
    Aug 11, 2007
  5. Replies:
    0
    Views:
    249
Loading...

Share This Page