xsl:with-param problem under Weblogic 8.1

Q

QTR

Hello,

I discovered a strange XSLT behaviour on Weblo 8.1. Let me explain it
(see at the end my example XSLT):
I call a template (1) with one parameter (A) which calls another
template (2) with two parameters. The first parameter is param A
(obtained from template 1) and the second param comes from another
template (3) which just returns the given param (C).
The second template receives 2 params (A and C) and prints them out.
Thus, in my example I see:
param1: paramA
param2: paramC

So far so good.
The problem comes in when I change the order of the two params when
calling template 2! If I put the line which sets param1 for calling
template 2 *after* param2 then template 2 prints out 2 times the same
thing!
Thus, in my example I'd see:
param1: paramC
param2: paramC

It seems that paramA has been overwritten by paramC!
If I don't call template3 but set param2 (paramC) directly (hardcoded)
in template1 then the order of the passed params doesn't matter. Then
it works fine.

Can somebody explain me this strange behavoiur please?
BTW: I discovered this on Weblogic but on Tomcat and on IIS (MSXML2) it
works without problems!!


<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:eek:utput method="html" encoding="ISO-8859-1"/>

<xsl:template match="/">
<xsl:call-template name="template1">
<xsl:with-param name="paramA">paramA</xsl:with-param>
</xsl:call-template>
</xsl:template>

<xsl:template name="template1">
<xsl:param name="paramA"/>
<xsl:call-template name="template2">
<!--the following line works correctly-->
<xsl:with-param name="param1"><xsl:value-of
select="$paramA"/></xsl:with-param>
<xsl:with-param name="param2">
<xsl:call-template name="template3">
<xsl:with-param name="paramC">paramC</xsl:with-param>
</xsl:call-template>
</xsl:with-param>
<!--the following line works incorrectly
<xsl:with-param name="param1"><xsl:value-of
select="$paramA"/></xsl:with-param>
-->
</xsl:call-template>
</xsl:template>

<xsl:template name="template2">
<xsl:param name="param1"/>
<xsl:param name="param2"/>
param1: <xsl:value-of select="$param1"/><br/>
param2: <xsl:value-of select="$param2"/><br/>
</xsl:template>

<xsl:template name="template3">
<xsl:param name="paramC"/>
<xsl:value-of select="$paramC"/>
</xsl:template>
</xsl:stylesheet>
 
J

Joseph Kesselman

Sounds like a bug in Weblogic. That sort of confusion of evaluation
states is a common pitfall when designing XPath and XSLT
implementations; gods know I've tracked down and fixed enough instances
over the years...
 
Q

QTR

Thanks Joseph!
I'll try to contact Bea in order to see if it's realy a Weblogic bug
and how to prevent it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top