473,410 Members | 1,889 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

<xsl:when> on more than one selection

Hi

Is there a possibility to make an <xsl:whenon 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
<xsl:otherwise>
Do something else

More this way:
<xsl:choose>
<xsl:when a=test or a=test2 or a=test3>
Do this
<xsl:otherwise>
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

May 18 '07 #1
2 2563

Kniffel <ke**@eh-systemhaus.dewrote in
<11*********************@e65g2000hsc.googlegroups. com>:
Is there a possibility to make an <xsl:whenon 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
May 18 '07 #2

"Kniffel" <ke**@eh-systemhaus.dewrote in message
news:11*********************@e65g2000hsc.googlegro ups.com...
Hi

Is there a possibility to make an <xsl:whenon 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
<xsl:otherwise>
Do something else

More this way:
<xsl:choose>
<xsl:when a=test or a=test2 or a=test3>
Do this
<xsl:otherwise>
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

May 19 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Xeon | last post by:
Hi, I'm trying this code snippet below but the parser (sablotron) returns error : <xsl:choose> <xsl:when test="some test case"> <xsl:variable name="test" select="0"/> </xsl:when>...
3
by: Rupa | last post by:
Hi, I'm trying to write an xslt to convert an email in xml format to a new xml format. <descr> <xsl:choose> <xsl:value-of select="body"> </xsl:value-of select> <xsl:when test=" <xsl:value-of...
0
by: Sparko | last post by:
My Xml is as follows; <root> <st id="1"> <rt id="1"> <cr id="1" ca_w="" ca_x="" ca_y="" ca_z="" other attribs> <ct some attribs> <te some attribs /> <te some attribs />
1
by: Matt | last post by:
For example, how to represent hyperlink in XSL? I want to add hyperlink in XSL. i.e. I need to generate <A HREF="http://mypage.html">home page</A> in HTML. I tried the following approaches but...
1
by: Vijay singh | last post by:
Hi wonder if anybody can clear by doubt XML file : <score id="1"> <film>A Little Princess</film> <composer>Patrick Doyle</composer>
4
by: renderman | last post by:
Hi, I looked through a computergenerated code because I had to edit something manually. I found this line: <xsl:when test="''='FALSE'"> I don't get what this means.
8
by: Hoi Wong | last post by:
With the XSLT 1.0 engine that I was forced to use, I have to parse old XML scripts where the number (to be parsed and saved into $EPISODE_NUMBER_RAW) that I want to parse is written with a comma...
5
by: John Gordon | last post by:
My XSLT files have many occurrences of this general pattern: <a> <xsl:attribute name="href"> <xsl:value-of select="xyz" /> </xsl:attribute> </a> When I execute an XSL transform, the...
2
by: JamesDelaney | last post by:
Hi all, I'm creating a number of fragments to calculate various presence numbers. I'm creating variables from the results of these fragments then doing simple math to give the results. I'm...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.