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. Xpath selecting nodes based on multiple attributes

Xpath selecting nodes based on multiple attributes

Scheduled Pinned Locked Moved XML / XSL
xmldatabase
4 Posts 3 Posters 10 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.
  • J Offline
    J Offline
    joost versteegen
    wrote on last edited by
    #1

    Hello, I have a xml file and try to select nodes with a xpath query based on multiple attribute values, but can't get it to work. please tell me the correct xpath. here's part of the xml:

    and here's my xpath query:

    //AppInt [@ID="91"]/Setpoints [Setpoint/@JobID="1002" and Setpoint/@ModeID="1"]/@Name

    P Richard DeemingR 2 Replies Last reply
    0
    • J joost versteegen

      Hello, I have a xml file and try to select nodes with a xpath query based on multiple attribute values, but can't get it to work. please tell me the correct xpath. here's part of the xml:

      and here's my xpath query:

      //AppInt [@ID="91"]/Setpoints [Setpoint/@JobID="1002" and Setpoint/@ModeID="1"]/@Name

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      Which nodes are you trying to select?

      J 1 Reply Last reply
      0
      • J joost versteegen

        Hello, I have a xml file and try to select nodes with a xpath query based on multiple attribute values, but can't get it to work. please tell me the correct xpath. here's part of the xml:

        and here's my xpath query:

        //AppInt [@ID="91"]/Setpoints [Setpoint/@JobID="1002" and Setpoint/@ModeID="1"]/@Name

        Richard DeemingR Offline
        Richard DeemingR Offline
        Richard Deeming
        wrote on last edited by
        #3

        Try this:

        //AppInt[@ID="91"]/Setpoints/Setpoint[@JobID="1002" and @ModeID="1"]/@Name


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

        1 Reply Last reply
        0
        • P PIEBALDconsult

          Which nodes are you trying to select?

          J Offline
          J Offline
          joost versteegen
          wrote on last edited by
          #4

          You asked the right question: I was trying to select the setpoint nodes, so i must remove the @Name.

          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