xsl:choose

Discussion in 'XML' started by Ruthless, Dec 26, 2003.

  1. Ruthless

    Ruthless Guest

    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


    ---
    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
     
    Ruthless, Dec 26, 2003
    #1
    1. Advertising

  2. 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" <ruthless@NO_SPAM.poczta.onet.pl> wrote in message
    news:bsia9q$i0d$...
    > 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
    >
    >
    > ---
    > 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
    >
    >
     
    Dimitre Novatchev, Dec 26, 2003
    #2
    1. Advertising

  3. Ruthless

    Ruthless Guest

    thank you very much

    greetings R

    U¿ytkownik "Dimitre Novatchev" <> napisa³ w wiadomo¶ci
    news:bsianv$chfvg$-berlin.de...
    > 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" <ruthless@NO_SPAM.poczta.onet.pl> wrote in message
    > news:bsia9q$i0d$...
    > > 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
    > >
    > >
    > > ---
    > > 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
     
    Ruthless, Dec 27, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Flood
    Replies:
    0
    Views:
    1,034
    Kevin Flood
    Sep 8, 2004
  2. Prabh

    Pick/Choose XML from XSL

    Prabh, Dec 1, 2004, in forum: XML
    Replies:
    3
    Views:
    446
    Morris M. Keesan
    Dec 4, 2004
  3. Replies:
    1
    Views:
    3,637
    A. Bolmarcich
    May 27, 2005
  4. freefly_xml
    Replies:
    4
    Views:
    864
    freefly_xml
    May 16, 2006
  5. michael75
    Replies:
    0
    Views:
    1,846
    michael75
    Aug 3, 2010
Loading...

Share This Page