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
--
Thomas Lecomte de**********@gmail.com Solaris User & Developer http://blog.hinyx.info - http://guses.org - http://www.sunwizard.net 9 3817
Thomas Lecomte wrote:
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
--
Thomas Lecomte de**********@gmail.com Solaris User & Developer http://blog.hinyx.info - http://guses.org - http://www.sunwizard.net
you may use XERCES by apache(xml parser for c++)
Thomas Lecomte wrote:
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.
--
Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
On Wed, 06 Sep 2006 06:01:56 +0000, Phlip wrote:
Thomas Lecomte wrote:
>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.
Thanks for the answers.
Forgive me about the clone message, I had some problems with my client.
Thanks!
Thomas
--
Thomas Lecomte de**********@gmail.com Solaris User & Developer http://blog.hinyx.info - http://guses.org - http://www.sunwizard.net
Phlip wrote :
XML was designed to be light
You probably missed most of XML's design.
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.
Thomas Lecomte wrote:
Is there any efficient library to do this?
If you want efficiency you shouldn't be using xml.
loufoque wrote:
Phlip wrote :
>XML was designed to be light
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??
--
Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Noah Roberts wrote:
Thomas Lecomte wrote:
>Is there any efficient library to do this?
If you want efficiency you shouldn't be using xml.
Premature Optimization takes many forms, Noah.
--
Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
On Wed, 06 Sep 2006 16:54:24 +0200, loufoque wrote:
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.
Thanks for pointing me out this interesting project.
I'll give it a try. Seems well-documented.
Thomas
--
Thomas Lecomte de**********@gmail.com Solaris User & Developer http://blog.hinyx.info - http://guses.org - http://www.sunwizard.net This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Tina Li |
last post by:
Hello,
I've been struggling with a regular expression for parsing XML files, which keeps giving the run time error "maximum
recursion limit exceeded". Here is the pattern string:
...
|
by: Sridhar R |
last post by:
I am looking for a class browser that has these features.
1. Given a symbol (class, method or function) it should giveback
the lineno n source code
2. It should be efficient and quick.
I...
|
by: Eirik WS |
last post by:
Is there a more efficient way of comparing a string to different words?
I'm doing it this way:
if(strcmp(farge, "kvit") == 0)
peikar_til_glas_struktur->farge = KVIT;
if(strcmp(farge, "raud") ==...
|
by: Beren |
last post by:
Hello,
Can anyone give some tips to efficiently update a remote project ?
I prefer to keep my projects locally, compile as release and then copy
everything it to the remote server.
What is...
|
by: laredotornado |
last post by:
Hi, I'm using PHP 4.3. I have 15 pages in which I need to take the
content of the BODY and put it in a little table ...
<table>
<tr><td colspan="3"><img src="header.gif"></td></tr>
<tr>...
|
by: Bill nguyen |
last post by:
I'm looking for a good routine to parse the following text pattern:
a:18: {i:0;i:408;i:1;i:409;i:2;i:410;i:3;i:411;i:4;i:413;i:5;i:414;}
a: = page_id
a:18 -page_id = 18
Those within curly...
|
by: Chris Carlen |
last post by:
Hi:
Having completed enough serial driver code for a TMS320F2812
microcontroller to talk to a terminal, I am now trying different
approaches to command interpretation.
I have a very simple...
|
by: cokofreedom |
last post by:
I've written up a little piece of code that isn't that foolproof to
scan through a file (java presently) to find functions and then look
for them throughout the document and output the name of the...
|
by: Tom |
last post by:
I am trying to update another developers code, and am stuck in a
cludge.
It works like this:
A user uploads a file from the web page. Our code reads from a
NetworkStream to a Filestream, and...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |