#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Posts
    20
    Rep Power
    0

    conditional statements


    Hi

    I'm new to xml I just have a question about if and select statments. For example if I have the following "if test" statement
    that states price is greater than 10

    <xsl:if test="price&gt;'10'">
    but how would I make it so it says greater than 10 or less than 5.

    I know other programming languages you would write the above statement as
    if (price >10 || price <5)

    also if you have the following "select" statement that selects artist

    <xsl:sort select="artist"/>

    but how would I rewrite the statement to select artist and painters?

    Please help

    getchoo
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2002
    Location
    new york
    Posts
    84
    Rep Power
    13
    it's someting like this..( your path will probably be different):

    <xsl:if test="/price > 10 or /price < 5">

    <xsl:value-of select="//element_with_path"/>
    </xsl:if>

    selecting artist and painters you would use:
    and
    again you will have to provide the correct path.

    it's alittle tough without the xml document structure, but just make the adjustment with your path and elements


    ----------------------------------------------
    Operators:
    ----------------------------------------------
    and
    or
    ====================================

    hope that helped...

    justin.dago
    Last edited by justin_dago; July 19th, 2002 at 04:32 PM.

IMN logo majestic logo threadwatch logo seochat tools logo