You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by mv...@amadeus.net on 2002/08/30 14:24:24 UTC

XalanTranformer::transform using streams (reuse)

Hello,

probably a simple question. This is a bit of code:

istrstream * pXMLStream = new istrstream( pXMLContent, strlen(pXMLContent) 
) ;
istrstream * pXSLStream = new istrstream( pXSLContent, strlen(pXSLContent) 
) ;
ostrstream * pOutStream = new ostrstream() ;

iRes = pTransformer->transform( pXMLStream, pXSLStream, pOutStream ); // 
OK, returns 0.
iRes = pTransformer->transform( pXMLStream, pXSLStream, pOutStream ); // 
The second call returns an error.

        "Fatal Error at (file <unknown>, line 1, column 1): The main XML 
document cannot be empty"

I thought that something like:
        pXMLStream->rdbuf()->seekpos(0);
before calling the method would help, but it didn't.

If I use XSLTInputSource:
        pXMLSource = new XSLTInputSource(pXMLStream); // transform using 
XSLTInp...
I get the same result.

Thanks in advance. Regs, Miro.