Query regarding XML Parser
<[email protected]> Fri, 26 May 2006 15:56:55 +0530 (IST)
| Newsgroups | gmane.comp.lib.libwww |
|---|---|
| Message-ID | <[email protected]> |
-------af782cd69014266d6716e6e10e983ec0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding:7bit
Hi friends,
I am working in C on Linux Fedora Core. My problem
is very simple. But I really need you help. I want
to convert an XML file into plaintext format. e.g; I
have following contents in XML file :
<?xml version="1.0" encoding="utf-8"
standalone="no"?>
<!DOCTYPE persons SYSTEM
"http://mail.persistent.co.in/v1/addrbook.dtd">
<persons count="13">
<person
ref="6024732a-1c38-102a-922a-0007e9315819">
<cn>Satish Agrawal</cn>
<category unfiled="yes">3</category>
<primaryphone>telephonenumber</primaryphone>
<uuid>6024732a-1c38-102a-922a-0007e9315819</uuid>
<lastmodtime>20060118T063535Z</lastmodtime>
<surname>Agrawal</surname>
<givenname>Satish</givenname>
<mail>[email protected]</mail>
<telephonenumber primary="yes"/>
<nickname>satish</nickname>
<displayname>Satish Agrawal</displayname>
</person>
<person
ref="0dbb27fa-20ed-102a-9922-0007e9315819">
<cn>Rahul Patil</cn>
<category unfiled="yes">3</category>
<primaryphone>telephonenumber</primaryphone>
<uuid>0dbb27fa-20ed-102a-9922-0007e9315819</uuid>
<lastmodtime>20060124T061900Z</lastmodtime>
<surname>Patil</surname>
<givenname>Rahul</givenname>
<mail>[email protected]</mail>
<telephonenumber primary="yes"/>
<nickname>rahul</nickname>
<displayname>Rahul Patil</displayname>
</person>
<person
ref="d141cc6e-20fd-102a-8307-0007e9315819">
<cn>Milind Limaye</cn>
<category unfiled="yes">3</category>
<primaryphone>telephonenumber</primaryphone>
<uuid>d141cc6e-20fd-102a-8307-0007e9315819</uuid>
<lastmodtime>20060124T081900Z</lastmodtime>
<surname>Limaye</surname>
<givenname>Milind</givenname>
<mail>[email protected]</mail>
<telephonenumber primary="yes"/>
<nickname>milind</nickname>
<displayname>Milind Limaye</displayname>
</person>
<person
ref="b620b9c4-2669-102a-929b-0007e9315819">
<cn>prerana</cn>
<category>2</category>
<primaryphone>telephonenumber</primaryphone>
<uuid>b620b9c4-2669-102a-929b-0007e9315819</uuid>
<lastmodtime>20060131T055356Z</lastmodtime>
<surname>khare</surname>
<givenname>prerana</givenname>
<mail>[email protected]</mail>
<telephonenumber primary="yes"/>
<nickname>prerana</nickname>
<displayname>prerana</displayname>
</person>
</persons>
And I want the outputs in following format (For each
record ) :
Person 1:
Name : Satish Agrawal
Surname : Agrawal
UUID : 6024732a-1c38-102a-922a-0007e9315819
E mail : [email protected]
and so on ...
Please suggest me what should I use. I have tried
libwww and libxml libraries, but could not find
much. Please guide.
Thanks.
DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Pvt. Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Pvt. Ltd. does not accept any liability for virus infected mails.
-------af782cd69014266d6716e6e10e983ec0
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding:7bit
<HTML><BODY>Hi friends,<br>
I am working in C on Linux Fedora Core. My problem is very simple. But
I really need you help. I want to convert an XML file into plaintext
format. e.g; I have following contents in XML file :<br>
<br>
<?xml version="1.0" encoding="utf-8" standalone="no"?><br>
<!DOCTYPE persons SYSTEM "http://mail.persistent.co.in/v1/addrbook.dtd"><br>
<persons count="13"><br>
<person ref="6024732a-1c38-102a-922a-0007e9315819"><br>
<cn>Satish Agrawal</cn><br>
<category unfiled="yes">3</category><br>
<primaryphone>telephonenumber</primaryphone><br>
<uuid>6024732a-1c38-102a-922a-0007e9315819</uuid><br>
<lastmodtime>20060118T063535Z</lastmodtime><br>
<surname>Agrawal</surname><br>
<givenname>Satish</givenname><br>
<mail>[email protected]</mail><br>
<telephonenumber primary="yes"/><br>
<nickname>satish</nickname><br>
<displayname>Satish Agrawal</displayname><br>
</person><br>
<person ref="0dbb27fa-20ed-102a-9922-0007e9315819"><br>
<cn>Rahul Patil</cn><br>
<category unfiled="yes">3</category><br>
<primaryphone>telephonenumber</primaryphone><br>
<uuid>0dbb27fa-20ed-102a-9922-0007e9315819</uuid><br>
<lastmodtime>20060124T061900Z</lastmodtime><br>
<surname>Patil</surname><br>
<givenname>Rahul</givenname><br>
<mail>[email protected]</mail><br>
<telephonenumber primary="yes"/><br>
<nickname>rahul</nickname><br>
<displayname>Rahul Patil</displayname><br>
</person><br>
<person ref="d141cc6e-20fd-102a-8307-0007e9315819"><br>
<cn>Milind Limaye</cn><br>
<category unfiled="yes">3</category><br>
<primaryphone>telephonenumber</primaryphone><br>
<uuid>d141cc6e-20fd-102a-8307-0007e9315819</uuid><br>
<lastmodtime>20060124T081900Z</lastmodtime><br>
<surname>Limaye</surname><br>
<givenname>Milind</givenname><br>
<mail>[email protected]</mail><br>
<telephonenumber primary="yes"/><br>
<nickname>milind</nickname><br>
<displayname>Milind Limaye</displayname><br>
</person><br>
<person ref="b620b9c4-2669-102a-929b-0007e9315819"><br>
<cn>prerana</cn><br>
<category>2</category><br>
<primaryphone>telephonenumber</primaryphone><br>
<uuid>b620b9c4-2669-102a-929b-0007e9315819</uuid><br>
<lastmodtime>20060131T055356Z</lastmodtime><br>
<surname>khare</surname><br>
<givenname>prerana</givenname><br>
<mail>[email protected]</mail><br>
<telephonenumber primary="yes"/><br>
<nickname>prerana</nickname><br>
<displayname>prerana</displayname><br>
</person><br>
</persons><br>
And I want the outputs in following format (For each record ) :<br>
<br>
Person 1:<br>
Name : Satish Agrawal<br>
Surname : Agrawal<br>
UUID : 6024732a-1c38-102a-922a-0007e9315819<br>
E mail : [email protected]<br>
<br>
and so on ...<br>
<br>
Please suggest me what should I use. I have tried libwww and libxml libraries, but could not find much. Please guide.<br>
Thanks.DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Pvt. Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Pvt. Ltd. does not accept any liability for virus infected mails.</BODY></HTML>
-------af782cd69014266d6716e6e10e983ec0--