RPGDXThe center of Indie-RPG gaming
Not logged in. [log in] [register]
 
 
Post new topic Reply to topic  
View previous topic - View next topic  
Author Message
DeveloperX
202192397


Joined: 04 May 2003
Posts: 1626
Location: Decatur, IL, USA

PostPosted: Thu Aug 17, 2006 8:23 am    Post subject: parsing xml....... [quote]

if anyone here has already figured this out, I would severely appreciate the assistance.

I have an xml file that I'd like to parse using c++

the format of my file is such as this:
Code:

<type>
 <element a="string data" b="765" c="4,4,4" />
</type>


I've found some java code to parse tags, but theres no support for attributes, nor self-closed tags. like <foo />

If you would please help me off in the right direction...it would be great. thanks in advance.
_________________
Principal Software Architect
Rambling Indie Games, LLC

See my professional portfolio
Back to top  
Ninkazu
Demon Hunter


Joined: 08 Aug 2002
Posts: 945
Location: Location:

PostPosted: Thu Aug 17, 2006 12:12 pm    Post subject: [quote]

http://www.libxml.org/
Bam.
Back to top  
LeoDraco
Demon Hunter


Joined: 24 Jun 2003
Posts: 584
Location: Riverside, South Cali

PostPosted: Thu Aug 17, 2006 5:12 pm    Post subject: [quote]

There is also libxml++, which is a very nice OO wrapper around libxml2 (in my opinion, it makes using libxml a lot easier). You could also probably hack something together using either boost::serialization (possible, but probably difficult to do for what you want) or boost::spirit. There are also a number of XML parsers (both SAX and DOM) written on top of Spirit, so you could probably snag one of those.
_________________
"...LeoDraco is a pompus git..." -- Mandrake
Back to top  
DeveloperX
202192397


Joined: 04 May 2003
Posts: 1626
Location: Decatur, IL, USA

PostPosted: Sat Aug 19, 2006 7:30 pm    Post subject: [quote]

this is going to sound dumb.......

but I cannot seem to find the required files to download for libxml
nor libxml++

could someone post the direct links to the files I would need?
please?

I don't want to sound lazy, cause I'm not. I'm just confused cause I'm used to "download this and use" type of third paty sources.

libxml seems to have tons of little sections that each have dependencies...I'm clueless.

Please, if someone would kindly take the time to give me a headstart on this, it would be great.
many thanks in advance.
_________________
Principal Software Architect
Rambling Indie Games, LLC

See my professional portfolio
Back to top  
Nodtveidt
Demon Hunter


Joined: 11 Nov 2002
Posts: 786
Location: Camuy, PR

PostPosted: Sat Aug 19, 2006 11:08 pm    Post subject: [quote]

Welcome to the wonderful world of mismanaged open source projects.
_________________
If you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows. - wallace
Back to top  
DeveloperX
202192397


Joined: 04 May 2003
Posts: 1626
Location: Decatur, IL, USA

PostPosted: Sun Aug 20, 2006 5:55 am    Post subject: [quote]

nodtveidt wrote:
Welcome to the wonderful world of mismanaged open source projects.

bleh. still haven't gotten it figured out yet.......
_________________
Principal Software Architect
Rambling Indie Games, LLC

See my professional portfolio
Back to top  
LeoDraco
Demon Hunter


Joined: 24 Jun 2003
Posts: 584
Location: Riverside, South Cali

PostPosted: Sun Aug 20, 2006 8:22 am    Post subject: [quote]

The latest version of libxml++ (which is 2.14) can be found here (which really wasn't that difficult to find; it was linked to off of the website I linked against). Although, you probably will run into problems, if you are doing something on Windows, as the library does make use of some GNOME functionality. (Heh, I forgot about this when I posted.)

As for libxml2: if you were using a proper development environment, you could probably just squeeze by by asking your package manager to install libxml2 for you. (E.g., in the Fedora Core's, you would just need to run, "yum install libxml2", and it would go about the process of downloading and installing all of the dependencies for you.) However, if you are developing under a bad development environment, as linked to off of libxml's download page, the location for the binaries should be here, although the server appears to be down, at the moment.
_________________
"...LeoDraco is a pompus git..." -- Mandrake
Back to top  
zenogais
Slightly Deformed Faerie Princess


Joined: 10 Jan 2006
Posts: 34

PostPosted: Sun Aug 20, 2006 9:06 pm    Post subject: [quote]

If you'd like another alternative library, I personally use TinyXML. It's the simplest library I've found for parsing XML in C++, and I've used it on several different projects quite successfully.
Back to top  
RedSlash
Mage


Joined: 12 May 2005
Posts: 331

PostPosted: Tue Aug 22, 2006 1:40 am    Post subject: [quote]

I've used TinyXML and I agree its much more simpler than libxml, thought libxml is more full featured.
Back to top  
DeveloperX
202192397


Joined: 04 May 2003
Posts: 1626
Location: Decatur, IL, USA

PostPosted: Wed Aug 23, 2006 7:24 pm    Post subject: [quote]

bleh....tinyxml is quite confusing.....

hrm, perhaps I will just roll my own routines to parse this crap..
or maybe try a different format altogether.
thanks guys for your help.
_________________
Principal Software Architect
Rambling Indie Games, LLC

See my professional portfolio
Back to top  
Post new topic Reply to topic Page 1 of 1 All times are GMT
 



Display posts from previous:   
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum