xsl-list
[Top] [All Lists]

Re: A sequence of more than one item is not allowed as the [nth] argument of [function]

2005-03-06 06:43:42
Hi David,
  I tried the following example with Saxon 8.1 ..

<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">

<xsl:output method="text" />

<xsl:template match="/">
  <xsl:value-of select="string((2,3))" /> :
<xsl:value-of select="concat('a',('b','c'))" />
</xsl:template>

</xsl:stylesheet>

The output is -
2 : ab
(this is exactly as Mike explained)

In this example I believe I am asking a *pure XSLT
1.0* processor to work..

But I am using XSLT 2.0 sequence syntax in string and
concat functions .. Since sequence syntax is
unrecognized in XSLT 1.0 , should the above stylesheet
not give an error?

Or is some forward compatible behaviour going on.. 

I shall put my question more simply as ..
If <xsl:stylesheet version="1.0" is specified , and if
the stylesheet uses some XSLT 2.0/XPath 2.0 constructs
, then should the new constructs work - if I am using
a XSLT 2.0 processor? (as shown in example above)..
Ofcourse , the above stylesheet will give error with
XSLT 1.0 only processor (like Xalan-J 2.6.0) ..

Regards,
Mukul

--- David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:

IMHO, in XSLT 1.0 mode using sequence as argument
to
concat() or string() should give an *error*.. As
argument of type sequence is not allowed on
concat()
and string() in XPath 1.0 ..

That isn't the way things are defined in xslt 1.
The sequence type in xpath2 is the equivalent of the
node set in XPath1
and you can give node sets as arguments to these
functions in XPath1.

David



        
                
__________________________________ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--