Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
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
 
Old March 12th, 2007, 07:43 PM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default 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

 
Old March 13th, 2007, 03:57 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default


^ 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
 
Old March 13th, 2007, 05:36 AM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

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

 
Old March 13th, 2007, 06:53 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

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
 
Old March 13th, 2007, 06:59 AM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

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!
 
Old March 13th, 2007, 08:47 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Strange, I replied to this post but it never showed up. The link I gave was: http://www.regular-expressions.info/reference.html

--

Joe (Microsoft MVP - XML)
 
Old March 13th, 2007, 07:02 PM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Thanks!








Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Regular Expressions WestRowOps Other Programming Languages 1 May 18th, 2007 05:34 AM
Regular Expressions mega Beginning PHP 1 February 5th, 2007 05:31 PM
Regular expressions on C# hideway C# 2 November 27th, 2006 05:08 PM
Regular Expressions The_Iceman ASP.NET 2.0 Basics 0 September 29th, 2006 05:06 AM
Regular expressions in XML schemas adrianbarry XML 10 April 7th, 2004 07:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.