Re: Xalan transformation using xsl files within the war

Kai Ojansuu <[email protected]>
Newsgroups gmane.comp.java.sun.servlet
Message-ID <[email protected]>
One solution is to implement your own URIResolver, something like
this:

public class MyResolver implements URIResolver {
  //the only method in URIResolver
  public Source resolve(String href, String base) {
     InputStream is =
getClass().getClassLoader().getResourceAsStream(href);
     return new StreamSource( is );
  }
}

TransformerFactory.setURIResolver( myResolver );

Now your class will be used to resolve includes etc.

-clapu

On Sun, 20 Apr 2003, James Smith wrote:
> ....
> One solution could be get the file as a InputStream using URL
> (this.getClass().getClassLoader().getResource("")), and this way Xalan find
> the xsl file, but one of the xsl files use include directive and therefore
> the included file cannot be found.
>
> Any ideas ???
>
> Thanx
>
> ___________________________________________________________________________
> To unsubscribe, send email to [email protected] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>

___________________________________________________________________________
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.