Subject: Re: [xsl] Challenge: create xPath 2.0 regular expressions for each XML Schema datatype From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Wed, 18 Oct 2006 13:45:31 +0200 |
Hi Folks,
I would like to submit a challenge:
Create xPath 2.0 regular expressions for each of the XML Schema datatypes.
Examples:
- the xPath expression which corresponds to integer is: ^\s*[+-]?\d+\s*$
- the xPath expression which corresponds to float is: ^\s*[+-]?\d+([eE]+?\d+)?\s*$
For a float, it could be the following: ^\s*[+-]?(\d*\.\d+|\d+\.\d*)([eE][+-]?\d+)?\s*$|^\s*([+-]INF|NaN)\s*$
Note this branch: ^\s*([+-]INF|NaN)\s*$ It is valid to have this in xslt: xs:float('NaN') or xs:float('+INF').
PS: i did not test the regex above, it may contain errors or omissions. PS2: this regex also applies to xs:double.
-- Abel Braaksma http://www.nuntia.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Challenge: create xPath 2.0 r, Costello, Roger L. | Thread | Re: [xsl] Challenge: create xPath 2, David Carlisle |
[xsl] Challenge: create xPath 2.0 r, Costello, Roger L. | Date | Re: [xsl] Challenge: create xPath 2, David Carlisle |
Month |