[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Validation help

  • From: "Michael Kay" <mike@s...>
  • To: 'Carlos Narváez' <crakup@g...>,<xml-dev@l...>
  • Date: Sat, 25 Aug 2007 08:47:04 +0100

RE:  Validation help
Define wordType as an extension of ns1:word, where ns1:word is a simple type
derived by restriction from xs:string with the facet <xs:pattern
value="\w+"/>.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Carlos Narváez [mailto:crakup@g...] 
> Sent: 25 August 2007 06:07
> To: xml-dev@l...
> Subject:  Validation help
> 
> Hi:
> 
> I have a question about validation.
> This is the xml fragment I want to validate:
> 
> <word syllables="2">arrow</word>
> 
> This is my current complexType for it:
> 
> <xs:complexType name="wordType">
> <xs:simpleContent>
> <xs:extension base="xs:string">
> <xs:attribute name="syllables" type="ns1:lowint" 
> use="required"/> </xs:extension> </xs:simpleContent> </xs:complexType>
> 
> This schema is adequately diligent with the attribute (using 
> a customized "lowint" type which only allows integers from 1 
> to 7), but I want constraints on the contents of the element 
> as well. For one thing, it may not be empty, and must match a 
> "[\w]+" pattern (alphanumeric, no punctuation or whitespace)
> 
> the finished schema should not validate the following invalid 
> xml fragments:
> 
> <word syllables="2"></word>
> <word syllables="2">1 .23</word>
> <word syllables="2">two words</word>
> 
> I'm pretty new to schema... I'm fumbling with it. I've tried 
> dozens of combinations to get this to validate
> 
> Thanks.
> 
> --
> http://www.juegopixel.com
> http://www.aerolineasmexicanas.com.mx/
> 
> ______________________________________________________________
> _________
> 
> XML-DEV is a publicly archived, unmoderated list hosted by 
> OASIS to support XML implementation and development. To 
> minimize spam in the archives, you must subscribe before posting.
> 
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@l...
> subscribe: xml-dev-subscribe@l... List archive: 
> http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
> 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.