You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Christos Karras <ck...@capella.org> on 2002/12/23 16:35:43 UTC

differences between URIResolver in Xalan and XSLTC

I am modifying an application to use XSLTC instead of Xalan. The 
application uses a custom URIResolver to resolve document() refrences in 
stylesheets, and when the resolver is called, it gets different values 
for the "base" parameter depending on if I'm using Xalan or XSLTC:

- With Xalan, the base is the system id that was assigned to the 
*stylesheet's* Source
- However, with XSLTC, the base is the system id that was assigned to 
the *xml document's* Source

Which one, of Xalan or XSLTC, is calling my URIResolver the right way?

For exemple:
    StreamSource srcXSL = new StreamSource(inXSL);    
    srcXSL.setSystemId("stylesheet.xsl");
    Templates template = transformerFactory.newTemplates(srcXSL);

    Transformer transformer = template.newTransformer();       
    transformer.setURIResolver(new TestURIResolver());

    StreamSource srcXML = new StreamSource(inXML);
    srcXML.setSystemId("document.xml");
    transformer.transform(srcXML, out);

When I use XSLTC, TestURIResolver.resolve() is called with 
"document.xml" as a base, and when I switch back to Xalan, it is called 
with "stylesheet.xsl" as a base.

I'm using Xalan 2.4.1

Thanks