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

RE: XSL exclusion of elements

Subject: RE: XSL exclusion of elements
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Tue, 18 Jun 2002 09:09:04 +0100
not normalize space
> 
> I want to do a combination of two items in one select so it 
> only returns the elements that are valid:
> 
>    <xsl:for-each select="Group/Field">
> 
>   
>    <xsl:variable name="val" 
> select="normalize-space(concat('//',DatabaseVariableName))"/>
>      <xsl:if test="( not(DatabaseVariableName='endDate')
>                     and not(DatabaseVariableName='password')
>                     and not(DatabaseVariableName='access')
>                     and not(DatabaseVariableName='status')
>                     and 
> (not(normalize-space(saxon:evaluate($val))=''))
>                     and 
> (not(normalize-space(saxon:evaluate($val))='0'))
>                     and
> (not(normalize-space(saxon:evaluate($val))='0.0'))
>                     and
> (not(normalize-space(saxon:evaluate($val))='0.0'))
>                     and (not(normalize-space(saxon:evaluate($val))=
> '$NON_VALUE'))

I would recommend that you evaluate
normalize-space(saxon:evaluate($val)) once and put it in a variable.
Saxon doesn't eliminate common sub-expressions, and the saxon:evaluate
call is quite expensive; so is the "//xxx" expression that it's
evaluating.


>                     and
> (not(normalize-space(saxon:evaluate($val))='false'))
>                     and
> (not(normalize-space(DatabaseVariableName)='listingTerms'))
>                     and 
> (not(normalize-space(saxon:evaluate($val))='*None Selected*')) )">
> 
> 
> AT THIS POINT: I want to be able to select all elements that 
> are in "Group/Field", excluding out everything in the xsl:if test.
> 
Why don't you use xsl:choose/xsl:when instead of xsl:if, and put the
remaining code in xsl:otherwise?

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 


 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-2007 All Rights Reserved.