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

Re: OR in test

Subject: Re: OR in test
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Thu, 4 Jul 2002 13:48:52 +0100
translate password
Hi Ashu,

> but it is not working .i want to know that is it wrong to use or(|)
> in test.if yes then what should be the right way.

In XPath, 'or' is 'or'. '|' is the union operator, which unions
together two or more node sets to create another one. (This sometimes
gives the same result as 'or', but that's because when you test a node
set, it's "true" when the node set has a node in it and false
otherwise.)

So use:

  <xsl:if test="$type='text' or $type='password'">
    ...
  </xsl:if>

> and what if in html text is written as TEXT(in capitals). as in wml
> only two (text and password) input types are allowed

Then you need to test whether $type, converted to lowercase, is 'text'
or not. You can convert to lowercase using the translate() function.
Perhaps you want:

  <xsl:if test="translate($type, 'TEX', 'tex')='text' or
                translate($type, 'PASWORD', 'pasword')='password'">
    ...
  </xsl:if>

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 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.