RE: Classroom critique of XML Schema 1.1

"Costello, Roger L." <[email protected]>
Newsgroups gmane.text.xml.schema.devel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.