[jcifs] XSLT

Michael B Allen mba2000 at ioplex.com
Thu May 27 22:35:00 GMT 2004


eglass1 at comcast.net said:
>> I'm not sure. I'm using the builtin 'style' task of Ant 4 with the
>> optional jar. From reading the docs which processor you use is highly
>> dependant on what is in the CLASSPATH and what loads. So I'm not sure
>> how
>> to decipher what's going on.
>>
>
> If you're using JDK 1.4, it is likely using Xalan.  You can confirm this
> by typing:
>
> java org.apache.xalan.xslt.Process

Indeed. I get Xalan options listed.

> and seeing if anything happens (this should invoke the command line XSLT
> processor).
>
> I can confirm that Xalan will do this with output method html, but only to
> attributes it recognizes as URLs; i.e., if you pass in a document:
>
> <html>
>     <a href="http://foo/stuff&more">test</a>
>     <foo href="http://foo/stuff&more">test</foo>
> </html>
>
> you get:
>
> <html>
>     <a href="http://foo/stuff&more">test</a>
>     <foo href="http://foo/stuff&more">test</foo>
> </html>
>
> I don't know if this is conformant to the XSLT spec or not; I suspect this
> is
> done to accommodate browsers that don't convert & --> & when
> parsing the URL maybe?

That's rather unfoutunate. I'm using -//W3C//DTD HTML 4.01
Transitional//EN DTD and the W3C validator is complaining about the
unescaped &s. Something's gotta give.

>> Another problem I have is that passing params into the transform does
>> not appear to work.
>
> I know Xalan does, and it appears to work properly with the Ant style
> task (using Ant 1.6.1, results may vary for older versions):
>
> <style style="test.xsl" in="test.xml" out="testout.xml">
>     <param name="myparam" expression="myvalue"/>
> </style>
>
> Then just declare "myparam" in the stylesheet:
>
> <xsl:param name="myparam" select="''"/>

That works. I didn't have the select="''". What is that all about? I know
passing params isn't standard but I didn't have to do that with XT.

Thanks,
Mike


More information about the jcifs mailing list