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: Tue, 14 Oct 2003 11:28:13 +0100
Hi Jeni.

I'm going to keep this on list,
in the hope that its not just me that's missing something here.
(I'm sure Tommie will kick me if it goes on too long :-)

> 
> There are three scenarios:
<snip/>
No problem with those.
  I guess its the terminology.
> 
> So, you *can* use the 'as' attribute to do implicit casting.
But only between a subtype and super of that subtype?




> 
> Using the 'as' attribute on <xsl:variable> (and the other
> variable-binding elements) is good practice because it catches some
> dumb errors and helps document your stylesheet. It's also essential if
> you want to use the content of the variable-binding element to set the
> variable to something other than a temporary tree. But in most cases
> it doesn't do casting: you have to do that yourself.

Duly noted.




> I think that we should only use 'is a subtype of' when talking about
> the relationships between two atomic data types. So it's true to say
> that xs:integer is a subtype of xs:decimal, but it's not true to say
> that an xs:integer is a subtype of the SequenceType "xs:decimal+".

<grin/> Now you're beginning to sound like DC.
 I'm OK with this as a restriction, assuming its the + that says no,
I.e. int is not a subtype of one or more decimals.






> >  I was checking my understanding of the nesting?
> >   Is it the 'subtype' mentioned above?
> >     E.g. you had 
> >              "a node()
> >                 "element()
> >                    "element(Name, Type)
> >
> > Can I read that as element is a subtype of node,
> 
> No, you can't read the list like that. But it is true that an element
> node would match a SequenceType of "node()".

I think this is just down to being exact in terms of terminology?
  'is a subtype of' and 'match a SequenceType of' are the same insofar
as my understanding goes today. 

> 
> >     the last line I'm less sure of.


I meant the line "                   "element(Name, Type)    "



> I'll try to explain it more, but I'm not sure what bit you don't
> understand.


I'm unsure how to 'read' (for understanding) the 'Name, Type'
in brackets.

You said earlier,
>     - an atomic type, which can be any QName; common ones are:
>       - "xdt:anyAtomicType"
>       - "xs:string"

is this how you meant 'Type' to be interpreted?
  as one of the atomic types from xsd?

If so, that leaves 'Name', is that the name of the element in question?


Which raises another question.
  I can see how the simpler ones from your list might be used
as a value for the as attribute,
<xsl:variable name="fred" as="xs:integer">

but how might element(elementName, xs:integer)  be used?


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