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 3597 - SeqExprCast-179 input valid?
Summary: SeqExprCast-179 input valid?
Status: CLOSED INVALID
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 0.9.4
Hardware: Macintosh All
: P2 normal
Target Milestone: ---
Assignee: Andrew Eisenberg
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-13 12:43 UTC by Martin Probst
Modified: 2006-08-13 14:39 UTC (History)
0 users

See Also:


Attachments

Description Martin Probst 2006-08-13 12:43:28 UTC
SeqExprCast-179 is esentially this:

(: Purpose: 'PDT3H2M10.001S' is an invalid lexical representation for xs:dayTimeDuration. :)
xs:dayTimeDuration("PDT3H2M10.001S")

The XQuery DM spec specifies xs:dayTimeDuration to be an extension of xs:duration.

The given string matches the xs:duration pattern (PnYnMnDTnHnMnS, last n may be a fraction). The restriction is specified to be: "[^YM]*[DT].*"

My mad regular expression skills and sed tell me, this is a legal value for that restriction:
# echo PDT3H2M10.001S | sed -e 's|[^YM]*[DT].*|Matched!|'
Matched!
Comment 1 Michael Kay 2006-08-13 14:21:40 UTC
The pattern facet restriction "[^YM]*[DT].*" is saying "if the lexical value is valid for xs:duration and matches "[^YM]*[DT].*", then it is valid for xs:dayTimeDuration". 

Or to put it another way "a duration is a valid dayTimeDuration if it contains a D or a T that isn't preceded by a Y or an M."

PDT3H2M10.001S is not valid in the lexical space of xs:duration, so it's irrelevant whether it matches the restricted pattern or not.

Michael Kay
personal response
Comment 2 Martin Probst 2006-08-13 14:29:27 UTC
I get it. Thanks for the explanation, I didn't pay attention to the fact that xs:duration always requires a Y component.