Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > xsl:choose

Reply
Thread Tools

xsl:choose

 
 
Ruthless
Guest
Posts: n/a
 
      12-26-2003
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>
<xsltherwise>
<xsl:value-of select="info"/>
</xsltherwise>
</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


 
Reply With Quote
 
 
 
 
Dimitre Novatchev
Guest
Posts: n/a
 
      12-26-2003
Use:
<xsl:choose>
<xsl:when test="not(info)">
[non info]
</xsl:when>
<xsltherwise>
<xsl:value-of select="info"/>
</xsltherwise>
</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:bsia9q$i0d$(E-Mail Removed)...
> 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>
> <xsltherwise>
> <xsl:value-of select="info"/>
> </xsltherwise>
> </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
>
>



 
Reply With Quote
 
 
 
 
Ruthless
Guest
Posts: n/a
 
      12-27-2003
thank you very much

greetings R

Użytkownik "Dimitre Novatchev" <(E-Mail Removed)> napisał w wiadomości
news:bsianv$chfvg$(E-Mail Removed)-berlin.de...
> Use:
> <xsl:choose>
> <xsl:when test="not(info)">
> [non info]
> </xsl:when>
> <xsltherwise>
> <xsl:value-of select="info"/>
> </xsltherwise>
> </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:bsia9q$i0d$(E-Mail Removed)...
> > 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>
> > <xsltherwise>
> > <xsl:value-of select="info"/>
> > </xsltherwise>
> > </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


 
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




Advertisments