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 7976 - [XSLT 2.1] xsl:analyze-string applied to an empty sequence
Summary: [XSLT 2.1] xsl:analyze-string applied to an empty sequence
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Working 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: 2009-10-20 11:14 UTC by Michael Kay
Modified: 2014-05-15 14:00 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2009-10-20 11:14:45 UTC
The new fn:analyze-string() function behaves like most string functions in that it accepts an empty sequence as input, and treats it in the same way as a zero-length string (in both cases the output will be an empty fn:analyze-string-result element).

The xsl:analyze-string instruction in XSLT 2.0 does not work this way: it reports an error if the input is an empty sequence. So, for example, if there is no address element then <xsl:analyze-string select="address"> will cause a type error, but if the address element is present and empty, it will produce empty output.

I propose we change this (a) for usability, (b) for consistency, and (c) to make it a little bit easier for implementations to reuse code between xsl:analyze-string and fn:analyze-string.
Comment 1 Michael Kay 2010-07-16 10:49:12 UTC
Proposal accepted at the F2F meeting in Oxford (change xsl:analyze-string to accept the empty sequence in the same way as fn:analyze-string does).