Jump to content
  • Advertisement
Sign in to follow this  
ratha

Reading an XML File

This topic is 2676 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi!
My XML file contains the following:


<?xml version="1.0" encoding="UTF-8"?>
<download>
<English>
<Updated_date>16/11/2010</Updated_date>
<Filename>Update_Eng</Filename>
</English>
<Updateexe>
<Updated_date>16/11/2010</Updated_date>
<Filename>Update</Filename>
</Updateexe>
</download>



I've to read from the program(C++/CLI), the value of the tag <Updated_date> which is inside

the tag <Updateexe>. How to do this in C++/CLI?

Share this post


Link to post
Share on other sites
Advertisement
can you use System.Xml.Linq library?

if you can then its simple.

in c# it is
XDocument xdoc = XDocument.Load( uri );
xdoc.Root.Element("tagname"). etc

in C++ i guess it is

System::Xml::Linq::XDocument xdoc = System::Xml::Linq::XDocument->Load(uri);
xdoc->Root->Element("tagname")-> etc

Share this post


Link to post
Share on other sites
It depends on your options. Do you have to do this with your own code. If not there are plenty of XML parsers for C/C++, such as RapidXML and TinyXML that are very simple,fast and easy to integrate.

Edit: Code above is viable as well :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!