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. HELP! XPath Syntax

HELP! XPath Syntax

Scheduled Pinned Locked Moved XML / XSL
xmldatabasedesignregexhelp
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.
  • M Offline
    M Offline
    mikasa
    wrote on last edited by
    #1

    Ok, I'll keep this as simple as possible. I need to Query an XML file and Return the "DataRow" Nodes that meet some criteria contained in more than one ChildNode of the Row. Keep in mind that I cannot simply make the ID's part of the "DataRow" node, because for every XML file, the IDs are totally different Columns (not by my design). Here's an example XML data: Ok, what I need to do is Select all "DataRow" nodes where the "DataColumn" matches the following criteria: @Name='DatabaseID' and @Value='1' and @Name='RowID' and @Value='1' Here's what I have so far, but I can't seem to match a DataRow to multiple criteria in the DataColumns: //DataRow/DataColumn[@Name='DatabaseID' and @Value='1']

    P 1 Reply Last reply
    0
    • M mikasa

      Ok, I'll keep this as simple as possible. I need to Query an XML file and Return the "DataRow" Nodes that meet some criteria contained in more than one ChildNode of the Row. Keep in mind that I cannot simply make the ID's part of the "DataRow" node, because for every XML file, the IDs are totally different Columns (not by my design). Here's an example XML data: Ok, what I need to do is Select all "DataRow" nodes where the "DataColumn" matches the following criteria: @Name='DatabaseID' and @Value='1' and @Name='RowID' and @Value='1' Here's what I have so far, but I can't seem to match a DataRow to multiple criteria in the DataColumns: //DataRow/DataColumn[@Name='DatabaseID' and @Value='1']

      P Offline
      P Offline
      Philip Fitzsimons
      wrote on last edited by
      #2

      //DataRow[ DataColumn/@Name='DatabaseID' and DataColumn/@Value='1' and DataColumn/@Name='RowID' and DataColumn/@Value='1']


      "When the only tool you have is a hammer, a sore thumb you will have."

      M 1 Reply Last reply
      0
      • P Philip Fitzsimons

        //DataRow[ DataColumn/@Name='DatabaseID' and DataColumn/@Value='1' and DataColumn/@Name='RowID' and DataColumn/@Value='1']


        "When the only tool you have is a hammer, a sore thumb you will have."

        M Offline
        M Offline
        mikasa
        wrote on last edited by
        #3

        Thanks for the Reply, I ended up figuring it out this morning in 15min ;P (after working on it for 10hrs yesterday)... I ended up with this:

        //DataRow[DataColumn[@Name='DatabaseID' and @Value='1'] and DataColumn[@Name='ID' and @Value='26']]

        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