Code::Blocks Forums

User forums => Help => Topic started by: Anonymous on July 10, 2005, 10:52:37 pm

Title: Xerces and code::blocks
Post by: Anonymous on July 10, 2005, 10:52:37 pm
Hello

I want to learn how to use the xerces parser and I downloaded a sample to try to compile it, using the files in the code::blocs dependencies.

What do I need more to compile using xerces?

Thank you.
Title: Xerces and code::blocks
Post by: mandrav on July 11, 2005, 12:22:31 am
Xerces needs quite a bit of hacking, to make it compile without the autoconf/automake tools.
At least the version I tried...

Yiannis.
Title: Xerces and code::blocks
Post by: Anonymous on July 11, 2005, 08:20:24 am
What is that?
Is there XML parser that you can easily use with Code::Blocks?
Thanks.
Title: Xerces and code::blocks
Post by: mandrav on July 11, 2005, 08:42:22 am
Quote from: Anonymous
What is that?
Is there XML parser that you can easily use with Code::Blocks?
Thanks.

Yes, TinyXML :lol:

It really depends what you 're after. Xerces is a full-fledged XML parser/validator/whatnot.
If you really *need* Xerces, I suppose I could make a diff for you with the changes I had to make to compile it in C::B.

Yiannis.
Title: Xerces and code::blocks
Post by: darklordsatan on July 11, 2005, 08:57:26 am
Likely, you need to be aware there are 2 kinds of ways to parse an XML file; DOM or SAX
DOM (Document Object Model) parsers usually create a "tree" in memory as they read the contents of the XML, thus, they are memory intensive. Then when the parsing is done, you can retrieve the data from the already present buffer (tree) in memory.
Sax (Simple API for XML) parsers work by means of callbacks, i.e you register event handlers, and then, as the XML is being read, your function gets called, so, you only use the required memory, and retrieve only the elements/attributes you need and not the whole XML tree.

TinyXML is a DOM parser. Xerces-C is both SAX and DOM, and its more complex but has more features.
Theres another good one I've used with mingw (so it should work flawlessly with code::blocks provided you use that compiler suite too) is expat, which follows a SAX approach

http://expat.sourceforge.net/
Title: Xerces and code::blocks
Post by: Anonymous on July 11, 2005, 02:43:22 pm
Thanks for the answer.
I'll try this expat .
I dont not need really the parser. I'm in pre stage of a little project and I'm going round possible tools to achieve things.
The project is tiny but I might go as well for a data base like mysql or interbase. If I really need xerces parser, I'll repost. Thanks for the offer.
Title: Xerces and code::blocks
Post by: mandrav on July 11, 2005, 02:56:32 pm
What I meant by really *needing* the parser, was that if you 're sure you need all this extra functionality.
We use TinyXML in Code::Blocks and it works like a charm. But then again we don't need anything bigger/fancier...

Yiannis.
Title: Xerces and code::blocks
Post by: per_eckerdal on July 11, 2005, 03:07:34 pm
Quote from: Anonymous
The project is tiny but I might go as well for a data base like mysql or interbase. If I really need xerces parser, I'll repost. Thanks for the offer.


If the project is small, I wouldn't go for huge projects as MySQL. I recommend a look at http://www.sqlite.org/. (If your app is server-based, MySQL *could* be useful, but normally it's simply to much hassle to install MySQL "just for this small app".. SQLite is also easier to set up and manage.)
/Per Eckerdal
Title: Xerces and code::blocks
Post by: David Perfors on July 11, 2005, 03:57:34 pm
there is also an wx port for sqlite, wxsqlite, don't know the link :)
Title: Xerces and code::blocks
Post by: per_eckerdal on July 11, 2005, 04:00:51 pm
http://wxsqlite.sourceforge.net/
(even though I hadn't heard of it before)
/Per Eckerdal
Title: Xerces and code::blocks
Post by: Anonymous on July 12, 2005, 11:22:22 pm
Works wonders, even though I was in pain for compiling but it is not nothing new here. I 'm really too bad at that.

I'm in writing a wrapper to perform the usual tasks, much more comfortable task for me.

Thanks for the piece of advice.