W3C home > Mailing lists > Public > public-schemata-users@w3.org > March 2007

Re: equivalent of NOT NULL for element values?

From: Syd Bauman <Syd_Bauman@Brown.edu>
Date: Tue, 13 Mar 2007 18:59:42 -0400
Message-ID: <17911.11486.560473.57868@emt.wwp.brown.edu>
To: public-schemata-users@w3.org

> > what about using facet minLength in a restriction ?

Would the pattern facet do the trick for you?

start =
  element some_element {
    xsd:nonNegativeInteger { pattern = "[0-9]+" }
  }
  

> I'd made the mistake of thinking that the validator would give the
> same error when integer fields where empty (which was my main
> concern). I'd implemented the minLength restriction on strings, but
> had no solutions for integer types - shows you what testing can
> achieve ;). Is there an all-type encompassing attribute which
> requires that an element have a value (regardless of whether that
> value then validates based on restrictions etc...)?
Received on Tuesday, 13 March 2007 22:59:58 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:16:24 GMT