XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Manikandan SurendranathSubject: XSL does not work with Saxon 7
Author: Manikandan Surendranath
Date: 22 Apr 2005 01:53 AM
Hi,

I have written an xslt that work well with MSXML processor, but if i choose "Saxon 7" the templates are not getting applied. What could be the problem?

mani

Postnext
Alberto MassariSubject: XSL does not work with Saxon 7
Author: Alberto Massari
Date: 22 Apr 2005 03:33 AM
Hi Mani,
are you sure you are not using some MSXML-specific instructions (like msxml:script) or even an old WD-XSL namespace in the xmlns:xsl attribute?

Hope this helps,
Alberto

Postnext
Manikandan SurendranathSubject: XSL does not work with Saxon 7
Author: Manikandan Surendranath
Date: 22 Apr 2005 06:53 AM
Yes I have used msxsl:node-set. Is there a way to transform a string to node set which works for both msxml and saxon?

Postnext
Alberto MassariSubject: XSL does not work with Saxon 7
Author: Alberto Massari
Date: 22 Apr 2005 08:20 AM
Hi Mani,
XSLT 1.0 didn't specify a node-set() function, so every vendor implemented their own version. In the case of Saxon, it's called saxon:node-set.
If you need to have a single XSLT that is processable by both engines you will need to use function-available() to test which function is supported by the engine before invoking it.

Hope this helps,
Alberto

Postnext
Manikandan SurendranathSubject: XSL does not work with Saxon 7
Author: Manikandan Surendranath
Date: 25 Apr 2005 06:57 AM
I have remove this dependancy on msxsl and changed the node transformation using xpath condition. Now it works fine for both msxsl and saxon. BTW, is there a way to sniff the processor, can I write an XSLT like ,

if processor is saxon
do saxon:function
else if processor is msxsl
do msxsl:function
otherwise
do xsl:message
fi

Postnext
Alberto MassariSubject: XSL does not work with Saxon 7
Author: Alberto Massari
Date: 25 Apr 2005 08:23 AM
Hi Mani,
you can use function-available, like in this example

<xsl:choose>
<xsl:when test="function-available(msxml:node-set)">
<xsl:for-each select="msxml:node-set($foo)">
<xsl:call-template name="$foo-template"/>
</xsl:for-each>
</xsl:when>
<xsl:when test="function-available(saxon:node-set)">
<xsl:for-each select="saxon:node-set($foo)">
<xsl:call-template name="$foo-template"/>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">
<xsl:text>Sorry, this processor does not support node-set()</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>

Alternatively, you can test the name of the processor itself, by using system-property('xsl:vendor-url'), like in this example

<xsl:choose>
<xsl:when test="system-property('xsl:vendor-url')='http://www.saxonica.com/'">
Running under Saxon 8
</xsl:when>
<xsl:when test="system-property('xsl:vendor-url')='http://saxon.sf.net/'">
Running under Saxon 6
</xsl:when>
<xsl:when test="system-property('xsl:vendor-url')='http://xml.apache.org/xalan-j'">
Running under Xalan-J
</xsl:when>
<xsl:when test="system-property('xsl:vendor-url')='http://www.microsoft.com'">
Running under MSXSL
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">
<xsl:text>Unsupported processor</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>

Hope this helps,
Alberto

Posttop
Manikandan SurendranathSubject: XSL does not work with Saxon 7
Author: Manikandan Surendranath
Date: 25 Apr 2005 08:40 AM
Thanks a lot. Its very helpful.

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.