Re: Determining what facets can operate on what datatype.

On Dec 3, 2012, at 2:18 PM, Casey Jordan wrote:

> As I dig deeper into the spec I am finding it hard to easily determine what facets are compatible with what datatypes. For instance, the definition of length:
> 
> "For string and datatypes derived from string, length is measured in units of characters as defined in [XML 1.0 (Second Edition)]. For hexBinary and base64Binary and datatypes derived from them, length is measured in octets (8 bits) of binary data. For datatypes derived by list, length is measured in number of list items."
> 
> Indicates to me that minLength, maxLength and fixedLength facets can only apply to derivations of String, hexBinary, base64Binary or List types. 
> 
> However, I don't see that explicitly stated anywhere (I am likely missing something) which leaves some question to my assumptions as well as what to do when encountering other datatypes.
> 
> Is there information available which I am not seeing or should a way to approach this problem that I may not be realizing?

You may find it helpful to consult the table headed "Schema Component
Constraint: applicable facets" in section 4.1.5 "Constraints on Simple
Type Definition Components".

http://www.w3.org/TR/xmlschema-2/#defn-coss

On the specific facets you mention: the length facets are specified as
being legal on all datatypes, but they are not always very meaningful.
XSD 1.1 specifies the meaning of the length facets more clearly for
all primitive types (and says explicitly that the length facets are
always satisfied for QName and NOTATION.

And yes, enumerations are legal on all datatypes, including
user-defined datatypes.


-- 
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com 
* http://cmsmcq.com/mib                 
* http://balisage.net
****************************************************************

Received on Monday, 3 December 2012 22:00:57 UTC