W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2011

RE: Classroom critique of XML Schema 1.1

From: Costello, Roger L. <costello@mitre.org>
Date: Sat, 19 Mar 2011 12:45:25 -0400
To: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Message-ID: <9E51F88D5247B648908850C35A3BBB500530221C48@IMCMBX3.MITRE.ORG>
Hi Noah,

You wrote:

> If someone wrote in XQuery a function that required an argument of type 
> "xs:string:", then static type checking could be used to prove that 
> passing the (value of) a Publisher element would be ok.  

Isn't static type checking done on the <Publisher> element in the XML instance document? Consider this XML instance:

    <Publisher>Wrox Press</Publisher>

Static type checking determines whether the value in the <Publisher> element (Wrox Press) falls within its set of allowable values as specified by the associated XML Schema.

In XML Schema 1.1 the determination of the set of allowable values for <Publisher> may require looking in multiple places, e.g.,

    <element name="Publisher" type="string" />

    <assert test="string-length(.//Publisher) le 140" />

Thus, static type checking involves checking that the value of <Publisher> is not longer that 140 characters.

In other words, the data type of <Publisher> is not a string; it is a string that is constrained to less than or equal to 140 characters in length.

Yes?

/Roger
Received on Saturday, 19 March 2011 16:45:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 19 March 2011 16:45:59 GMT