Re: Non empty content model

Cams Ismael <Ismael.Cams@siemens.com> writes:

> Hello all,
>
> how can i define that an element may not be empty.
> Now I use:
>
> <xsd:simpleType name="nonEmptyString">
> 	<xsd:restriction base="xsd:string">
> 		<xsd:minLength value="1"/>
> 	</xsd:restriction>
> </xsd:simpleType>

That may not have the effect you expect -- it would allow
   <a> </a>
for instance.  But it's a reasonable approach.  The other possible
route is to use a 'pattern' facet.

> Is there an attribute or a general rule to indicate the content of an
> element may not be empty ? 

No.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                      Half-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
 [mail really from me _always_ has this .sig -- mail without it is forged spam]

Received on Tuesday, 2 September 2003 04:29:53 UTC