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

Re: xsl:if syntax problem

Subject: Re: xsl:if syntax problem
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Wed, 20 Mar 2002 14:19:06 +0100
onclick empty
<xsl:template match="entity">
  <xsl:if test="onClick='' or not(onClick='')">
    do processing
  </xsl:if>

You want to test whether onClick is empty or onClick doesn't exist? then not(onClick='') is the false expression.


Or in other words:
test=" A or not(A)" is always true.

The second part should be "not(onClick)" (without ='', because you would have again boolean in it).

But there is a shorter way too:

either

test="normalize-space(onClick)" (whitespaces are removed)

or

test="string(onClick)" (empty onClick but with whitespaces won't be ignored)

I think normalize-space(onClick) is the right one.

Regards,

Joerg


However, this xsl does not appear to work. The xsl will run on the following
xml code.

  <entity id="e1">
    <description>Customers</description>
    <oncontextmenu></oncontextmenu>
    <image>images/book.gif</image>
    <imageOpen>images/bookOpen.gif</imageOpen>
    <onClick>http://www.google.com</onClick>

Any help, tips, links will be much appreciated,
Brian.

--


System Development
VIRBUS AG
Fon  +49(0)341-979-7411
Fax  +49(0)341-979-7409
joerg.heinicke@xxxxxxxxx
www.virbus.de


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.