xsl:choose

R

Ruthless

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:eek:therwise>
<xsl:value-of select="info"/>
</xsl:eek:therwise>
</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
 
R

Ruthless

thank you very much

greetings R

U¿ytkownik "Dimitre Novatchev said:
Use:
<xsl:choose>
<xsl:when test="not(info)">
[non info]
</xsl:when>
<xsl:eek:therwise>
<xsl:value-of select="info"/>
</xsl:eek:therwise>
</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 said:
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:eek:therwise>
<xsl:value-of select="info"/>
</xsl:eek:therwise>
</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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top