W3C home > Mailing lists > Public > public-qt-comments@w3.org > February 2006

[Bug 2945] [XSLT] validated content in a variable

From: <bugzilla@wiggum.w3.org>
Date: Mon, 27 Feb 2006 21:53:13 +0000
To: public-qt-comments@w3.org
Message-Id: <E1FDqIr-0001jh-Ah@wiggum.w3.org>


           Summary: [XSLT] validated content in a variable
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLT 2.0
        AssignedTo: mike@saxonica.com
        ReportedBy: joannet@ca.ibm.com
         QAContact: public-qt-comments@w3.org

Consider this example:

<xsl:stylesheet version="2.0"

<xsl:template match="/">
	<xsl:variable name="x">
		<xsl:document validation="strict">
			<a xsi:type="xs:integer">123</a>
	<xsl:value-of select="$x//a instance of xs:integer" />


The user probably expects the content of variable x to be validated and the 
xsl:value-of expression to return true.  However, this is not the case because 
an xsl:document is used implicitly to construct the temporary tree and default-
validation attribute is not specified in the xsl:stylesheet element.  Thus, 
all type information in variable x are stripped and the xsl:value-of 
expression returns false.  This would probably surprise most users since this 
is not obvious from reading the sections on xsl:variable and validation.  So I 
suggest adding an example or a note in the specification to explain the 
importance of specifying either the as attribute or the default-validation 
attribute to preserve type information.  The WG should also consider the 
alternative to always preserve type information in a variable by adding 
validation="preserve" to the implicit document node.
Received on Monday, 27 February 2006 21:53:20 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:10 UTC