xsl-list
[Top] [All Lists]

Re: [xsl] xsl:function problem

2007-05-13 16:42:14
Ah, thanks.  I didn't even run the function yet, it fails with a
validation error.  But I'll pass the context node as a second param if
I can get the signature to work.

Ilya

On 5/13/07, Dimitre Novatchev <dnovatchev(_at_)gmail(_dot_)com> wrote:
> <xsl:function name="p2f:lookupNameFor">
>        <xsl:param name="formOID" as="xs:string"/>
>        <xsl:value-of
> select="tokenize(//ItemGroupDef[OID=$formOID]/@Name, '::')"/>
> </xsl:function>


This should not be allowed by the XSLT compiler and should raise an
error. An xsl:function does not have a context node, the error will
complain about presuming one exist in:


   //ItemGroupDef[OID=$formOID]/@Name


Are  you sure you posted the real text of the function and that you
really performed the transformation with Saxon 8.x ?


--
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play




On 5/13/07, Ilya Sterin <sterini(_at_)gmail(_dot_)com> wrote:
> I'm using a very simple function and transforming through oxygen
> configured to use Saxon8B.
>
> The function seems to be ok when no parameters are required, but seems
> to ignore xsl:param when added?
>
> Here is an example...
>
> <xsl:function name="p2f:lookupNameFor">
>        <xsl:param name="formOID" as="xs:string"/>
>        <xsl:value-of
> select="tokenize(//ItemGroupDef[OID=$formOID]/@Name, '::')"/>
> </xsl:function>
>
>
> Then when the function is called without any params the xslt validates fine...
>
> <xsl:variable name="identifiers"><xsl:value-of
> select="p2f:lookupNameFor('test')"/></xsl:variable>
>
> and the following throws an error...
>
> <xsl:variable name="identifiers"><xsl:value-of
> select="p2f:lookupNameFor('test')"/></xsl:variable>
>
> F [Saxon8B] XPath syntax error at char 30 on line 23 in
> {p2f:lookupPrismNameFor('test')}:
>    Cannot find a matching 1-argument function named
> {http://www.nextrials.com/ns/prism2flex/v1.0}lookupNameFor()
>
> The p2f namespace prefix is declared correctly.
>
>
> Am I doing something wrong?
>
> Ilya
>
> --~------------------------------------------------------------------
> 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>
--~--



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

<Prev in Thread] Current Thread [Next in Thread>