This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22713 - Minor error in example in both XSLT 2.0 and 3.0
Summary: Minor error in example in both XSLT 2.0 and 3.0
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Member-only Editors Drafts
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-17 11:46 UTC by Abel Braaksma
Modified: 2014-05-15 14:00 UTC (History)
0 users

See Also:


Attachments

Description Abel Braaksma 2013-07-17 11:46:26 UTC
Under 18.1.1 in XSLT 2.0 and 23.1.1 in XSLT 3.0, a minor error appears in the following example:

<out xsl:version="2.0">
  <xsl:choose>
    <xsl:when test="function-available('matches')">
      <xsl:value-of select="matches($input, '[a-z]*')"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="string-length(
                          translate($in, 'abcdefghijklmnopqrstuvwxyz', '')) = 0"/>
    </xsl:otherwise>
  </xsl:choose>
</out>

The example assumes a variable $input, but under <xsl:otherwise> the variable is called $in. 

In addition, instead of using an undeclared variable, the example is perhaps clearer and more correct if an XPath axis step were used, like title or username. This also applies to the second example using use-when.
Comment 1 Michael Kay 2013-07-17 12:07:45 UTC
Thanks, fixed (as far as the 3.0 spec is concerned).