You may have an off-by-one error.
strlen(...) reports the number of octets not counting the terminating null.

The <stream>.c_str() returns a null-terminated string.

Sincerely,
Steven J. Hathaway

> Hi All,
>
> I am using stream transformation...it is working fine for me except I am
> getting some junk characters in the end of the output stream.  The code is
> as follows
>
>     istrstream theXMLStream(inputXML.c_str(), strlen(inputXML.c_str()));
>     istrstream theXSLStream(inputXSL.c_str(), strlen(inputXSL.c_str()));
>     ostrstream outputStream;
>
>     XALAN_USING_XALAN(XalanDOMString)
>     XALAN_USING_XALAN(XSLTInputSource)
>     XALAN_USING_XALAN(XSLTResultTarget)
>
>     XSLTInputSource  inputSource(&theXSLStream);
>
>     // Do the transform.
>     theResult = theXalanTransformer.transform(&theXMLStream, inputSource,
> outputStream);
>
> In the output stream object I got the correct transformed string but with
> some extra junk chars in the end.
>
> Can anyone please tell, what I am doing wrong.
>
> Thanks for help in advance.
> Dinesh
>



---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscr...@xml.apache.org
For additional commands, e-mail: xalan-dev-h...@xml.apache.org

Reply via email to