About XML parser with MSXML 4
-
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.
-
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.
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
-
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.
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 :)
-
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 :)
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.
-
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.
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 :)
-
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 :)