Re: [xsl] keys and idrefs - XSLT2 request?

Subject: Re: [xsl] keys and idrefs - XSLT2 request?
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Mon, 15 Oct 2001 10:35:41 +0100

> If you (and I) want to have some kind of mini schema type assignment
> within xslt then that means some kind of minimal support for
> prim^H^H^Hbuilt in types. However you could support defaulted
> attributes and even maybe user defined complex types to a certain
> amount just by taking a PSVI as input, from your mythical PSVI
> enhanced SAX stream. If the PSVI says that some element has a value
> defaulted by the schema and has type xx:yy then it is maybe possible
> to imagine accessing both the defaulted value and the type in XPath
> just essentially as a label without it having to know anything deep
> about how types are structured, inherit etc.

Yes. But two points about that:

First, any access to the PSVI is going to mean a schema-validating
parser of some description. The XML Schema Rec seems to imply that
even minimally conforming processors must do all the validity-checking
stuff. This includes uniqueness constraints, checking whether types
can be derived from each other and so on that wouldn't be particularly
useful to an XSLT processor (except in saying that a schema shouldn't
be used with a particular document, or at all). So whether or not the
information is made available to the XSLT processor, it will still
have to have been gathered and used during the schema-validity
checking phase. Perhaps XPath 2.0 will define some new level of
conformance to XML Schema, but I think it's unlikely. What I'm saying
is that there's a significant gulf between minimal support (just
built-in types) and support for defaults and types, and a much smaller
step between support for defaults and types and full access to the

Second, if the XSLT processor only has access to information about
individual types, and not what they're derived from, then it will be
unable to do some useful and intuitive reasoning. For example, if I
define a priceType type derived from xs:decimal, then I want it to be
treated as an xs:decimal when it comes to doing any calculations with
it. Without access to the type hierarchy, there's no way that the XSLT
processor can know that my priceType should be treated like that - I
would have to perform that conversion in my stylesheet. I'm not saying
that getting the type of an element/attribute is useless without the
hierarchy, but it's certainly a lot more use with the hierarchy.



Jeni Tennison

 XSL-List info and archive:

Current Thread