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

RE: Validation of missing elements in xml:

  • To: xml-dev@l...
  • Subject: RE: Validation of missing elements in xml:
  • From: Eric van der Vlist <vdv@d...>
  • Date: Mon, 03 Apr 2006 17:39:19 +0200
  • In-reply-to: <20060403153140.2F9F57F573F@g...>
  • Organization: Dyomedea (http://dyomedea.com)
  • References: <20060403153140.2F9F57F573F@g...>

the validation is missing
Le lundi 03 avril 2006 à 16:26 +0100, Michael Kay a écrit :
> With a DTD, there are very few ways to constrain the textual content of an
> element (you can constrain it to be EMPTY, but not to be non-empty).
> 
> In XML Schema, you can declare the element to be of type my:non-empty-string
> where my:non-empty-string is a simple type derived from xs:string using the
> facet <minLength value="1"/>

True, but that depends what you call "empty"...

Deriving from xs:string won't catch cases where you only have
whitespaces such as;

<Person>
        <name>
	</name>
        <email>
		aaa.bbb@x...
	</email>
</Person>

If this should be considered invalid (which happens to be consistent
with the behavior of other datatypes), you should derive form xs:token
instead of xs:string...

Eric (caught on one of his most frequent rants again)

-- 
GPG-PGP: 2A528005
Did you know it? Python has now a Relax NG (partial) implementation.
                                          http://advogato.org/proj/xvif/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------

Ceci est une partie de message=?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=


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.