Re: [Moderator Action] Making text required for an element

vriezenj@lakeviewtech.com writes:

> I'm pretty new to XML, so forgive me if this has been covered before-- I
> couldn't seem to find it in the Rec'.
> 
> I see that I can put all sort of constraints on the text contained within
> an element (type, length, etc.)  but it seems that these constraints only
> apply if there actually is a text value present.
> 
> In other words, how do I constrain an element to be required to actually
> have text ?  minLength=1 only seems to get applied if the element has text
> (at which point it can't fail)

It should require text, and fail if there is none.  That is,

<foo></foo>

is not valid per

<element name="foo">
 <simpleType>
  <restriction base="string">
   <minLength value="1"/>
  </restriction>
 </simpleType>
</element>

Have you tried this with other results, if so which validator?

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-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/

Received on Thursday, 26 October 2000 03:48:29 UTC