 |
| XML General XML discussions. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

March 12th, 2007, 07:43 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
|
|
XML Schema - Regular Expressions
Hi, I recently came accross some XML Expressions that I am trying to understand:
<xs:pattern value="[^~|\s]"/>
"^" is a range, "|" is an "or" operator and "\s" is spaces, what does the "~" mean"?
Thanks
|
|

March 13th, 2007, 03:57 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
^ means not, ~ and | represent themselves, and \s represents whitespace, so this expression matches any single character other than tilde, vertical bar, or a whitespace character.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|
|

March 13th, 2007, 05:36 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
|
|
I was way off. Thanks for the help.
Can you point me to a link (or book) that clearly defines these expressions?
As always,
Thank you
|
|

March 13th, 2007, 06:53 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
There's a link in my sig. The XPath 2.0 Prog Ref has a detailed appendix covering the XPath regular expression language, which is the same as the XML Schema language with one or two extensions.
I think Priscilla Walmsley also has good coverage in "Definitive XML Schema".
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|
|

March 13th, 2007, 06:59 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
|
|
Thank you! Ironicly, I just ordered XPath 2.0 Prog Ref (2 days ago).
also, I found a cool tester online:
http://regexlib.com/RETester.aspx
This seems to be a nice tester, but I need to learn the syntax.
Thanks!
|
|

March 13th, 2007, 07:02 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
|
|
Thanks!
|
|
 |