[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
RE: [xsl]
RE: [xsl]
Subject: RE: [xsl] <xsl:if test ... - question
From: Heinz Seldte <HeinzS@xxxxxxxxx>
Date: Tue, 7 Jan 2003 11:03:05 +0200
Helo,
A
==
If I understand your question correctly, you will end up with an XML snip
that looks like this:
...
<servus>
<check>true</check>
</servus>
OR
...
<servus>
<check>false</check>
</servus>
B
==
If this is true, then your XSL looks OK. You don't have to write true/false
in the disabled attribute, you can just add it to the select like so:
<xsl:if test="check = 'true'">
<xsl:attribute name="disabled"></xsl:attribute>
</xsl:if>
I have tested it and it works fine. If you still have problems, I suggest
adding a "debug"
<xsl:value-of select="check"/>
to your XSL so you can see if the value of check (as shown in A above) pulls
through OK!
Cheers,
Heinz
-----Original Message-----
From: Johannes.Becker@xxxxxx [mailto:Johannes.Becker@xxxxxx]
Sent: 07 Januarie 2003 10:36
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] <xsl:if test ... - question
Hi,
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
Current Thread
- [xsl] <xsl:if test ... - question
- Johannes . Becker - Tue, 7 Jan 2003 09:36:09 +0100
- Michael Kay - Tue, 7 Jan 2003 12:33:21 -0000
- <Possible follow-ups>
- Jarno . Elovirta - Tue, 7 Jan 2003 11:01:15 +0200
- Heinz Seldte - Tue, 7 Jan 2003 11:03:05 +0200 <=
- Johannes . Becker - Tue, 7 Jan 2003 10:18:45 +0100
<- Previous Index Next ->
RE: [xsl] <xsl:if test ... - questi, Jarno . Elovirta
Thread
RE: [xsl] <xsl:if test ... - questi, Johannes . Becker
RE: [xsl] <xsl:if test ... - questi, Jarno . Elovirta
Date
RE: [xsl] Read a attribute value fr, Jarno . Elovirta
Month
Subject: RE: [xsl] <xsl:if test ... - question From: Heinz Seldte <HeinzS@xxxxxxxxx> Date: Tue, 7 Jan 2003 11:03:05 +0200 |
Helo, A == If I understand your question correctly, you will end up with an XML snip that looks like this: ... <servus> <check>true</check> </servus> OR ... <servus> <check>false</check> </servus> B == If this is true, then your XSL looks OK. You don't have to write true/false in the disabled attribute, you can just add it to the select like so: <xsl:if test="check = 'true'"> <xsl:attribute name="disabled"></xsl:attribute> </xsl:if> I have tested it and it works fine. If you still have problems, I suggest adding a "debug" <xsl:value-of select="check"/> to your XSL so you can see if the value of check (as shown in A above) pulls through OK! Cheers, Heinz -----Original Message----- From: Johannes.Becker@xxxxxx [mailto:Johannes.Becker@xxxxxx] Sent: 07 Januarie 2003 10:36 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: [xsl] <xsl:if test ... - question Hi, 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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] <xsl:if test ... - questi, Jarno . Elovirta | Thread | RE: [xsl] <xsl:if test ... - questi, Johannes . Becker |
RE: [xsl] <xsl:if test ... - questi, Jarno . Elovirta | Date | RE: [xsl] Read a attribute value fr, Jarno . Elovirta |
Month |