You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Da...@lotus.com on 2000/07/12 21:28:16 UTC

RE: Writing resulting HTML into a buffer instead of to a file - N ewbie

Hi Andrew,

Well, your original message said nothing about writing to a DOMString, just
writing to some sort of buffer.  Why do you want to write to a DOMString?

Of course, you can create a DOMString from a const char*, so why not just
do the following:

   DOMString    theResultAsDOMString(theStream.str().c_str());

You might also do the following:

   #include <PlatformSupport/DOMStringPrintWriter.hpp>

   ...

   DOMStringPrintWriter    thePrintWriter;

   XSLTResultTarget        theTarget(&thePrintWriter);

   // Calling theTarget.getString() will return the result of the
   transform...

This will result in a UTF-16 string, so you'll need to transcode if you
need UTF-8.  I should warn you that writing directly to a DOMString is
likely to result in lousy performance, since DOMString is a pretty
inefficient beast, but I don't know this for sure.

In the future, please try to be more specific, as answering questions takes
away from the time we have to actually write the code.

Dave




                                                                                                                                   
                    "Phillips,                                                                                                     
                    Andrew"                  To:     "'xalan-dev@xml.apache.org'" <xa...@xml.apache.org>                       
                    <Andrew_Phillips@        cc:     (bcc: David N Bertoni/CAM/Lotus)                                              
                    Mitel.COM>               Subject:     RE: Writing resulting HTML into a buffer instead of to a file - N ewbie  
                                                                                                                                   
                    07/12/2000 02:53                                                                                               
                    PM                                                                                                             
                    Please respond to                                                                                              
                    xalan-dev                                                                                                      
                                                                                                                                   
                                                                                                                                   



Hello,

           I attempted to perform the transformation as you suggested but
ran into a problem. An error is generated after the following lines
// Our output target...
        stringstream              theStream;
        XSLTResultTarget          theResultTarget(&theStream);

The problem is that &theStream cannot be converted into a Domstring.  The
logic of what you are trying to attempt makes sense but just doesn't work.
Do i have to typecast this or make some other alterations??

Thanks

Andrew

<stuff snipped out here>
...



                    "Phillips,

                    Andrew"                  To:
"'xalan-dev@xml.apache.org'" <xa...@xml.apache.org>

                    <Andrew_Phillips@        cc:     (bcc: David N
Bertoni/CAM/Lotus)
                    Mitel.COM>               Subject:     RE: Writing
resulting HTML into a buffer instead of to a file - N ewbi e
                    06/28/2000 05:21

                    PM

                    Please respond to

                    xalan-dev






Sorry,

           I'm using the C++ version of Xalan.

Thanks,
Andrew

-----Original Message-----
From: David_N_Bertoni@lotus.com [mailto:David_N_Bertoni@lotus.com]
Sent: Wednesday, June 28, 2000 5:15 PM
To: xalan-dev@xml.apache.org
Subject: Re: Writing resulting HTML into a buffer instead of to a file -
Newbi e



If you tell us whether you're using the Java version or the C++ version of
Xalan, someone can answer the question.

Dave




                    "Phillips,

                    Andrew"                  To:
"'xalan-dev@xml.apache.org'" <xa...@xml.apache.org>

                    <Andrew_Phillips@        cc:     (bcc: David N
Bertoni/CAM/Lotus)
                    Mitel.COM>               Subject:     Writing resulting
HTML into a buffer instead of to a file - Newbi e

                    06/28/2000 05:07

                    PM

                    Please respond to

                    xalan-dev






Hey,

           I am trying to create HTML by combining XML in a buffer with a
XSL and have the results stored in a buffer.  Its running to this point but
the resulting HTML is being stored in a file.  The problem I am having is I
believe that this functionality isn't supported yet.  Has anyone attempted
this, if so could you please forward me some tips or some sample code.

Thanks in advance

Andrew Phillips