xsl-list
[Top] [All Lists]

Re: Re: XSLT 2.0: On xsl:sequence and xsl:copy-of

2003-10-13 02:16:28
Hi Dave,

MK said:
XSLT 2.0 can now do this too, for example

<xsl:variable name="e" as="element()*">
 <a/><b/><c/>
</xsl:variable>

... and what is the data type of this variable please Mike?

The data type of the variable above is a sequence of zero-or-more
elements.

The 'as' attribute indicates the data type of the variable. Its syntax
is known as a SequenceType -- it describes a sequence of items. The
items are described by an item type, which can be item() (any item), a
node test or the name of an atomic type. The usual occurrence
indicators (?, +, *) mean the usual things (0-or-1, 1-or-more,
0-or-more).

So in this case the items in the sequence are elements (indicated by
the node test "element()") and there can be 0-or-more of them
(indicated by the "*" occurrence indicator).

the anonymous type?

Your getting your terminology confused somewhere along the line.
Anonymous types are used in XML Schema (contrasting with named types,
which have names). In XML Schema, an element or attribute has a type,
which can be named or anonymous. In XPath 2.0, every type has a name,
but the names of originally anonymous types are
implementation-dependent, so you can't refer to them. (In practice, as
a user, you never have to worry about the names of anonymous types
because there's no way to access them.)

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list