Re: [xsl] A sequence of more than one item is not allowed as the value of item

Subject: Re: [xsl] A sequence of more than one item is not allowed as the value of item
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 2 Jun 2005 11:15:16 +0100
  This suggests that by specifying xs:string Saxon is jumping the gun and
  converting the text nodes (zero length text nodes as well - the leading
  comma) to strings before stage 2.

the 6 stage process outlined was what xsl:value-of does given a
sequence.

When you put as="xs:string+" on the xsl:variable that forces a cast so
that the sequence matches the specified type so that in this
case $foo and $foo2 both contain the same sequence of three strings
"" "abc" and "def" and then value-of does it's stuff and you get
",abc,def"
for both of them.


One thing that I hadn't noticed before this discussion is that the
change to allow text nodes with zero length (but not to allow them as
children of elements) (which happened in a recent draft) means that
the common syntactic trick of writing

 <xsl:text/>abc<xsl:value-of ...

rather than the more natural but more verbose

 <xsl:text>abc</xsl:text><xsl:value-of  ...

is no longer equivalent. 
The second form would have produced sequences of length 2 not sequences
of length 3 in your examples (and no leading comma in your last result)


David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread