Yes, you do use XSLTInputSource, it's just that the compiler creates one
implicitly when you call transform() with a pointer to an istream. Instead
of calling transform() with an istream, create an XSLTInputSource using the
istream, and set the system ID on that:
istrstream XMLStream( edi2xml.GetOutMsg(), edi2xml.GetOutMsgLength() ) ;
istrstream XSLStream ( pMessage->GetXSL().IntBufNotNull(),
pMessage->GetXSL().Length() ) ;
ostrstream OutStream ;
const XalanDOMString dummyID("Dummy system ID");
const XSLTInputSource XMLSource(&XMLStream);
XMLSource.setSystemId(c_wstr(dummyID));
const XSLTInputSource XSLSource(&XSLStream);
XSLSource.setSystemId(c_wstr(dummyID));
const int iRes = theTransformer.transform( XMLSource, XSLSource,
&OutStream ) ;
Dave
[EMAIL PROTECTED]
.net To:
[email protected]
cc: (bcc: David N
Bertoni/Cambridge/IBM)
02/26/2002 07:02 Subject:
XalanTranformer::transform using streams
AM
Hello,
I have a similar problem as was described here recently, but I do not use
XSLTInputSource, I use streams.
What is the easiest way of avoiding coredump in case of a syntax error in
an XSL stylesheet? I would prefer not to recompile libraries.
Best regards, Miro.
istrstream * pXMLStream = NULL ;
istrstream * pXSLStream = NULL ;
ostrstream * pOutStream = NULL ;
int iRes ;
pXMLStream = new istrstream( edi2xml.GetOutMsg(), edi2xml.GetOutMsgLength()
) ;
pXSLStream = new istrstream( pMessage->GetXSL().IntBufNotNull(),
pMessage->GetXSL().Length() ) ;
pOutStream = new ostrstream() ;
iRes = theTransformer.transform( pXMLStream, pXSLStream, pOutStream ) ;
if( iRes == 0 )
{...