[Expat-discuss] expat in C++

Gururajan, Subhashini (Cognizant) GSubhash at chn.cognizant.com
Fri May 23 15:28:43 EDT 2003


Thanks a lot it worked.

-----Original Message-----
From: allan.saywitz at pb.com [mailto:allan.saywitz at pb.com]
Sent: Wednesday, May 21, 2003 7:23 PM
To: Gururajan, Subhashini (Cognizant)
Cc: expat-discuss at libexpat.org
Subject: Re: [Expat-discuss] expat in C++






There are lots of c++ wrappers for expat on the web, just do a google
search on expat C++ Wrapper.  Here is two:

http://www.codeproject.com/soap/expatimpl.asp
http://www.oofile.com.au/xml/expatpp.html

I actually wrote my own since we are doing c++ for vse if you can belive
that!  Using inheritance worked well for me.  I wrote a c++ expat wrapper
to be used as a base class.  This base class has virtual functions for all
the different events I want to respond to.  So now all I have to do is
inherit from my base class and voila, I have a c++ class that reads xml and
functions for handling start tag, end tag, char data, etc...

Expat is so cool you can easily write all kinds of wrapper classes to fit
your needs!

Here is some sample code.

thanks

allan

(See attached file: XMLExpatParser.h)(See attached file:
XMLExpatParser.cpp)





                                                                                                                                             
                      "Gururajan, Subhashini                                                                                                 
                      (Cognizant)"                   To:       <expat-discuss at libexpat.org>                                                  
                      <GSubhash at chn.cognizant        cc:                                                                                     
                      .com>                          Subject:  [Expat-discuss] expat in C++                                                  
                      Sent by:                                                                                                               
                      expat-discuss-bounces at l                                                                                                
                      ibexpat.org                                                                                                            
                                                                                                                                             
                                                                                                                                             
                      05/21/2003 12:30 AM                                                                                                    
                                                                                                                                             
                                                                                                                                             




Hi,
I want to use expat for my C++ implementation. My objective is just to
parse the XML file.
The start, end and character data handlers are implemented as methods of a
class. Now, I cant use the expat directly as, the function pointer forces
me to include the class name while declaring.
So, the start handler declaration in expat.h should include the class name
where the start handler is actually implemented. How do I tackle this.
Please help me out.

Thanks & Regards,

SUBHASHINI

(See attached file: InterScan_Disclaimer.txt)
_______________________________________________
Expat-discuss mailing list
Expat-discuss at libexpat.org
http://mail.libexpat.org/mailman/listinfo/expat-discuss

-------------- next part --------------
This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. 
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly 
prohibited and may be unlawful.

		Visit us at http://www.cognizant.com


More information about the Expat-discuss mailing list