Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 11th, 2008, 10:52 AM   #1
Soulstorm
Hobbyist Programmer
 
Soulstorm's Avatar
 
Join Date: Jan 2006
Location: Menidi, Athens, Greece
Posts: 233
Rep Power: 3 Soulstorm is on a distinguished road
Building a simple XML Parser

I want to build a simple XML parser using C++. At first, I don't mind about DTD declarations or special features. I want to be able to load an XML string and then output the code in a simple tree holding strings (the values of the XML document)

But the problem is that although I know all about XML, I haven't got the slightest idea about how to make an XML parser (or any other parser of the same logic). I believe a recursive descent parser is sufficient.

Can anyone point me into the right direction? All I want is a general idea, like the way I will organize my classes, what STL classes would prove useful... A general documentation upon parsers would also be helpful (google should work, but I always find better answers in forums).
__________________
Project::Soulstorm (personal homepage)
Soulstorm is offline   Reply With Quote
Old Feb 11th, 2008, 3:59 PM   #2
Game_Ender
Professional Programmer
 
Game_Ender's Avatar
 
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3 Game_Ender is on a distinguished road
Re: Building a simple XML Parser

I would be a good book on parsing. One way to do that is to check out some good universities and see which book they use for their classes which cover the subject. (Sorry I don't know one of the top of my head)
__________________
Robotics @ Maryland AUV Team - Software Lead
Game_Ender is offline   Reply With Quote
Old Feb 12th, 2008, 2:45 AM   #3
Soulstorm
Hobbyist Programmer
 
Soulstorm's Avatar
 
Join Date: Jan 2006
Location: Menidi, Athens, Greece
Posts: 233
Rep Power: 3 Soulstorm is on a distinguished road
Re: Building a simple XML Parser

I tried Xerces xml parser, but it has faults all over it. Namely, it includes files of the project using <this.h> and not "that.h". That was enough to give me hundreds of errors in XCode. And building it is next to impossible. Even the sample XCode project produces a framework which doesn't work, for this reason!

Maybe you know any ready cross-platform XML parser?
__________________
Project::Soulstorm (personal homepage)
Soulstorm is offline   Reply With Quote
Old Feb 15th, 2008, 8:41 AM   #4
Game_Ender
Professional Programmer
 
Game_Ender's Avatar
 
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3 Game_Ender is on a distinguished road
Re: Building a simple XML Parser

If that's all you wanted: TinyXML is your best bet for a quick solution. It is a DOM based parser, so it loads the entire file into memory upon parsing. The XML is basically turned into a tree which you can navigate. This means you really don't want to use if you have to process hundreds of megs of XML, but for many uses TinyXML is prefect.

EDIT: I am just a little floored, TinyXML is written by Lee Thomason, the "Programmer and technical lead for the Flash Player".
__________________
Robotics @ Maryland AUV Team - Software Lead
Game_Ender is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
pyparsing - Python parser library ptmcg Show Off Your Open Source Projects 0 Feb 11th, 2008 8:50 AM
Help Parsing 1.2 Gig XML File fahlyn Java 9 Jan 17th, 2008 6:09 PM
writing a parser in c++ programmingnoob C++ 47 Jul 24th, 2006 3:28 AM
SGML parser printf PHP 1 Oct 17th, 2005 4:52 PM
Simple Function Questions meverha1 C++ 16 Sep 12th, 2005 1:25 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:23 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC