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 David Fishburn <fi...@ianywhere.com> on 2003/08/06 19:22:00 UTC
Using XSLTinputSource
Xalan 1.6
Xerces 2.3.0
WinXP
VC 6 sp5
I basically copied the StreamTransform code from Xalan 1.5 (just moved
to Xalan 1.6)
istrstream theXSLStream(xsl_str.c_str());
XALAN_USING_XALAN(XalanDOMString);
XALAN_USING_XALAN(XSLTInputSource);
XALAN_USING_XALAN(XalanTransformer);
XALAN_USING_XERCES(XMLPlatformUtils);
XSLTInputSource inputSource(&theXSLStream);
inputSource.setSystemId(XalanDOMString("xsl").c_str());
Code that did work in Xalan 1.5 / Xerces 2.2.0, fails at the last line
above.
An exception is thrown, except I am not sure what I should catch,
inorder to display an appropriate error message (any suggestions?).
See my previous post on compiling the Debug version.
My main question is this:
What is this line doing:
inputSource.setSystemId(XalanDOMString("xsl").c_str());
xsl_str.c_str() is a variable I create that has my XSL in it.
The xsl has xsl:include tags.
I had to write an entity resolver (problem with previous post) in order
to convert my:
<xsl:include href="/xsl?name=genericStatusError.xsl" />
So that Xalan/Xerces gets this:
http://localhost/xsl?name=genericStatusError.xsl
I think this looks suspicious:
XalanDOMString("xsl").c_str()
The stream example had "foo", I replaced that with "xsl", but what
really is it doing?
After I wrote the entity Resolver, I see the systemID has the file
location that I stared the project from.
Could I do something like this:
inputSource.setSystemId(XalanDOMString("http://localhost").c_str());
And then not have to worry about having to write an entity Resolver?
Thanks,
Dave