xsl-list
[Top] [All Lists]

RE: <xsl:if test ... - question

2003-01-07 05:33:21
match="/servus" will only match a <servus> element at the top level, it
won't match one that is a child of <xsp:page>.

Also, you are testing check="true", but the actual value of the <check>
element is "check" surrounded by a number of spaces (unless you use
xsl:strip-space to remove them).

Michael Kay
Software AG
home: Michael(_dot_)H(_dot_)Kay(_at_)ntlworld(_dot_)com
work: Michael(_dot_)Kay(_at_)softwareag(_dot_)com 

I have a question concerning "<xsl:if test ...".
First trying to check a value in an xsp page in the xsp:logic 
part. If blabla, the value should be set to true.

My XSP:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page language="java"
      xmlns:xsp="http://apache.org/xsp";>

  <xsp:logic>
       String check = "false";
       ...
       check = "true";
  </xsp:logic>

      <servus>
            ...
            <check>
                  <xsp:expr>check</xsp:expr>
            </check>
  </servus>

</xsp:page>


My XSL:

<?xml version="1.0"?>
<xsl:stylesheet 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version ="1.0">

<xsl:template match="/servus">
  <html>
      <head>
            ...
            <select name="report_id">
                  <xsl:if test="check = 'true'">
                        <xsl:attribute 
name="disabled"><xsl:value-of select ="check"/></xsl:attribute>
                  </xsl:if>
            </select>
      </p>
      </body>
  </html>
</xsl:template>

</xsl:stylesheet>


My problem is, that my checking doesn't work (it never 
disables the selectbox). What am I doing wrong?



Jonny



--------------------------------------------------------------
--------------------------------------

This electronic message contains information from the mmo2 
plc Group which may be privileged or confidential. The 
information is intended to be for the use of the
individual(s) or entity named above. If you are not the 
intended recipient be aware that any disclosure, copying, 
distribution or use of the contents of this information is 
prohibited. If you have received this electronic message in 
error, please notify us by telephone or email (to the numbers 
or address above) immediately.





 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



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