473,320 Members | 2,109 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,320 software developers and data experts.

xsl:choose

Hello.

I've got a question about xsl:choose

I've got an element <person> with the sequence of
<first_name><last_name><date_bith> and <info>

and the info is not obligatory(minOccurs="0")

When i'm translating my XML document i've got blank cell(in table) when
there is no <info> element

I've written sth like this:

<xsl:when test="info=''">
[non info]
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="info"/>
</xsl:otherwise>
</xsl:choose>

It displays the value of <info> when it is in document and where it's not it
still displays blank space.

I konow that i'm testing only if info is empty("") not if info exists.

How can I check if the info is present and display it content and if doesn'y
exist display [non info] msg?

thanx in advance
greetings R
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.554 / Virus Database: 346 - Release Date: 03-12-20
Jul 20 '05 #1
2 1958
Use:
<xsl:choose>
<xsl:when test="not(info)">
[non info]
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="info"/>
</xsl:otherwise>
</xsl:choose>

Dimitre Novatchev.
FXSL developer, XML Insider,

http://fxsl.sourceforge.net/ -- the home of FXSL
Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html
"Ruthless" <ruthless@NO_SPAM.poczta.onet.pl> wrote in message
news:bs**********@nemesis.news.tpi.pl...
Hello.

I've got a question about xsl:choose

I've got an element <person> with the sequence of
<first_name><last_name><date_bith> and <info>

and the info is not obligatory(minOccurs="0")

When i'm translating my XML document i've got blank cell(in table) when
there is no <info> element

I've written sth like this:

<xsl:when test="info=''">
[non info]
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="info"/>
</xsl:otherwise>
</xsl:choose>

It displays the value of <info> when it is in document and where it's not it still displays blank space.

I konow that i'm testing only if info is empty("") not if info exists.

How can I check if the info is present and display it content and if doesn'y exist display [non info] msg?

thanx in advance
greetings R
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.554 / Virus Database: 346 - Release Date: 03-12-20

Jul 20 '05 #2
thank you very much

greetings R

U¿ytkownik "Dimitre Novatchev" <dn********@yahoo.com> napisa³ w wiadomo¶ci
news:bs************@ID-152440.news.uni-berlin.de...
Use:
<xsl:choose>
<xsl:when test="not(info)">
[non info]
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="info"/>
</xsl:otherwise>
</xsl:choose>

Dimitre Novatchev.
FXSL developer, XML Insider,

http://fxsl.sourceforge.net/ -- the home of FXSL
Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html
"Ruthless" <ruthless@NO_SPAM.poczta.onet.pl> wrote in message
news:bs**********@nemesis.news.tpi.pl...
Hello.

I've got a question about xsl:choose

I've got an element <person> with the sequence of
<first_name><last_name><date_bith> and <info>

and the info is not obligatory(minOccurs="0")

When i'm translating my XML document i've got blank cell(in table) when
there is no <info> element

I've written sth like this:

<xsl:when test="info=''">
[non info]
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="info"/>
</xsl:otherwise>
</xsl:choose>

It displays the value of <info> when it is in document and where it's
not it
still displays blank space.

I konow that i'm testing only if info is empty("") not if info exists.

How can I check if the info is present and display it content and if

doesn'y
exist display [non info] msg?

thanx in advance
greetings R
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.554 / Virus Database: 346 - Release Date: 03-12-20


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.554 / Virus Database: 346 - Release Date: 03-12-20
Jul 20 '05 #3

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

Similar topics

0
by: Franck Perrin | last post by:
I'd like to know if there is a way to apply to successive XSL transformations on one XML file. I got this XML file : <page Action="N047"> <data defaultName="c0dos010" Type="String"...
29
by: Thomas | last post by:
Hi I have an XSL stylesheet: <xsl:for-each select="TRACKS/TRACK"> <tr class="TDL"> <td width="90%"><xsl:number value="position()" format="1" /> - <xsl:value-of select="TRACKTITLE"/></td>...
4
by: Jean-Christophe Michel | last post by:
Hi, In a complex merging of two (non ordered) xml files i need to keep track of the elements of the second tree that were already merged with first tree, to copy only unused elements at the end....
0
by: Jimmy | last post by:
Hi, I have a (multi-tier) XML document and a XSL transform file (that is meant to transform the XML into a flat structure so I can insert the data into a database table). I have reached a...
3
by: Anders Borum | last post by:
Hello! I've come across a strange error that occurs, when you try to return a nodelist from a variable with a choose/where/otherwise statement. I'm not quite sure whether it's a bug or simply...
6
by: dave | last post by:
I really have 2 questions regarding the following xml snippet. The xml is a directory representation. <?xml version="1.0" standalone="yes"?> <FileSystem> <Row> <ID>1</ID> <Name>Root</Name>...
4
by: freefly_xml | last post by:
I want to test to see if I am on the last page of a document. In this example it is an invoice. I want to print a different table in REGION AFTER when I am on the last page. I have tried many...
2
by: shapper | last post by:
Hello, I am for days trying to apply a XSL transformation to a XML file and display the result in a the browser. I am using Asp.Net 2.0. Please, could someone post just a simple code example,...
1
by: shalini jain | last post by:
Hi, I want to know how can we do pagination using XSL. There are number of tutorials available on pagination using PHP but nothing with XSL. i am really stuck with my code. Below is the code that...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.