Thanks for both of those suggestions.  That probably has enough to get
me working.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 17, 2003 1:48 PM
To: [email protected]
Subject: Re: Need sample using ostream






> I have recompiled Xalan 1.5, Xerces 2.2.0.
> I have also flipped through and tried some of the various examples. I 
> decided I would start with XalanTransform sample.
>
> My C++ skills are pretty well novice.  I can usually deal with a 
> sample and modify it to get what I need working.  I have never used 
> the iostream class and am having serious difficulties.
>
> Here is the problem.
>
> XalanTransform will transform foo.xml and foo.xsl to either a 
> specified file, or to std out. Since I will be calling transform() 
> from a DLL, I need to have the transformation done into a buffer.  
> Then I need to return that buffer to my calling program.

Did you look at the StreamTransform sample?

> Modifying XalanTransform sample to use an ostream would be perfect. 
> Instead of using cout, I would like it to create an ostream, have the 
> transform method use it. Then print the output from it, since I will 
> have to copy the contents of the ostream to my own variable 
> afterwards.

This will be really inefficient.  You should look at the
XalanTransformerCallback sample.  Using a callback will deliver the data
as it's produced, and you can store it directly into your variable.

Dave


Reply via email to