Efficient XML parsing

T

Thomas Lecomte

Hello,

I'm working on a project and I need to parse an XML file containing the
description of a lot of images.
Here's an example of the XML data:

<db_name>
<picture>
<pic_id>2033</pid_id>
<pic_name>foo</pic_name>
...
</picture>
</db_name>

What I'd like to do is to store each images as a C++ object, for example:

class Image
{
int pic_id;
std::string pic_name;


...
};

Is there any efficient library to do this? Or must I do it all myself
using libxml?

By the way I hope i'm posting in the right newsgroup...

Thanks,

Thomas
 
A

al pacino

Thomas said:
Hello,

I'm working on a project and I need to parse an XML file containing the
description of a lot of images.
Here's an example of the XML data:

<db_name>
<picture>
<pic_id>2033</pid_id>
<pic_name>foo</pic_name>
...
</picture>
</db_name>

What I'd like to do is to store each images as a C++ object, for example:

class Image
{
int pic_id;
std::string pic_name;


...
};

Is there any efficient library to do this? Or must I do it all myself
using libxml?

By the way I hope i'm posting in the right newsgroup...

Thanks,

Thomas

you may use XERCES by apache(xml parser for c++)
 
P

Phlip

Thomas said:
Is there any efficient library to do this? Or must I do it all myself
using libxml?

Just get tinyxml, and use it until you need a high-end parser. You probably
won't.

XML was designed to be light, so use it lightly.
 
T

Thomas Lecomte

Just get tinyxml, and use it until you need a high-end parser. You probably
won't.

XML was designed to be light, so use it lightly.

Thanks for the answers.
Forgive me about the clone message, I had some problems with my client.
Thanks!

Thomas
 
L

loufoque

Thomas Lecomte wrote :
Is there any efficient library to do this? Or must I do it all myself
using libxml?

It would be smarter to use libxml++, libxml2's C++ wrapper.
 
P

Phlip

loufoque said:
Phlip wrote :


You probably missed most of XML's design.

You snipped the half of my sentence that balanced it, then complained my
sentence was unbalanced.

I have seen people, on 'net forums, snip answering paragraphs and then claim
a question was not answered. But half a sentence??
 
T

Thomas Lecomte

Thomas Lecomte wrote :


It would be smarter to use libxml++, libxml2's C++ wrapper.

Thanks for pointing me out this interesting project.
I'll give it a try. Seems well-documented.

Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,270
Latest member
TopCryptoTwitterChannels_

Latest Threads

Top