Subject: RE: [xsl] <xsl:if test ... - question From: Johannes.Becker@xxxxxx Date: Tue, 7 Jan 2003 10:18:45 +0100 |
Hi Heinz, I added a debug and it pulls it through correctly. Could you send my your example code? I'm going nuts, because I can't find the error. Thanks 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. |---------+-------------------------------------> | | Heinz Seldte | | | <HeinzS@xxxxxxxxx> | | | Sent by: | | | owner-xsl-list@xxxxxxxxxxx| | | rrytech.com | | | | | | | | | 01/07/03 10:03 AM | | | Please respond to xsl-list| | | | |---------+-------------------------------------> >------------------------------------------------------------------------------------------------------------------------------| | | | To: "'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'" <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> | | cc: | | Subject: RE: [xsl] <xsl:if test ... - question | >------------------------------------------------------------------------------------------------------------------------------| 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 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] <xsl:if test ... - questi, Heinz Seldte | Thread | [xsl] Read a attribute value from X, Vijaya Kumar Y |
RE: [xsl] Read a attribute value fr, Henk J Meulekamp | Date | Re: [xsl] Read a attribute value fr, Babu Sathish Ramaraj |
Month |