[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Can I diplay the <expression> used by xsl:if test=

Subject: Re: Can I diplay the <expression> used by xsl:if test="<expression>"?
From: René de Vries <RdVries@xxxxxxxxxxx>
Date: Thu, 1 Aug 2002 17:09:45 +0200
xsl if test gt
Hi David,

I want to display the LITERAL text of the test.
So if it would be <xsl:if test="aNode &gt; 0"/> I want to display "aNode
&gt; 0".
Reason is that I want to pass the expression to a template to have it tested
and want to display in the template WHAT I've tested.

Something like this:
<xsl:call-template name="TestTheExpression">
    <xsl:with-param name="TheExpression" select="'aNode &gt; 0'"/>
</xsl:call-template>

<xsl:template name="TestTheExpression">
    <xsl:param name="TheExpression"/>

    <xsl:if test="$TheExpression"> // this won't work, because TheExpression
is now a literal and will evaluate to true....
        ... do something ..
        <xsl:value-of select="$TheExpression"/>
    </xsl:if>
</xsl:template>

Greetings René
   {@   @}
        ^
      \_/

"You don't need eyes to see, you need vision!"
----- Original Message -----
From: "David Carlisle" <davidc@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, August 01, 2002 12:27 PM
Subject: Re:  Can I diplay the <expression> used by xsl:if
test="<expression>"?


> I want to do this:
> <xsl:if test="test something">
>    <xsl:text>Error because: </xsl:test>
>    <xsl:value-of select="......"/>   // what do I put on the dots to get
>"test something"????
>    <xsl:text> was true.</xsl:test>
></xsl:if>

don't use xsl:value-of just use
<xsl:text>test something</xsl:text>

Or use xsl:value of and use '...' so it's a string.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.