xsl-list
[Top] [All Lists]

[xsl] Challenge: create xPath 2.0 regular expressions for each XML Schema datatype

2006-10-18 04:24:13
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*$



Datatype                        xPath 2.0 Regular Expression
-------------------------------------------------------------
anyURI
-------------------------------------------------------------
byte
-------------------------------------------------------------
decimal
-------------------------------------------------------------
ENTITY
-------------------------------------------------------------
ENTITIES
-------------------------------------------------------------
float                              ^\s*[+-]?\d+([eE]+?\d+)?\s*$
-------------------------------------------------------------
ID
-------------------------------------------------------------
IDREFS
-------------------------------------------------------------
int
-------------------------------------------------------------
integer                          ^\s*[+-]?\d+\s*$
-------------------------------------------------------------
language
-------------------------------------------------------------
long
-------------------------------------------------------------
Name
-------------------------------------------------------------
NCName
-------------------------------------------------------------
negativeInteger
-------------------------------------------------------------
NMTOKEN
-------------------------------------------------------------
NMTOKENS
-------------------------------------------------------------
nonNegativeInteger
-------------------------------------------------------------
nonPositiveInteger
-------------------------------------------------------------
normalizedString
-------------------------------------------------------------
NOTATION
-------------------------------------------------------------
QName
-------------------------------------------------------------
positiveInteger
-------------------------------------------------------------
short
-------------------------------------------------------------
string
-------------------------------------------------------------
token
-------------------------------------------------------------
unsignedByte
-------------------------------------------------------------
unsignedInt
-------------------------------------------------------------
unsignedInteger
-------------------------------------------------------------
unsignedLong
-------------------------------------------------------------
unsignedShort
-------------------------------------------------------------

Anyone up for the challenge?

/Roger


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--