xsl-list
[Top] [All Lists]

Re: [xsl] help with recursive function

2008-05-06 09:41:07
Thanks Andrew for that, the error message now tells me which line in the
function is causing the problem. Still perplexed but now have a focus.
Thanks
Mario

line in question now

<xsl:value-of select="f:f_UpperLowerCaseFix($l_StringAfterDelimiter)" />


Quoting Andrew Welch <andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com>:

2008/5/6 Mario Madunic <hajduk(_at_)imag(_dot_)net>:
 I'm having a problem with a recursive function in 2.0.

 [xslt] e:\XSLT\cleanUp.xsl:259: Fatal Error! A sequence of more than one
item is
 not allowed as the first argument of concat()

  <xsl:value-of select="concat(f:f_UpperLowerCaseFix(.), if (not(position()
=

Without looking too closely, first you should always declare the type
and cardinality of the function's return value, so change:

  <xsl:function name="f:f_UpperLowerCaseFix">

to <xsl:function name="f:f_UpperLowerCaseFix" as="xs:string">

(a single string)

    <xsl:param name="p_String" />

...you should also declare the type and cardinality of the param but
that's likely to be a side issue here.

So, with the function's return type declared as a single string, the
processor will throw an error as soon as the second item in the
sequence is added (before it ever gets to the concat function) - with
good xsl:message output or the help of a debugger you should be able
to determine where the problem is.

-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

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





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