LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-21-2009, 05:15 PM   #1
amitpardesi
LQ Newbie
 
Registered: Aug 2007
Posts: 13

Rep: Reputation: 0
Question XML parsing using DOM & Xerces on C++


Hi,

We developing a product where we are reading an tchar *buffer which is in XML format. The XML is a nested XML tree. I need to traverse this XML recursively to create various required obj from the XML string.

I am using XercesC 2.8 for the same. I am able to pare & fetch simple XML tree and create back the XML buf from the object info. For eg. from the below mentioned XML I can create an Object of class CHouse & vice-a-versa
<Root>
<HouseInfo>
<HouseOwner>Amit P</HouseOwner>
<HouseNo>34</HouseNo>
<HouseStreet>ABC Hw</HouseStreet>
<HouseAdd1>asjas asf</HouseAdd1>
</HouseInfo>
</Root>

But when the XML complicates like:
<Root>
<City>
<Area1>
<HouseInfo>
<HouseOwner>Amit P</HouseOwner>
<HouseNo>34</HouseNo>
<HouseStreet>ABC Hw</HouseStreet>
</HouseInfo>
<HouseInfo>
<HouseOwner>Tom H</HouseOwner>
<HouseNo>4G</HouseNo>
<HouseStreet>VHA NHw</HouseStreet>
</HouseInfo>
</Area1>
<Area2>
...
</Area2>
</City>
<Feature>
...
</Feature>
</Root>

How do I parse it using Xerces. I am facing problem when I try to get the inner XML, say I hot the node of Tag "City", then there are two Tags by the name "Area1" & "Area2" which are to be converted into Object of some class.

If anyone has worked on XercesC please help me.

Any pointers on this would be appreciated. I have searched a lot on web, but could not find any thing relevant. Even the smaples of Xerces are of no help

Plzz Help!!!

Regards,
Amit
 
  


Reply

Tags
parsing, xml



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting attribute using xerces DOM in java mohtasham1983 Programming 1 10-27-2007 09:58 PM
C++ XML DOM parser? pembo13 Programming 1 02-05-2006 03:16 PM
errors building xerces xml parser on SLES 9 (i586) nkshirsagar SUSE / openSUSE 0 05-02-2005 08:12 AM
anyone familiar with the xerces xml parser used by apache? zovres Programming 0 03-16-2004 11:58 AM
Xerces, Xalan -- XML + XSL = HTML marktaff Linux - Software 1 10-15-2002 10:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration