Hello Chiba Team,
I'm attempting to implement XSLTC in our Chiba implementation and I've noticed
something odd in the xalan package.
When the xsltc parser attempts to resolve an import tag in your XSL like this:
<xsl:import href="dates.xsl" />
Xalan assumes that the give implementation of URIResolver will return something
that can be cast to a DOM Document.
see line 136 of org.apache.xalan.xsltc.trax.Util
While using your XSLTGenerator as our resolver I noticed a ClassCastException.
It took sometime to find but it came down to Line 229 of
org.chiba.tools.xslt.XSLTGenerator which looks like this:
DOMSource ds = new DOMSource(stylesheet.getDocumentElement());
The net effect of the exception is that your imports are ignored in the compile
process.
I can make the ClassCastException go away by modifying the above line to:
DOMSource ds = new DOMSource(stylesheet);
Since the URIResolver interface can return any valid Source object and a
DOMSource containing a Element is valid, I think this is a xalan bug but you
may want to update your code anyway because there seems to be no harm caused by
the modification I made and it may save someone else hours of digging later.
Cheers,
William
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
|