[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] The awesome power of Schematron + XPath 2.0 ... Ableto express all my data requirements!
- From: Rick Jelliffe <rjelliffe@allette.com.au>
- To: Fraser Goffin <goffinf@googlemail.com>
- Date: Thu, 25 Oct 2007 23:02:11 +1000
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]