Thanks for the response Mark.

I am new to all of this.
I read through the API documentation for the EntityResolver
(http://xml.apache.org/xerces-c/apiDocs/classEntityResolver.html).
It looks like it will do what I need it to.
In fact the sample code in the doc has:
****************
  *#include <xercesc/sax/EntityResolver.hpp>
  *#include <xercesc/sax/InputSource.hpp>

  *class MyResolver : public EntityResolver {
  public:
    InputSource resolveEntity (const XMLCh* const publicId,
                               const XMLCh* const systemId);
   ...
   };

  MyResolver::resolveEntity {
    if (XMLString::compareString(systemId,
"http://www.myhost.com/today";)) {
      MyReader* reader = new MyReader();
      return new InputSource(reader);
    } else {
      return null;
    }
  }
****************

I would need:
    if (XMLString::compareString(systemId, "http://localhost";)) {


Where this breaks down though, is what are the detailed steps that I
need to follow to set this up.

Assuming I have Xerces 2.2.0 installed at:
C:\OpenSrc\xalan\C\xerces-c2_2_0-win32

And Xalan 1.5 at:
C:\OpenSrc\xalan\C\xml-xalan

What file do I need to create and in what directory to add this
override.
Does anyone have a complete .cpp code snippet that I can use.

Once I create this file, I assume I will have to rebuild my Xerces DLLs
(no problem).

After that, I am not sure how to enable the EntityResolver.
I am using the following sample that I have based everything on:
C:\OpenSrc\xalan\C\xml-xalan\c\samples\XalanTransformerCallback

So I am not sure where I need to put the code to enable this.
I am putting it in my XalanTransformaterCallback.cpp file?


If someone could provide me a bit of direction (and code if you can!)
here I would greatly appreciate it.


Right now I have everything working as I need it, but I am actually
copying the xsl:templates directly into the documents instead of using
the xsl:include tags.


Thanks,
Dave



-----Original Message-----
From: Mark Weaver [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 18, 2003 1:27 PM
To: [email protected]
Subject: RE: Xsl:include support?


>
> > Specifically:
> >   <xsl:include href="/xsl?name=genericHead.xsl"/>
> >
> > For Java Xalan, I had to create a XSLTURIResolver.java. When a 
> > xsl:include is found, the resolver tells xalan how to find the 
> > genericHead.xsl document.
> >
> > Is this supported in the C++ Xalan?
> > I have looked around the C++ API docs, but it is quite different 
> > than the Java version.
>
> Xalan-C++ does not have the concept of a URIResolver.  There have been
> requests, but not enough resources to design and implement it.
>
There is an EntityResolver though -- you can create one of these and
provide an appropriate InputSource object.  (These are Xerces objects,
so those are the docs you want to look at)

mARK


Reply via email to