[Expat-discuss] XML Manipulation

devyani.sapre at wipro.com devyani.sapre at wipro.com
Thu Mar 16 10:40:16 CET 2006


There is an open source library in c called SIMPLE C EXPAT WRAPPER which
provides a DOM like interface and structure over expat

-----Original Message-----
From: expat-discuss-bounces at libexpat.org
[mailto:expat-discuss-bounces at libexpat.org] On Behalf Of Nick MacDonald
Sent: Wednesday, March 15, 2006 9:04 PM
To: Srinivas Cheruku
Cc: expat-discuss at libexpat.org
Subject: Re: [Expat-discuss] XML Manipulation

Note that eXpat is a SAX parser, which means it does not load the
entire XML document into memory, and you basically get to see the
document in one pass.  If you need to have the whole document in
memory for your processing, you'll probably want to look into another
type of XML processor, such as a DOM based one that loads the whole
XML document into memory, and provides the means to "walk" through it
in memory.

Assuming you can get by with the SAX limitations, there is some sample
code included with the eXpat package, but there will probably not be
enough there to get you near the finish line.  You will need to write
a bit of a state machine to track the incoming XML so that you know
when you have found the things you're looking for.   You'll probably
also need to use a stack data structure to know the "path" at any
given time as you are parsing your file.

Some day someone should write a sample program to translate an XML
file and include it with the basic eXpat package as an example...  if
such a thing were to be done that would be exactly where you'd want to
start.

Good luck,
  Nick


On 3/15/06, Srinivas Cheruku <srinivas.cheruku at gmail.com> wrote:
> I understand that expat is used for XML Parsing.
>
> I need to manipulate the XML data read from a xml file by changing
certain node values.
> Can i use expat for this type of XML manipulation?
> If so, can anyone direct me to the sample code for XML manipulation?
_______________________________________________
Expat-discuss mailing list
Expat-discuss at libexpat.org
http://mail.libexpat.org/mailman/listinfo/expat-discuss


The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com


More information about the Expat-discuss mailing list