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. extract data from "dynamic" XML-files

extract data from "dynamic" XML-files

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

    Hi, Hi! I’m writing an application that reads XML files that are auto generated form another application called Xapp. My application is supposed to extract certain data from the generated XML files. Lets say that I need to extract the values from a number of caluclations done by Xapp called A and C in the example below.The calculations that aren't measured wont be listed so the files will variate quite much. A won't be present if its not calculated. What is the best and most dynamic way of extracting the data? I found the xmlreader abit to static. Is Xpath the right way? I’m developing in .Net 2.0 (very simplified example ) Calculations A 4.9 B 1.0 C 2.0 Many Thanks /Ibana

    B 1 Reply Last reply
    0
    • I Ibana

      Hi, Hi! I’m writing an application that reads XML files that are auto generated form another application called Xapp. My application is supposed to extract certain data from the generated XML files. Lets say that I need to extract the values from a number of caluclations done by Xapp called A and C in the example below.The calculations that aren't measured wont be listed so the files will variate quite much. A won't be present if its not calculated. What is the best and most dynamic way of extracting the data? I found the xmlreader abit to static. Is Xpath the right way? I’m developing in .Net 2.0 (very simplified example ) Calculations A 4.9 B 1.0 C 2.0 Many Thanks /Ibana

      B Offline
      B Offline
      BoneSoft
      wrote on last edited by
      #2

      Personally, I'd build an XML serializable model to read XML into live objects. Then your controlling app can iterate through the graph to get whatever values you need, or you can alter the generated model to do calculations on itself. You can do this with XSD.exe or something like Skeleton Crew[^]. I'm not big on XmlReader or using XPath with XmlDocument, but they are also both reasonable approaches. If you only need the values from one type of node, maybe XPath would be less work. But if you are going to need anything else from your XML, you might want to look at a serializable model.


      Try code model generation tools at BoneSoft.com.

      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