xsl-list
[Top] [All Lists]

RE: [xsl] Required item type of first argument of <function> is node(); supplied value has item type xs:string

2010-02-19 16:09:00

I'm creating a function (so using 2.0), and this function 
should be generic enough to handle pretty much anything I 
throw at it, so I set the param type as node(). Trouble pops 
up though when I call a function such as the upper-case() 
xslt function on the parameter being passed in, as it's a 
string now, not a node.


You've simplified the code to illustrate the problem, which is fine, but
sometimes when people submit a problem like this I like to stand back and
think: what are you actually trying to achieve? What is the problem to which
this rather convoluted code is perceived as the solution? As far as I can
see, you are trying to make one function do too much. It doesn't feel right
to me that a function that navigates to descendent nodes when given a node,
should also do something useful if given a string. Sure, you can do it, but
is there a better design?

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 



--~------------------------------------------------------------------
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>
--~--