I recently wrote a perl function to be called from LibXSLT (1.53) like this:

# in httpd.conf
<Perl>
   my $xsltfunc = sub { ....    return $ok ? 1 : 0 }
   XML::LibXSLT->register_function( "urn:my", "xsltfunc", $xsltfunc );
</Perl>

And the corresponding XSL template looked like:

   <xsl:choose>
      <xsl:when test="my:xsltfunc(node) = 1">
         ...
      </xsl:when>
      ...
   </xsl:choose>

Sure enough, it worked. So I went on to create another function, which
was going to be called from the same <xsl:template> as above function.

I pretty much cut n' pasted the code, used the same namespace, different
function name (duh), and added another <xsl:choose> in the template to
use the function. And now all of the sudden everything stopped working,
and the only error I get is "Can't coerce ARRAY in entersub..." error .

Upon encountering this, I tried buncha different combinations, and it
looked to me that these functions may fail kind of randomly depending on
where you call them? It's even weird, because I see that my second
function is actually being called, but the there's some problem with
using its results or some such thing.

I know this is vague, but has anybody else seen anything like this
before, or was I smoking something...?


--d


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to