[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Types and Context
- From: "Simon St.Laurent" <email@example.com>
- To: Jonathan Borden <firstname.lastname@example.org>
- Date: Tue, 22 May 2001 20:29:53 +0000
On 22 May 2001 19:11:39 -0400, Jonathan Borden wrote:
> Let's not get too afraid of this so-called 'API', I am suggesting that this
> amounts to a _single_ extension function named "typeOf" ... that is testing
> whether a node is 'valid' with respect to a schema _and_ ascertaining the
> type of a node are the same thing (under the schema algebra formulation).
> The problem with using _only_ an XML representation of the PSVI is that it
> doesn't alone replace the "typeOf" function ... assume an XSLT processor
> that attaches an "xsi:type" attribute to each and every element in an XML
> document. For example
> becomes ('psvi')
> <foo xsi:type="simonsVeryOwn:integer">123</foo>
Sure thing. Now do that with <foo myInt="123"/> and tell me what it
> the reason that the "typeOf" function is more interesting is that it
> "understands" the type hierarchy so that the test:
> typeOf(node, "simonsVeryOwn:integer") and
> typeOf(node, "xsd:integer") both might be true, yet simply testing the value
> of a type adorning attribute doesn't tell us this.
Again, I'd be a lot happier if there was an XML-based syntax for
describing that type hierarchy, rather than an API for dealing with it.
That type information might also be more logically associated with the
stylesheet than with the document.
> Note that "typeOf" is not unique to XPath, and a similar function would be
> introduced for DOM 8 or whatever the version is intended to support the
DOM 8 sounds about right, yes.