RE: [xsl] Complex type as the 'xsl:variable/@as' value

Subject: RE: [xsl] Complex type as the 'xsl:variable/@as' value
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 17 Nov 2005 17:07:10 -0000
>   Is it not possible to use a complex type as the content of
> a variable?  Why?

I heard someone at XML 2005 earlier this week arguing that they shouldn't
have been called types, because they don't have instances. It would have
been better to call them "structure definitions" or something.

Basically you want to say

as="element(my:list, my:list-type)"

meaning "an element whose name is my:list and whose type annotation is
my:list-type".

The point here is that the value of the variable is an element(), which is a
subtype of node(), which is a subtype of item(). It isn't an instance of
my:list-type; it is an element annotated as having content that matches the
definition of my:list-type. Subtle distinction, I know: if it's any
consolation it took most people on the working group (me included) about
three years before we understood it.

Michael Kay
http://www.saxonica.com/

Current Thread