OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] Validation of missing elements in xml:

[ Lists Home | Date Index | Thread Index ]
  • To: xml-dev@lists.xml.org
  • Subject: RE: [xml-dev] Validation of missing elements in xml:
  • From: Eric van der Vlist <vdv@dyomedea.com>
  • Date: Mon, 03 Apr 2006 17:39:19 +0200
  • In-reply-to: <20060403153140.2F9F57F573F@gwparis.dyomedea.com>
  • Organization: Dyomedea (http://dyomedea.com)
  • References: <20060403153140.2F9F57F573F@gwparis.dyomedea.com>

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@xxx.com
	</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?=





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS