简体   繁体   中英

How Do I Parse XML Webpage In C++

I've been searching the internet for an hour or so, and I surrender, how do I do it?

I just want to take a webpage with a simple xml output with something simple like the weather or stock information, and have it spit out something saying, "The temperature is 90f" or "google is up". For example, http://www.google.com/ig/api?weather=New+York would say "It is 70f" or something like that.

I am extremely new to C++ and I don't know much about this, and if you are going to direct me to a library, could you please also show me a tutorial on installing new libraries? I am using visual C++ 2010, and I can't seem to find how to install new libraries.

You need two c++ libraries

for call the http resource http://curl.haxx.se/libcurl/

for parsing XML output http://www.grinninglizard.com/tinyxml2/index.html

Look at documentation for information about their use

Bye

Use Microsoft Xmlite . A Small And Fast XML Parser For Native C++ . other Microsoft solutions are:

  • MSXML (SAX2) (native)
  • System.XML.XmlReader (managed)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM