User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 426,331 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,431 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser: Programming Forums
Views: 1141 | Replies: 1
Join Date: Mar 2006
Posts: 8
Reputation: neeludhiman is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
neeludhiman neeludhiman is offline Offline
Newbie Poster

Question XML to Text file

  #1  
May 26th, 2006
Hi friends,
I am working in C on Linux Fedora Core. I need you help regarding XML Parser in C. 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>satishgrawal@persistent.co.in</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>rahulptil@persistent.co.in</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>milindaye@persistent.co.in</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>preranhare@persistent.co.in</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 : satishgrwal@persistent.co.in

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.
Last edited by Dave Sinkula : May 26th, 2006 at 10:44 am.
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C Forum

All times are GMT -4. The time now is 11:16 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC