Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > <xsl:when> on more than one selection

Reply
Thread Tools

<xsl:when> on more than one selection

 
 
Kniffel
Guest
Posts: n/a
 
      05-18-2007
Hi

Is there a possibility to make an <xsl:when> on more than one
Selection?

Not that way:
<xsl:choose>
<xsl:when a=test>
Do this
<xsl:when a=test2>
Do this
<xsl:when a=test3>
Do this
<xsltherwise>
Do something else

More this way:
<xsl:choose>
<xsl:when a=test or a=test2 or a=test3>
Do this
<xsltherwise>
Do something else


Part of my xsl-file:
<xsl:variable name="attr" select="name()" />
<xsl:variable name="attrwert" select="." />
<xsl:choose>
************************************************** *************
<xsl:when test="$attr='Aktiv'">
Do this
************************************************** *************
</xsl:when>
....
</xsl:choose>
</xsl:choose>

In regards
Kniffel

 
Reply With Quote
 
 
 
 
Pavel Lepin
Guest
Posts: n/a
 
      05-18-2007

Kniffel <(E-Mail Removed)> wrote in
<(E-Mail Removed). com>:
> Is there a possibility to make an <xsl:when> on more than
> one Selection?


[...]

> <xsl:choose>
> <xsl:when a=test or a=test2 or a=test3>
> Do this


XPath does have logical operators. For details refer to
your, well, XPath reference.

http://www.catb.org/~esr/faqs/smart-questions.html

--
Pavel Lepin
 
Reply With Quote
 
 
 
 
Dimitre Novatchev
Guest
Posts: n/a
 
      05-19-2007

"Kniffel" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> Hi
>
> Is there a possibility to make an <xsl:when> on more than one
> Selection?


Yes


>
> Not that way:
> <xsl:choose>
> <xsl:when a=test>
> Do this
> <xsl:when a=test2>
> Do this
> <xsl:when a=test3>
> Do this
> <xsltherwise>
> Do something else
>
> More this way:
> <xsl:choose>
> <xsl:when a=test or a=test2 or a=test3>
> Do this
> <xsltherwise>
> Do something else
>
>
> Part of my xsl-file:
> <xsl:variable name="attr" select="name()" />
> <xsl:variable name="attrwert" select="." />
> <xsl:choose>
> ************************************************** *************
> <xsl:when test="$attr='Aktiv'">
> Do this
> ************************************************** *************
> </xsl:when>
> ....
> </xsl:choose>
> </xsl:choose>
>
> In regards
> Kniffel
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can one declare more than one signal on one line? Merciadri Luca VHDL 4 11-01-2010 02:00 PM
Like all great travelers, I have seen more than I remember andremember more than I have seen. shenrilaa@gmail.com Java 0 03-06-2008 08:11 AM
Like all great travelers, I have seen more than I remember andremember more than I have seen. shenrilaa@gmail.com C++ 0 03-05-2008 08:41 AM
Like all great travelers, I have seen more than I remember andremember more than I have seen. shenrilaa@gmail.com C Programming 0 03-05-2008 03:26 AM
Is it possible to set the Text property of more than one literal in one go? Alan Silver ASP .Net 4 07-03-2005 01:19 PM



Advertisments