W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 1999

MinLength Facet??

From: Warn, Simon (GEIS) <Simon.Warn@geis.ge.com>
Date: Tue, 23 Nov 1999 09:22:11 -0500
Message-ID: <3D808EC801AED111B0100008C75D5DDCF0BB55@roc05bxgeisge.is.ge.com>
To: "'www-xml-schema-comments@w3.org'" <www-xml-schema-comments@w3.org>
Hi All,
	Looking through the specification I noticed there is no explicit
minLength facet. I understand from Paul (Biron) that the following
workaround is available:

"That said, there is a workaround in the current draft for generating
subtypes of string that have a minimum length (say, minLenght=32), using the
pattern facet, as in

<datatype name="myString">
	<basetype name="string"/>

That is, we generate a subtype of string which is constrained by the regular
expression given in the pattern facet.  The regular expression in this case
says: "match any character (including newline) at least 32 times"."

While this might work I still feel it would be nice to have an explicit
minlength facet. This would be very useful in EDI as there are numerous
examples (particularly in the ANSI X12 standard) of data elements which have
unusual min\max length definitions. Some examples are Part name 3-16, ID
Code 2-17, City Name 2-30 and Occupation Code 4-6. I could go on but I am
sure you get the picture.

Even in the non-EDI world the minlength could be useful. I have often been
asked to enter passwords which must have a minimum length.

Finally it would balance up the specification as MaxInclusive and
MaxExclusive have their Min. equivalents. Why not MaxLength?

	Simon Warn

p.s. Why can't "Maxoccurs" in the "Element" and "Group" elements take values
other than "1" or "*"? This would be extremely useful for EDI where Segment
and Loop/Group occurrences are strictly defined.
Received on Tuesday, 23 November 1999 09:22:54 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:08:45 UTC