Xml.h contains the following members among all the
other required. 

##Xml.h
virtual void writeChars(const XMLByte* const toWrite);

virtual void writeChars(const XMLByte* const toWrite,
const unsigned int count, XMLFormatter* const
formatter);

###Xml.cpp #####

 void Xml::writeChars(const XMLByte* const toWrite)
 {

 }

 void Xml::writeChars(const XMLByte* const toWrite,
const unsigned int count, XMLFormatter* const
formatter)
 {
   XERCES_STD_QUALIFIER cout.write((char *) toWrite,
(int) count);
   XERCES_STD_QUALIFIER cout.flush();

 }

I know is not that easy without the code but i can
send it to someone as i should compile normaly with
xerces-26. I have spent a lot on that so any help
would be helpfull. ..!!! 




 --- Stefan A Letz <[EMAIL PROTECTED]> a écrit : 
> 
> 
> 
> 
> Hello David,
> 
> are you changing something else along with
> commenting out the public
> XMLFormatTarget interface?
> 
> It looks like you're trying construct an
> XMLFormatter object in Xml::Xml()
> using the private default constructor. I would guess
> class Xml has a member
> variable of type XMLFormatter that isn't being
> initialized properly, e.g.
> 
> Xml::Xml(...)
> : mFormatter("UTF-8", 0, this,
> XMLFormatter::NoEscapes,
> XMLFormatter::UnRep_CharRef)
> {
> } .
> 
> Stefan Letz.
> 
> 
> 
> 
> 
> 
>                                                     
>                   
>              David ---                              
>                   
>              <[EMAIL PROTECTED]                      
>                   
>              fr>                                    
>                    To
>                                                     
>                   
>              01/21/2005 11:18         
> xerces-c-dev@xml.apache.org     
>              AM                                     
>                    cc
>                                                     
>                   
>                                                     
>                   
>              Please respond to                      
>                   
>                xerces-c-dev                         
>                   
>                                                     
>                   
>                                                     
>               Subject
>                                       
> Xml::Formatter help need        
>                                                     
>                   
>                                                     
>                   
>                                                     
>                   
>                                                     
>                   
>                                                     
>                   
>                                                     
>                   
> 
> 
> 
> 
> Hello,
> I have written a sax parser that implements
> xerces-c.
> if i declare in my Xml.h the public XMLFormatTarget
> i
> get can't compile (see error below).
> However if i compile but don't implement in the
> class
> the XMLFormatTarget it compiles and works properly.
> 
> Does anybody know what is the problem ???
> 
> thanks
> 
> [XmlXercesFactory]# make clean all
> rm -f *.o *~ SaxParsing_classtest        *.a  *core*
> *.xml *.xml_parsed
> g++ -g -w -O2 -L/usr/local/lib XmlFactory.cpp -c -o
> XmlFactory.o
> g++ -g -w -O2 -L/usr/local/lib  SaxParser.cpp -c -o
> SaxParser.o
> g++ -g -w -O2 -L/usr/local/lib DomParser.cpp -c -o
> DomParser.o
> g++ -g -w -O2 -L/usr/local/lib Xml.cpp -c -o Xml.o
>
/usr/local/include/xercesc/framework/XMLFormatter.hpp:
> In constructor `Xml::Xml()':
>
/usr/local/include/xercesc/framework/XMLFormatter.hpp:412:
> error: `xercesc_2_6::XMLFormatter::XMLFormatter()'
> is
> private
> Xml.cpp:5: error: within this context
> make: *** [Xml.o] Error 1
> 
> I have different files show below:
> 
> ***********
> XMLFactory.h
> ***********
> #include "Xml.h"
> #include "DomParser.h"
> #include "SaxParser.h"
> 
> class XmlFactory {
> 
>  public:
> 
>     XmlFactory(std::string v,bool d, bool n, bool s,
> bool fs, std::string e);
>     /*
>  * Sets the appropiate xml parser defined by user
>  * 2 possiblities:
>  * Dom: Domparser works with a copy in memory of the
> file
>  * Sax: reads the xmlfile without keeping anything
> in
> memory*/
> 
>   Xml* setParser(std::string type);
> 
>   virtual ~XmlFactory();
> // -----------------------------
> 
> ##############################
> Xml.h
> ##############################
> #ifndef XML_H
> #define XML_H
> 
> #ifndef XERCES_CPP_NAMESPACE_USE
> #define XERCES_CPP_NAMESPACE_USE
> #endif
> 
> //Std libs
> #include <iostream>
> #include <string>
> #include <vector>
> 
> //Required for XmlParsing
> #include <xercesc/parsers/XercesDOMParser.hpp>
> #include <xercesc/parsers/SAXParser.hpp>
> #include <xercesc/dom/DOM.hpp>
> #include <xercesc/util/XMLString.hpp>
> #include <xercesc/util/PlatformUtils.hpp>
> #include <xercesc/framework/XMLPScanToken.hpp>
> #include <xercesc/util/XMLUniDefs.hpp>
> #include <xercesc/util/XMLUni.hpp>
> #include <xercesc/sax/AttributeList.hpp>
> #include <xercesc/sax2/SAX2XMLReader.hpp>
> #include <xercesc/sax2/XMLReaderFactory.hpp>
> #include <xercesc/sax2/DefaultHandler.hpp>
> #include <xercesc/sax2/Attributes.hpp>
> #include <xercesc/util/XMLChTranscoder.hpp>
> #include <xercesc/framework/XMLFormatter.hpp>
> #include <xercesc/util/XMemory.hpp>
> #include <xercesc/util/OutOfMemoryException.hpp>
> #include <xercesc/util/TransService.hpp>
> 
> #include "Transcode.h"
> 
> 
> #This declaration of the class doesn't work
> class Xml : public DefaultHandler, public
> XMLFormatTarget {
> 
> //The declaration below works
>   //class Xml : public DefaultHandler {
>  public:
> 
> /*
>  * Constructor
>  */
>     /*XmlParser(XercesDOMParser *parser) ;*/
>     Xml();
>     virtual ~Xml();
> ......
> override xerces functions here....
> ....
> #############################################
> SaxParser.h
> ############################################
> SaxParser::SaxParser(std::string v,bool d, bool n,
> bool s, bool fs, std::string e)
> {
> 
> 
>    std::cout << "Trying to instantiate SAXParser" <<
> 
=== message truncated === 


        

        
                
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! 
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to