This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: JAXP URIResolver is being called twice?
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] JAXP URIResolver is being called twice?
- From: Taras Tielkes <taras at info dot nl>
- Date: Wed, 19 Sep 2001 18:32:38 +0200
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Michael,
You're right, it's a bug (or is it? At least it's undesirable behaviour).
The original issue I reported disappeared when I switched to Xalan 2.2 D10.
A slight modification of the template causes the bug to reappear again
(using Xalan 2.2D10).
I've found a bug at the Xalan-J bug database:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2425
Regards,
// tt
> -----Original Message-----
> From: Michael Kay [mailto:mhkay@iclway.co.uk]
> Sent: Tuesday, September 18, 2001 6:54 PM
> To: xsl-list@lists.mulberrytech.com
> Subject: RE: [xsl] JAXP URIResolver is being called twice?
>
>
> The XSLT processor you are using is Xalan; I suggest you
> raise this on the
> Xalan list.
>
> Mike Kay
>
> > -----Original Message-----
> > From: owner-xsl-list@lists.mulberrytech.com
> > [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of
> > Taras Tielkes
> > Sent: 18 September 2001 17:13
> > To: Xsl-List (E-mail)
> > Subject: [xsl] JAXP URIResolver is being called twice?
> >
> >
> > Hi,
> >
> > I'm registering a custom URI resolver in the XSLT processor
> > that shipped
> > with JAXP 1.1(.1?).
> >
> > Here's the source:
> > ------------------------
> > import java.io.StringReader;
> > import java.io.FileOutputStream;
> >
> > import javax.xml.transform.stream.StreamSource;
> > import javax.xml.transform.stream.StreamResult;
> > import javax.xml.transform.*;
> > import javax.xml.transform.dom.*;
> >
> > public class CustomURIResolver implements URIResolver
> > {
> > public static void main(String[] args)
> > {
> > try
> > {
> > String sourceXML = "<x/>";
> >
> > StreamSource xsl = new
> > StreamSource("resolve.xsl");
> > StreamSource xml = new StreamSource(new
> > StringReader(sourceXML));
> >
> > TransformerFactory tf =
> > TransformerFactory.newInstance();
> >
> > Transformer t = tf.newTransformer(xsl);
> > t.setURIResolver(new CustomURIResolver());
> >
> > StreamResult r = new StreamResult(new
> > FileOutputStream("c:\\out.xml"));
> >
> > t.transform(xml, r);
> > }
> > catch(Exception e)
> > {
> > e.printStackTrace();
> > }
> > }
> >
> > public Source resolve(String relURI, String base)
> > {
> > System.err.println("[resolve] relURI = " +
> > relURI + " + base
> > = " + base);
> >
> > return null;
> > }
> > }
> > ------------------------
> >
> > The XSL is very simple:
> > ------------------------
> > <?xml version="1.0"?>
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> >
> > <xsl:template match="/">
> > <xsl:apply-templates select="document('dummy')"/>
> > </xsl:template>
> >
> > </xsl:stylesheet>
> > -------------------------
> >
> > The output however, is unexpected:
> > -------------------------
> > [resolve] relURI = dummy + base = file:/C://resolve.xsl
> > [resolve] relURI = dummy + base = file:/C://resolve.xsl
> > file:/C://resolve.xsl; Line 5; Column -1; Can not load
> requested doc:
> > C:\dummy (The system cannot find the file specified)
> >
> > Of course, I understand the last line, but why is my resolver
> > called twice?
> > Even when I actually return a valid Source subclass
> instance, the same
> > behaviour can be observed.
> >
> > Am I missing something abvious?
> >
> > Thanks in advance,
> > Taras Tielkes
> >
> >
> >
> >
> >
> >
> >
> >
> > XSL-List info and archive:
> http://www.mulberrytech.com/xsl/xsl-list
> >
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list