[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Required item type of first argument of <function>

Subject: RE: Required item type of first argument of <function> is node(); supplied value has item type xs:string
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 19 Feb 2010 22:08:36 -0000
RE:  Required item type of first argument of <function>
> 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 

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.