Re: [xsl] Is this correct: " A sequence of more than one item is not allowed as the first argument of dynamic function call "

Subject: Re: [xsl] Is this correct: " A sequence of more than one item is not allowed as the first argument of dynamic function call "
From: "Dimitre Novatchev dnovatchev@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 15 Jun 2014 00:38:16 -0000
I have found that the original code really suffer from a type error.

 It seems that until we have generics in XPath, it wouldn't be
possible to write a strongly-typed definition of function-composition.
For now, I don't see a generic definition, more precise than this:

function($f as function(*),
              $g as function(*),
              $x as item()*
              ) as item()*
  { $f($g($x)) }


So, please, disregard the previous message.

However, the error message was and continues to be confusing.

On Sat, Jun 14, 2014 at 4:45 PM, Dimitre Novatchev
dnovatchev@xxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>  I have this transformation:
>
> <xsl:stylesheet  version="3.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>  <xsl:template match="/">
>    <xsl:sequence select=
>     "function($f as function(item()*) as item(),
>               $g as function(item()) as item()*,
>               $x as item()*
>               ) as item()*
>      { $f($g($x)) }
>           (head#1, reverse#1, ('H','e','l','l','o'))
>     "/>
>  </xsl:template>
> </xsl:stylesheet>
>
> When I use BaseX to evaluate the XPath 3.0 expression that is
> specified in the "select" attribute of the <xsl:sequence> above, I get
> the expected, correct result:
>
>             "o".
>
> However, when I run this transformation with the Saxon-EE 9.5.1.3 from
> within Oxygen, I get this error:
>
> Severity: fatal
> Description: XPTY0004: A sequence of more than one item is not allowed
> as the first argument of dynamic function call ("H", "e", ...)
> URL: http://www.w3.org/TR/xpath20/#ERRXPTY0004
>
> I have never heard of any such limitation before, haven't seen such a
> rule in any specification and cannot find any reasons for such
> limitation.
>
> Could someone, please, explain if this behavior is a bug, or not? If
> this is correct behavior, what is the rationale behind this
> limitation?
>
>
> --
> Cheers,
> Dimitre Novatchev
> ---------------------------------------
> Truly great madness cannot be achieved without significant intelligence.
> ---------------------------------------
> To invent, you need a good imagination and a pile of junk
> -------------------------------------
> Never fight an inanimate object
> -------------------------------------
> To avoid situations in which you might make mistakes may be the
> biggest mistake of all
> ------------------------------------
> Quality means doing it right when no one is looking.
> -------------------------------------
> You've achieved success in your field when you don't know whether what
> you're doing is work or play
> -------------------------------------
> To achieve the impossible dream, try going to sleep.
> -------------------------------------
> Facts do not cease to exist because they are ignored.
> -------------------------------------
> Typing monkeys will write all Shakespeare's works in 200yrs.Will they
> write all patents, too? :)
> -------------------------------------
> I finally figured out the only reason to be alive is to enjoy it.
> 



-- 
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all
------------------------------------
Quality means doing it right when no one is looking.
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play
-------------------------------------
To achieve the impossible dream, try going to sleep.
-------------------------------------
Facts do not cease to exist because they are ignored.
-------------------------------------
Typing monkeys will write all Shakespeare's works in 200yrs.Will they
write all patents, too? :)
-------------------------------------
I finally figured out the only reason to be alive is to enjoy it.

Current Thread