Subject: Re: [xsl] correct namespace for duration sub-types? From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx> Date: Tue, 1 May 2007 21:29:21 +0530 |
Saxon is right. Usage of xs: namespace is correct, while usage of xdt: namespace is wrong. This change was done by XSL WG.
Hi Chaps,
I am a bit confused about which is the correct namespace for duration subtypes, e.g. dayTimeDuration, monthYearDuration etc.
I was under the impression that the correct namespace is http://www.w3.org/2005/xpath-datatypes
However when using the latest Saxon 8.9.0.3, it complains if I bind the duration sub-types to that namespace, with the message -
XPath syntax error at char 29 on line 5 in {xdt:dayTimeDuration('P2DT0S')}: Cannot find a matching 1-argument function named {http://www.w3.org/2005/xpath-datatypes}dayTimeDuration()
It is only happy when I bind the duration sub-types to the Schema namespace - http://www.w3.org/2001/XMLSchema
The following simplified XSLT2 Snippet shows the problem in Saxon. If you change xdt:dayTimeDuration('P2DT0S') to xs:dayTimeDuration('P2DT0S') then it works correctly, but is this incorrect behaviour on Saxon's part? or have I made a mistake? -
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdt="http://www.w3.org/2005/xpath-datatypes" version="2.0"> <xsl:output encoding="UTF-8" media-type="text/xml" version="1.0" indent="yes"/> <xsl:template match="/"> <xsl:value-of select="xdt:dayTimeDuration('P2DT0S')"/> </xsl:template> </xsl:stylesheet>
Thanks Adam
-- Adam Retter
Principal Developer Devon Portal Project Room 310 County Hall Topsham Road Exeter EX2 4QD
t: 01392 38 3683 f: 01392 38 2966 e: adam.retter@xxxxxxxxxxxx w: www.devonline.gov.uk
-- Regards, Mukul Gandhi
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] correct namespace for duratio, Adam Retter | Thread | Re: [xsl] correct namespace for dur, Adam Retter |
[xsl] correct namespace for duratio, Adam Retter | Date | [xsl] error: data-type on xsl:sort , Angela Williams |
Month |