[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: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Thu, 4 Jul 2002 14:11:33 +0100
value of select or and
If you want to use "or" in a test, use "or", and not "|", which means
union.

Also note, 
>           <xsl:variable name="type">
>    	   <xsl:value-of select="@type"/>
>           </xsl:variable>

is a very inefficient way of writing
<xsl:variable name="type" select="@type"/>

while

>                 <xsl:element name="input">
>  	          <xsl:attribute name="name">
>  	          <xsl:value-of select="@name"/>
>  	          </xsl:attribute>
>  	           <xsl:attribute name="type">
>  	           <xsl:value-of select="@type"/>
>  	           </xsl:attribute>
>  	           <xsl:apply-templates/>
>  	        </xsl:element>

is a rather long-winded way of writing

<input name="{@name}" type="{@type}">
<xsl:apply-templates/>
</input>

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

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of ashu t
> Sent: 04 July 2002 13:34
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  OR in test 
> 
> 
> in conversion of html to wml i am using this template match for 
> <input>tag.
> <xsl:template match="a/input | div/input | center/input | p/input 
> | ul/input | li/input | tr/input | td/input | th/input |
> table/input | font/input">
>           <xsl:variable name="type">
>    	   <xsl:value-of select="@type"/>
>           </xsl:variable>
>           <xsl:if test="$type='text'| $type='password'">
>             <xsl:choose>
>              <xsl:when test="$type='text'">
>                <xsl:element name="input">
>                    <xsl:attribute name="name">
>                    <xsl:value-of select="@name"/>
>                    </xsl:attribute>
>                    <xsl:attribute name="type">
>                    <xsl:value-of select="@type"/>
>                    </xsl:attribute>
>                    <xsl:apply-templates/>
>                 </xsl:element>
>               </xsl:when>
>               <xsl:otherwise>
>                 <xsl:element name="input">
>  	          <xsl:attribute name="name">
>  	          <xsl:value-of select="@name"/>
>  	          </xsl:attribute>
>  	           <xsl:attribute name="type">
>  	           <xsl:value-of select="@type"/>
>  	           </xsl:attribute>
>  	           <xsl:apply-templates/>
>  	        </xsl:element>
>  	       </xsl:otherwise>
>  	       </xsl:choose>
>            </xsl:if>
>     </xsl:template>
> 
> 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. and what 
> if in html text is written as TEXT(in capitals).
> as in wml only two (text and password) input types are allowed ashu
> 
> _________________________________________________________
> There is always a better job for you at Monsterindia.com.
> Go now http://monsterindia.rediff.com/jobs
> 
> 
>  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.