You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Dylan Parker <dy...@mindstech.com> on 2001/03/13 20:15:42 UTC

Re[2]: Can XSL Files be stored in Jar files along with class files ?

Tuesday, March 13, 2001, 7:05:02 AM, you wrote:


> Implement an EntityResolver that understands how to include jarfiles in its
> search order, and plug that into the parser.

I posted a similar question right before your reply to this person...

I've taken a closer look at EntityResolver, and how the code I am
using is using it... and I am a little confused and wonder if I can
get some pointers.

The documentation around the method setEntityResolver implies that by
calling it you can add (or 'register') your resolver with the other
resolvers currently registered... But in the Xalan code,
StylesheetHandler.java to be specific -- which implements
EntityResolver, the code the uses setEntityResolver appears to treat
it like there can only be a single resolver at any one time...

Which is it?

In the documentation they have the following class :


 import org.xml.sax.EntityResolver;
 import org.xml.sax.InputSource;

 public class MyResolver implements EntityResolver {
   public InputSource resolveEntity (String publicId, String systemId)
   {
     if (systemId.equals("http://www.myhost.com/today")) {
              // return a special input source
       MyReader reader = new MyReader();
       return new InputSource(reader);
     } else {
              // use the default behaviour
       return null;
     }
   }
 }


 And the 'null' with the comment "use the default behaviour" implies
 that a series of resolvers are being tried...

 If I implement a class similar to the above that can handle reading
 from WAR files... how exactly can I make the bridge between Xalan and
 Xerces aware of it? The exact point I NEED the custom resolver is
 when Xalan comes across an xsl:include statement and must retrieve
 the file from inside of a WAR file...

 Any help appreciated!

 Thanks,
 Dylan Parker