xsl-list
[Top] [All Lists]

xsl:if with params

2004-09-24 06:45:28
I have this thing working as i want it to work, but i don't understand why!!!

I have

  <xsl:param name="main" select="somevalue"/>

and later

      <xsl:if test="$main">
        do some stuff
      </xsl:if>

Then i'm launching my transformation from Java, sometimes i set that parameter
some times don't, like this:

        if ("main".equals(xpar)) {
          stylesheet.setParameter("main", "ok");
        }
        stylesheet.transform(request, response);

And it's working ok, it only "does some stuff" when i setParameter to something,
wathever value i have in <xsl:param name="main" select="somevalue"/> and
whatever value i pass to the parameter.

The only exception are if i use

<xsl:param name="main" select="true()"/> and

stylesheet.setParameter("main", new Boolean(false));


So, when i'm making

      <xsl:if test="$main">

what am i saying in english?

(BTW, excuse my bad english in the first place...)












O SAPO já está livre de vírus com a Panda Software, fique você também!
Clique em: http://antivirus.sapo.pt


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