Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. Selection based on more than one condition

Selection based on more than one condition

Scheduled Pinned Locked Moved XML / XSL
xmlquestiontutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    EnkelIk
    wrote on last edited by
    #1

    Hi. I have data in XML format and I use XslTransform.Transform to transform the data to a presentable form with an xsl-file. At one location I have used for instance to select what TermR data to use, where $intd is some variable. If I want to use two conditions, for example I only want to use TermR data where termid=$intd AND term2=$intp , is this possible? How do I write the selection in my xsl-code? Thanks /EnkelIk

    J 1 Reply Last reply
    0
    • E EnkelIk

      Hi. I have data in XML format and I use XslTransform.Transform to transform the data to a presentable form with an xsl-file. At one location I have used for instance to select what TermR data to use, where $intd is some variable. If I want to use two conditions, for example I only want to use TermR data where termid=$intd AND term2=$intp , is this possible? How do I write the selection in my xsl-code? Thanks /EnkelIk

      J Offline
      J Offline
      J Dunlap
      wrote on last edited by
      #2

      You should be able to use it just like that:

      <xsl:if test="termid=$intd AND term2=$intp">

      "Do unto others as you would have them do unto you." - Jesus
      "An eye for an eye only makes the whole world blind." - Mahatma Gandhi

      E 1 Reply Last reply
      0
      • J J Dunlap

        You should be able to use it just like that:

        <xsl:if test="termid=$intd AND term2=$intp">

        "Do unto others as you would have them do unto you." - Jesus
        "An eye for an eye only makes the whole world blind." - Mahatma Gandhi

        E Offline
        E Offline
        EnkelIk
        wrote on last edited by
        #3

        Thanks. Why did I not think of the simplest solution? For the select case the following turned out to work: i.e. just adding up the conditions. /EnkelIk

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups