[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: The awesome power of Schematron + XPath 2.0 ... Ableto exp

  • From: Rick Jelliffe <rjelliffe@a...>
  • To: Fraser Goffin <goffinf@g...>
  • Date: Thu, 25 Oct 2007 23:02:11 +1000

Re:  The awesome power of Schematron + XPath 2.0 ... Ableto exp
On Thu, 2007-10-25 at 12:56 +0100, Fraser Goffin wrote:

> 3. Neither the test for xs:nonNegativeInteger or xs:long would work
> with SaxonB, it said :-
>  
> 'The type xs:nonNegativeInteger is not recognised by a basic XSLT
> processor'
>  
> Changing both to xs:integer was OK, so I don't know if this is a
> limitation of SaxonB which will go away when I switch to SaxonSA ?

I am putting in the fix for iso_schematron_skeleton_for_saxon and will
put it up shortly. If you want it now, here is the untested code:

At around line 532 replace the template with 

-------------------------<SNIP>
 
<!-- Using XSLT 2 -->
<xsl:template match="iso:schema[@queryBinding='xslt2']" priority="10">
	<axsl:stylesheet
	   xmlns:xs="http://www.w3.org/2001/XMLSchema" 
	   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
		xmlns:saxon="http://saxon.sf.net/" 
	   >
        <xsl:apply-templates 
		select="iso:ns" />
	    <!-- Handle the namespaces before the version attribute: reported
to help SAXON -->
	    <xsl:attribute name="version">2.0</xsl:attribute>
	    <xsl:attribute
name="saxon:allow-all-built-in-types">yes</xsl:attribute>
	    <xsl:attribute name="exclude-result-prefixes">saxon</xsl:attribute>
	    
		<xsl:apply-templates select="." mode="stylesheetbody"/>
		<!-- was xsl:call-template name="stylesheetbody"/ -->
	</axsl:stylesheet>
</xsl:template>


<!-- Using XSLT 2 (just xpath2 subset)-->
<xsl:template match="iso:schema[@queryBinding='xpath2']" priority="10">
	<axsl:stylesheet
	   xmlns:xs="http://www.w3.org/2001/XMLSchema" 
	   xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
	   >
        <xsl:apply-templates 
		select="iso:ns" />
	    <!-- Handle the namespaces before the version attribute: reported
to help SAXON -->
	    <xsl:attribute name="version">2.0</xsl:attribute>
	  
	    
		<xsl:apply-templates select="." mode="stylesheetbody"/>
		<!-- was xsl:call-template name="stylesheetbody"/ -->
	</axsl:stylesheet>
</xsl:template>

----------------------<STOP SNIP>

(Note that XALAN wants <xsl:attribute> before any <xsl:apply-templates>
which is problematic if you want the templates to contribute namespace
declarations that will then get used. This is one reason I am forking
the XSLT1 and XSLT2 schematron skeletons, I want to quarantine
funnies.) 

I have also just emailed the Schematron mail list about whether people
are happy if we standardize that 
  *  @sch:schema/queryBinding='xpath2' corresponds to basic XSLT2
processor with no optional XPath features or extensions;  
  *  @sch:schema/queryBinding='xslt2' corresponds to schema-aware XSLT2
processor with any optional XPath features and user-defined functions,
but not actually using an XSD schema (so SAXON B with that
allow-all-built-in-functions could cope with most of these)
  *  @sch:schema/queryBinding='xslt2-with-xsd' is the same but actually
operating on a (virtual) type-annotate tree. 

I think the Xpath2 restriction on most built-in derived types needs to
be corrected: you don't get simplicity or interoperability by
multiplying cases. 

Cheers
Rick Jelliffe



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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