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. Find Element

Find Element

Scheduled Pinned Locked Moved XML / XSL
xmljavascriptdatabasequestion
2 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.
  • B Offline
    B Offline
    blink4me
    wrote on last edited by
    #1

    Hi, I have many entries in my XML and I would like to search for one in particular (the one the user wants) but not show it, just take that entry and check an element in it, how would this be done. Ex: KABE Allentown Intl PA 40.652364 -75.440403 KABI Abilene Reg. TX 32.411319 -99.681897 I want to look up KABE and put its Long value in a double. (BTW, I have no schema for this file, only the XML, would a schema be helpfull here?) Thanks... // JS Paquet cout << "Thank you all" << endl;

    Richard DeemingR 1 Reply Last reply
    0
    • B blink4me

      Hi, I have many entries in my XML and I would like to search for one in particular (the one the user wants) but not show it, just take that entry and check an element in it, how would this be done. Ex: KABE Allentown Intl PA 40.652364 -75.440403 KABI Abilene Reg. TX 32.411319 -99.681897 I want to look up KABE and put its Long value in a double. (BTW, I have no schema for this file, only the XML, would a schema be helpfull here?) Thanks... // JS Paquet cout << "Thank you all" << endl;

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

      Try something like:

      XmlNode node = doc.SelectSingleNode("/Airports/Airport[ICAO='KABE']/Long");
      double lon = double.Parse(node.InnerText);


      "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
      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