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. C / C++ / MFC
  4. About XML parser with MSXML 4

About XML parser with MSXML 4

Scheduled Pinned Locked Moved C / C++ / MFC
xmlhelp
6 Posts 3 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.
  • Y Offline
    Y Offline
    YKWCH
    wrote on last edited by
    #1

    My xml file is below: sichuan.bmp ganzi (190,270) mianyang (467,190) yaan (346,335) There will be many cities in xml file,and I want to get city name,point of a city at a time and store them into a struct,then I use selectNodes("list"),but it return a NULL pointer, thus I consider that the only list node is the reason,so I use selectSingleNode("list"),but it also cannot work and return NULL pointer,I've no idea,hope your help I love Aquamarine.

    S A 2 Replies Last reply
    0
    • Y YKWCH

      My xml file is below: sichuan.bmp ganzi (190,270) mianyang (467,190) yaan (346,335) There will be many cities in xml file,and I want to get city name,point of a city at a time and store them into a struct,then I use selectNodes("list"),but it return a NULL pointer, thus I consider that the only list node is the reason,so I use selectSingleNode("list"),but it also cannot work and return NULL pointer,I've no idea,hope your help I love Aquamarine.

      S Offline
      S Offline
      Shanmuga Sundar
      wrote on last edited by
      #2

      hey guy use the STL tools and first u have parse the xml document and seperate as tokens and then u can easily get the city and point into a sep structure. Try this..... Shanmuga Sundar.V

      1 Reply Last reply
      0
      • Y YKWCH

        My xml file is below: sichuan.bmp ganzi (190,270) mianyang (467,190) yaan (346,335) There will be many cities in xml file,and I want to get city name,point of a city at a time and store them into a struct,then I use selectNodes("list"),but it return a NULL pointer, thus I consider that the only list node is the reason,so I use selectSingleNode("list"),but it also cannot work and return NULL pointer,I've no idea,hope your help I love Aquamarine.

        A Offline
        A Offline
        Anand Paranjpe
        wrote on last edited by
        #3

        hi, use XPath query language. "//list/city/*" pass this query to SelectNodes(); it will return u list of cities. Try it out. I cannot give u compilable code as I am using .NET IDE now a days. Search on MSDN @ writting XPath query. The chosen One :)

        Y 1 Reply Last reply
        0
        • A Anand Paranjpe

          hi, use XPath query language. "//list/city/*" pass this query to SelectNodes(); it will return u list of cities. Try it out. I cannot give u compilable code as I am using .NET IDE now a days. Search on MSDN @ writting XPath query. The chosen One :)

          Y Offline
          Y Offline
          YKWCH
          wrote on last edited by
          #4

          I have tried it, but it's the same, I have to ask for your help.When I use XPath:"//list/city/*", it returns a zero length, when I use "//city/*", it returns all of the nodes in list node rather than the number of citis, but I have to get the number of cities.:(( I love Aquamarine.

          A 1 Reply Last reply
          0
          • Y YKWCH

            I have tried it, but it's the same, I have to ask for your help.When I use XPath:"//list/city/*", it returns a zero length, when I use "//city/*", it returns all of the nodes in list node rather than the number of citis, but I have to get the number of cities.:(( I love Aquamarine.

            A Offline
            A Offline
            Anand Paranjpe
            wrote on last edited by
            #5

            hi, try to understand syntax of XPath. its simple. first "/" means root node, second "/" means child node, in ur case "list" level, now u need to fire query to enumerate cities. when u say "//city/*" u r on level of "city" node and u r gathering infor inside city node. try this "/list/city/*" Try this out, till the time I will explore how 2 use XML in .NET!! The chosen One :)

            Y 1 Reply Last reply
            0
            • A Anand Paranjpe

              hi, try to understand syntax of XPath. its simple. first "/" means root node, second "/" means child node, in ur case "list" level, now u need to fire query to enumerate cities. when u say "//city/*" u r on level of "city" node and u r gathering infor inside city node. try this "/list/city/*" Try this out, till the time I will explore how 2 use XML in .NET!! The chosen One :)

              Y Offline
              Y Offline
              YKWCH
              wrote on last edited by
              #6

              Solve it with XPath:"//citylist[1]/*", thank you for your reply.:) I love Aquamarine.

              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