|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: OR in test
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








