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
Michael BasileSubject: Template Rule Problem
Author: Michael Basile
Date: 15 Sep 2004 09:30 AM
Ivan,

This behavior doesn't follow the XSL 1.0 spec. (I don't know about 2.0). It
does fail under the MSXML processors (3,4, and .NET) and Saxon 6, but doesn't
under the Saxon 7 and Xalan-J processors (which I think is also a problem).

The following should produce an error (according to Sec. 5.3 of XSL 1.0 spec):

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="location" select="'local'"/>
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="node[@loc=$location]">
this is an error, I think
</xsl:template>
</xsl:stylesheet>

If it is 2.0 behavior, then the problem is in the stylesheet version attribute.

Thanks,
- Mike

Posttop
Ivan PedruzziSubject: Template Rule Problem
Author: Ivan Pedruzzi
Date: 19 Sep 2004 05:36 AM
Hi Michael,

I assume you meant node()[@loc=$location]

Built-in and XalanJ do not enforce this particular rule (personally, I find it handy).

For Saxon 7 I believe is a side effect of XSLT 2 initial support.
The processor doesn't fire the error but the template doesn't macth.
Saxon 8.x is a much better platform to develop XSLT 2 and XQuery.

Ciao
Ivan

 
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.