xsl-list
[Top] [All Lists]

Re: JS language binding

2002-10-17 09:35:45
Hi Doug,

Michael Kay's XSLT book (p. 593) gives an example that won't work in
version 5 of XML Spy.
It complains about <xsl:script> elements in this code sample:
<xsl:stylesheet version="1.1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:js="javascript:code">
        <xsl:script language="javascript"
implements-prefix="js"></xsl:script>
</xsl:stylesheet>
Is there a different name space I should be using?

No, there's a different version of XSLT you should be using. The 2nd
edition of Mike's book covers XSLT 1.1, which was still a Working
Draft at time of writing, and died shortly afterwards. <xsl:script> is
one of the new XSLT 1.1 features; you can tell that the stylesheet is
using version 1.1 because the version attribute on the
<xsl:stylesheet> element has the value '1.1'.

Basically, you can't use new features added in the XSLT 1.1 WD unless
you're using Saxon or jd.xslt. You can't use <xsl:script> in XSLT 1.0,
but you may be able to use an equivalent element to declare functions,
for example <msxsl:script> if you're using MSXML (which I believe you
can do with XML Spy). Have a look at page 134 for an example.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>