Sign in to follow this  

Reading an XML File

This topic is 2488 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:

[code]
<?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>
[/code]


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
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 [i]have [/i]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

This topic is 2488 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this