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 2698 - [XSLT] what if $group-number is a negative integer
Summary: [XSLT] what if $group-number is a negative integer
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 2.0 (show other bugs)
Version: Candidate Recommendation
Hardware: All All
: 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: 2006-01-11 18:50 UTC by Joanne Tong
Modified: 2006-02-02 19:38 UTC (History)
0 users

See Also:


Attachments

Description Joanne Tong 2006-01-11 18:50:31 UTC
The second paragraph in section 15.2 reads:

"The Nth captured substring (where N > 0) is the string matched by the 
subexpression contained by the Nth left parenthesis in the regex. The zeroeth 
captured substring is the string that matches the entire regex. This means 
that the value of regex-group(0) is initially the same as the value of . 
(dot)."

Is N < 0 an error?
Comment 1 Michael Kay 2006-01-11 20:02:25 UTC
The next sentence after your extract answers the question:

The function returns the zero-length string if there is no captured substring
with the relevant number.
Comment 2 Michael Kay 2006-02-02 19:37:35 UTC
I have added another item to the list of conditions under which a zero-length
string is returned:

* The number is negative.