Need Help to parse the XML and extract the specified tag value..in C++

Dear Sir,

I have a XML file like this below in test.xml file

test.xml contains the content like this.

<?xml version="1.0" encoding="UTF-8"?>
<presence xmlns="urn:ietf:params:xml:ns:pidf"
xmlns:gp="urn:ietf:params:xml:ns:pidf:geopriv10"
xmlns:cl=" urn:ietf:params:xml:ns:pidf:geopriv10:civicLoc"
entity="pres:geotarget@example.com">
<tuple id="sg89ae">
<status>
<gp:geopriv>
<gp:location-info>
<cl:civicAddress>
<cl:country>US</cl:country>
<cl:A1>New York</cl:A1>
<cl:A3>New York</cl:A3>
<cl:A6>Broadway</cl:A6>
<cl:HNO>123</cl:HNO>
<cl:LOC>Suite 75</cl:LOC>
<cl:PC>10027-0401</cl:PC>
</cl:civicAddress>
</gp:location-info>
<gp:usage-rules>
<gp:retransmission-allowed>yes</gp:retransmission-allowed>
<gp:retention-expiry>2003-06-23T04:57:29Z</gp:retention-expiry>
</gp:usage-rules>
</gp:geopriv>
</status>
<timestamp>2003-06-22T20:57:29Z</timestamp>
</tuple>
</presence>

I need to validate and parse the whole test.xml file which is given as input and i
need the output as

Country = US;
A1 = New York
A3 = New York
A6 = Broadway
HNO = 123
LOC = Suite 75
PC = 10027-0401

on the Screen /or log in to the text file.
In the Above requirement A1 Specifies national, A3 Specifies City, A6 Speicifies Street,
HNO Specifies House Number, LOC specifies Additional location Information, PC Specifies
Postal code.
Am using xerces 2.8 version and i need the logic/code, how to validate & parse and extract the specified tag value contents and i need the logic/code using SAX2 in c++.

Anyone have the idea or the information....or suggestions...please let me know...

Am not able to proceed while in coding.....
please do the needfull...at the earliest....


Thanks & Regards,
--Raj.
Topic archived. No new replies allowed.