RE: [xsl] Re: XSLT 2.0: On xsl:sequence and xsl:copy-of

Subject: RE: [xsl] Re: XSLT 2.0: On xsl:sequence and xsl:copy-of
From: David.Pawson@xxxxxxxxxxx
Date: Mon, 13 Oct 2003 11:51:39 +0100
Hi again Jeni.

> >   Its the 'as' attribute on Mikes xsl:variable that 
> determines it to be
> > an 'element' in this case?
> 
> Yes, or at least partly. If you have an 'as' attribute on
> <xsl:variable> then it indicates the static type of the variable, but
> the variable itself can be of a more specific type.
> 
Roughly (not using DC speak), the 'as' attribute is the one I want,
even if the contents (of xsl:variable in this example) might vary?



> 
> Similarly, if you have:
> 
>   <xsl:variable name="foo" as="xs:decimal" select="2" />
> 
> then the static type is a xs:decimal but the type of the variable's
> value is a xs:integer.

?? Dynamic is integer, static is decimal??

Assuming such a cast is viable/allowed, any use of $foo
will be as a decimal thereafter in the stylesheet?


> 
> As long as the dynamic type (the type of the value that the variable
> gets set to) is a subset of the static type (the type of the variable
> as declared by the 'as' attribute), you're OK.

'Can be cast to' I guess.




> The SequenceType syntax is specified in the XPath 2.0 spec at:
> 
>   http://www.w3.org/TR/xpath20/#id-sequencetype
> 
> It's impossible to give a complete list of sequence types

Is there a difference (to a user) between sequence types and data types?


> because
> user-defined data types can be imported into a stylesheet from a
> schema,

Foul. .... Or at least out of scope of my question.
I'm chasing a list of data types provided by XSLT 2, not by
external influences.

(I guess you provide below what's provided in the specs,
which is what I'm chasing)


> However, to summarize, a SequenceType can be:
> 
>   - "empty()"
>   - an item type with an occurrence indicator; item types are:
>     - "item()"
>     - a node kind test, which are:
>       - "node()"
>       - a document node test, which can be:
>         - "document()"
>         - "document(element())"
>         - "document(element(Name))"
>         - "document(element(Name, *))"
>         - "document(element(Name, Type))"
>         - "document(element(*, Type))"
>         - "document(element(SchemaPath))"

What does the 'nth level' mean please Jeni?
Its a node (most generic)
  Its a document (less generic)
     Its an element (even less generic)
        ????




> For a full list of the built-in atomic data types, look in the F&O
> spec at:
> 
>   http://www.w3.org/TR/xpath-functions/#datatypes
> 
> and:
> 
>   http://www.w3.org/TR/xpath-functions/#duration-subtypes

The less said about this bunch, the better IMO.
I'm hoping that the request to castr... reduce to a minimum will be
supported in the WG :-)


>   
> As I said, these atomic data types can be augmented with ones that you
> define yourself, within a schema, so it's not possible to generate an
> exhaustive list.

<grin/> That lot's exhausting enough!!


> 
> > Yes, you're probably right Jeni... but I'm not surprised,
> > its got to be closer to xsl-fo complexity than xslt 1?
> 
> There's certainly more to learn in XSLT 2.0 than there was in XSLT
> 1.0, which isn't surprising considering that it can do that much more.

I'd argue over how much more. I'm less convinced the baggage is a fair
weight
to carry when getting the useful subset of the 'more' that's provided.

Thanks Jeni. That goes a long way to clarifying it.

regards DaveP


- 
DISCLAIMER: 

NOTICE: The information contained in this email and any attachments is 
confidential and may be privileged. If you are not the intended 
recipient you should not use, disclose, distribute or copy any of the 
content of it or of any attachment; you are requested to notify the 
sender immediately of your receipt of the email and then to delete it 
and any attachments from your system. 

RNIB endeavours to ensure that emails and any attachments generated by 
its staff are free from viruses or other contaminants. However, it 
cannot accept any responsibility for any  such which are transmitted.
We therefore recommend you scan all attachments. 

Please note that the statements and views expressed in this email and 
any attachments are those of the author and do not necessarily represent 
those of RNIB. 

RNIB Registered Charity Number: 226227 

Website: http://www.rnib.org.uk 

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


Current Thread