Kelly Graus wrote:
I am working on a code framework that has a fairly robust set of stream classes that allow us to access data from several different sources (ie, files, network files, zip files, executable resources, databases, etc) using a simple path based syntax. I am currently adding Xalan based transformations to the framework, and would like the ability to be able to load the xsl files using our stream classes instead of the classes that Xalan provides. So far, I am able to do this by using our stream classes to read a single xsl file into memory, then using a std::stringstream to create a XalanInputSource. However, several of our transforms reference other transforms.
I'm assuming you're talking about the C++ processor, and not the Java processor. Also, I'm assuming you meant "XSLTInputSource," rather than "XalanInputSource."
I don't know why you are reading the whole stylesheet string into memory, then using std::stringstream to wrap the memory buffer. If you look carefully at the constructors for XSLTInput source, and look at the sample applications, you'll find ways you can adapt your stream classes to Xalan-C's.
For example, I might have a zip file that contains someFile.xml, transform1.xsl, and transform2.xsl. The transform1.xsl file contains a <xsl:include href="transform2.xsl"/> tag. Our stream classes allow us to read directly from the zip file, so I can read transform1.xsl into memory and use it to transform someFile.xml. Obviously, Xalan doesn't know how to read transform2.xsl from the zip file, so this won't work. Is there a way to plug in a class I write that Xalan can use to resolve relative URIs?
You can implement and install an EntityResolver so that Xerces-C will use your stream class. Take a look at the Xerces-C documentation to see what the EntityResolver class looks like.
This sort of question is more appropriate for the user list, rather than the developer list. Please subscribe and post future questions related to using the processor to that list.
Dave --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]