jasons      2002/08/27 12:49:36

  Modified:    perl     Xerces.i
  Log:
        * Xerces.i (Repository):
        DOM_ => DOM
        DOMParser => XercesDOMParser
        added AbstractDOMParser base class
        added some debug variables to help with unicode
        added sax2/DeclHandler.hpp
        added classes for DOMWriter
        ignore the char* versions of Parser
        ignore const versions of XercesDOMParser
        added base class Parser
        made new SAXEXCEPTION macro to avoid copied code
        Don't need operator== and operator!=??
        error handlers needed to go to the end of the file??
        added transcoder init code
  
  Revision  Changes    Path
  1.22      +244 -213  xml-xerces/perl/Xerces.i
  
  Index: Xerces.i
  ===================================================================
  RCS file: /home/cvs/xml-xerces/perl/Xerces.i,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- Xerces.i  25 Apr 2002 06:04:11 -0000      1.21
  +++ Xerces.i  27 Aug 2002 19:49:35 -0000      1.22
  @@ -1,4 +1,5 @@
  -%module Xerces
  +%module "XML::Xerces"
  +//#pragma SWIG nowarn=401
   %{
   #include "stdio.h"
   #include "string.h"
  @@ -20,14 +21,18 @@
   #include "xercesc/util/QName.hpp"
   #include "xercesc/util/HexBin.hpp"
   #include "xercesc/util/Base64.hpp"
  -#include "xercesc/parsers/IDOMParser.hpp"
  +#include "xercesc/parsers/AbstractDOMParser.hpp"
  +#include "xercesc/parsers/XercesDOMParser.hpp"
   #include "xercesc/parsers/SAXParser.hpp"
  -#include "xercesc/idom/IDOM.hpp"
  +#include "xercesc/dom/DOM.hpp"
   #include "xercesc/framework/LocalFileInputSource.hpp"
   #include "xercesc/framework/MemBufInputSource.hpp"
   #include "xercesc/framework/StdInInputSource.hpp"
   #include "xercesc/framework/URLInputSource.hpp"
   #include "xercesc/framework/XMLValidator.hpp"
  +#include "xercesc/framework/XMLFormatter.hpp"
  +#include "xercesc/framework/MemBufFormatTarget.hpp"
  +#include "xercesc/framework/StdOutFormatTarget.hpp"
   #include "xercesc/validators/common/Grammar.hpp"
   
   #include "PerlErrorCallbackHandler.hpp"
  @@ -48,6 +53,14 @@
   static bool DEBUG_UTF8_OUT = 0;
   static bool DEBUG_UTF8_IN = 0;
   
  +static char debug_char[2048];
  +static XMLCh debug_xml[2048];
  +
  +char*
  +debugPrint(const XMLCh* str){
  +    return (char*)XMLString::transcode(str);
  +}
  +
   // These exception creation methods make the Xerces.C code *much* smaller
   void
   makeXMLException(const XMLException& e){
  @@ -67,16 +80,16 @@
   }
   
   void
  -makeIDOMException(const IDOM_DOMException& e){
  +makeDOMException(const DOMException& e){
       SV *tmpsv;
       HV *hash = newHV();
  -    char *IDOM_EXCEPTION = "XML::Xerces::DOM_DOMException";
  -    HV *IDOM_EXCEPTION_STASH = gv_stashpv(IDOM_EXCEPTION, FALSE);
  +    char *DOM_EXCEPTION = "XML::Xerces::DOMException";
  +    HV *DOM_EXCEPTION_STASH = gv_stashpv(DOM_EXCEPTION, FALSE);
       hv_magic(hash, 
             (GV *)sv_setref_pv(sv_newmortal(), 
  -                             IDOM_EXCEPTION, (void *)&e), 
  +                             DOM_EXCEPTION, (void *)&e), 
             'P');
  -    tmpsv = sv_bless(newRV_noinc((SV *)hash), IDOM_EXCEPTION_STASH);
  +    tmpsv = sv_bless(newRV_noinc((SV *)hash), DOM_EXCEPTION_STASH);
       SV *error = ERRSV;
       SvSetSV(error,tmpsv);
       (void)SvUPGRADE(error, SVt_PV);
  @@ -131,21 +144,6 @@
   
   %include typemaps.i
   
  -/*******************/
  -/*                 */
  -/*  INCLUDE FILES  */
  -/*                 */
  -/*******************/
  -
  -%import "xercesc/sax2/DeclHandler.hpp"
  -%import "xercesc/sax/Parser.hpp"
  -%import "xercesc/framework/XMLDocumentHandler.hpp"
  -%import "xercesc/framework/XMLErrorReporter.hpp"
  -%import "xercesc/framework/XMLEntityHandler.hpp"
  -%import "xercesc/validators/DTD/DocTypeHandler.hpp"
  -
  -
  -
   %pragma nodefault
   
   // We have to define these in order to get past the occurrence of the
  @@ -161,17 +159,8 @@
   #define XMLPARSER_EXPORT
   #define VALIDATORS_EXPORT
   
  -/* 
  - * FOR ERROR HANDLING and other callbacks  
  - */
  -
  -%rename(PerlErrorCallbackHandler__constructor__arg) 
PerlErrorCallbackHandler::PerlErrorCallbackHandler(SV*);
  -%rename(PerlNodeFilterCallbackHandler__constructor__arg) 
PerlNodeFilterCallbackHandler::PerlNodeFilterCallbackHandler(SV*);
  -%rename(PerlContentCallbackHandler__constructor__arg) 
PerlContentCallbackHandler::PerlContentCallbackHandler(SV*);
  -%rename(PerlDocumentCallbackHandler__constructor__arg) 
PerlDocumentCallbackHandler::PerlDocumentCallbackHandler(SV*);
  -%rename(PerlEntityResolverHandler__constructor__arg) 
PerlEntityResolverHandler::PerlEntityResolverHandler(SV*);
  -
  -%include "PerlCallbackHandler.swig.hpp"
  +typedef unsigned int  XMLSize_t;
  +typedef unsigned int  XMLSSize_t;
   
   /*
    * The generic exception handler
  @@ -212,13 +201,17 @@
   /*
    * Utility Classes
    */
  -%rename(XMLURL__constructor__base) XMLURL::XMLURL(const   XMLCh* const, const 
XMLCh* const);
  +%rename(XMLURL__constructor__base) XMLURL::XMLURL(const   XMLCh* const, 
  +                                               const XMLCh* const);
   %rename(XMLURL__constructor__text) XMLURL::XMLURL(const XMLCh* const);
   %rename(XMLURL__constructor__copy) XMLURL::XMLURL(const XMLURL&);
  -%rename(XMLURL__constructor__url_base) XMLURL::XMLURL(const XMLURL&,const XMLCh* 
const);
  +%rename(XMLURL__constructor__url_base) XMLURL::XMLURL(const XMLURL&,
  +                                                   const XMLCh* const);
   %rename(makeRelativeTo__overload__XMLURL) XMLURL::makeRelativeTo(const XMLURL&);
  -%rename(setURL__overload__string) XMLURL::setURL(const XMLCh* const,const XMLCh* 
const);
  -%rename(setURL__overload__XMLURL) XMLURL::setURL(const XMLURL&,const XMLCh* const);
  +%rename(setURL__overload__string) XMLURL::setURL(const XMLCh* const,
  +                                              const XMLCh* const);
  +%rename(setURL__overload__XMLURL) XMLURL::setURL(const XMLURL&,
  +                                              const XMLCh* const);
   %ignore XMLURL::XMLURL(const XMLURL&,const char* const);
   %ignore XMLURL::XMLURL(const char* const);
   %ignore XMLURL::XMLURL(const XMLCh* const, const char* const);
  @@ -230,45 +223,52 @@
   // I want to add these eventually, but for now, I want to eliminate
   // the warnings
   
  -%ignore QName::QName(const XMLCh *const ,const XMLCh *const , const unsigned int);
  +%ignore QName::QName(const XMLCh *const,const XMLCh *const,const unsigned int);
   %ignore QName::QName(const XMLCh *const ,const unsigned int);
   %ignore QName::QName(const QName *const );
  -%ignore QName::setName(const XMLCh *const ,const unsigned int );
  +%ignore QName::setName(const XMLCh *const,const unsigned int);
   
   %ignore Base64::decode(const XMLCh *const ,unsigned int *);
   
  -%ignore XMLValidator::emitError(const XMLValid::Codes ,const XMLCh *const ,const 
XMLCh *const ,const XMLCh *const ,const XMLCh *const );
  -%ignore XMLValidator::emitError( const XMLValid::Codes , const char *const , const 
char *const , const char *const , const char *const );
  +%ignore XMLValidator::emitError(const XMLValid::Codes,const XMLCh *const,
  +                             const XMLCh *const,const XMLCh *const,
  +                             const XMLCh *const );
  +%ignore XMLValidator::emitError(const XMLValid::Codes, const char *const,
  +                             const char *const, const char *const,
  +                             const char *const );
   
   %ignore SAXException::SAXException(const XMLCh *const );
   %ignore SAXException::SAXException(const char *const );
   %ignore SAXException::SAXException(const SAXException &);
  -%ignore SAXNotSupportedException::SAXNotSupportedException(const XMLCh *const );
  -%ignore SAXNotSupportedException::SAXNotSupportedException(const char *const );
  -%ignore SAXNotSupportedException::SAXNotSupportedException(const SAXException &);
  -%ignore SAXNotRecognizedException::SAXNotRecognizedException(const XMLCh *const );
  -%ignore SAXNotRecognizedException::SAXNotRecognizedException(const char *const );
  -%ignore SAXNotRecognizedException::SAXNotRecognizedException(const SAXException &);
  -
  -%ignore SAXParseException::SAXParseException(const XMLCh *const ,const XMLCh *const 
,const XMLCh *const ,const unsigned int ,const unsigned int );
  +%ignore SAXNotSupportedException::SAXNotSupportedException(const XMLCh *const);
  +%ignore SAXNotSupportedException::SAXNotSupportedException(const char *const);
  +%ignore SAXNotSupportedException::SAXNotSupportedException(const SAXException&);
  +%ignore SAXNotRecognizedException::SAXNotRecognizedException(const XMLCh *const);
  +%ignore SAXNotRecognizedException::SAXNotRecognizedException(const char *const);
  +%ignore SAXNotRecognizedException::SAXNotRecognizedException(const SAXException&);
  +
  +%ignore SAXParseException::SAXParseException(const XMLCh *const ,
  +                                          const XMLCh *const ,
  +                                          const XMLCh *const ,
  +                                          XMLSSize_t const ,
  +                                          XMLSSize_t const );
   %ignore SAXParseException::SAXParseException(const SAXParseException &);
   
  +%ignore DOMDocument::createElementNS(const XMLCh *,const XMLCh *,const int,
  +                                  const int);
   
  +%ignore DOMException::DOMException(short ,const XMLCh *);
  +%ignore DOMException::DOMException(const DOMException &);
   
  -%ignore IDOM_Document::createElementNS(const XMLCh *,const XMLCh *,const int ,const 
int );
  -
  -%ignore IDOM_DOMException::IDOM_DOMException(short ,const XMLCh *);
  -%ignore IDOM_DOMException::IDOM_DOMException( const IDOM_DOMException &);
  +%ignore DOMImplementation::createDocument();
   
  -%ignore IDOM_DOMImplementation::createDocument();
  +%ignore DOMRangeException::DOMRangeException(RangeExceptionCode,
  +                                            const XMLCh *);
  +%ignore DOMRangeException::DOMRangeException(const DOMRangeException&);
   
  -%ignore IDOM_RangeException::IDOM_RangeException(RangeExceptionCode ,const XMLCh *);
  -%ignore IDOM_RangeException::IDOM_RangeException( const IDOM_RangeException &);
  -
  -%ignore XMLPScanToken::XMLPScanToken( const XMLPScanToken &);
  +%ignore XMLPScanToken::XMLPScanToken(const XMLPScanToken&);
   
   %ignore SAX2XMLReader::parse(const XMLCh *const );
  -%ignore SAX2XMLReader::parse(const char *const );
   
   %ignore SAXParser::setExternalSchemaLocation(const char *const );
   %ignore SAXParser::setExternalNoNamespaceSchemaLocation(const char *const );
  @@ -276,18 +276,25 @@
   %ignore SAXParser::getDocumentHandler() const;
   %ignore SAXParser::getEntityResolver() const;
   %ignore SAXParser::getErrorHandler() const;
  -%ignore IDOMParser::getErrorHandler() const;
  -%ignore IDOMParser::getEntityResolver() const;
  +
   %ignore Grammar::getElemDecl(const unsigned int ) const;
   %ignore Grammar::putElemDecl(XMLElementDecl *const ) const;
  -
  -%ignore IDOMParser::setExternalSchemaLocation(const char *const );
  -%ignore IDOMParser::setExternalNoNamespaceSchemaLocation(const char *const );
  -
   %ignore Grammar::getElemDecl(const unsigned int ,const XMLCh *const ,const XMLCh 
*const ,unsigned int );
   %ignore Grammar::getElemDecl(const unsigned int );
   %ignore Grammar::getNotationDecl(const XMLCh *const );
   
  +%ignore DOMDocument::createElementNS(const XMLCh *,const XMLCh *,
  +                                  XMLSSize_t const ,XMLSSize_t const );
  +%ignore DOMImplementation::createDocument();
  +%ignore DOMRangeException::DOMRangeException(RangeExceptionCode ,
  +                                          const XMLCh *);
  +%ignore DOMRangeException::DOMRangeException(const DOMRangeException &);
  +%ignore DOMBuilder::getErrorHandler() const;
  +%ignore DOMBuilder::getErrorHandler();
  +%ignore DOMBuilder::getEntityResolver();
  +%ignore DOMBuilder::getFilter();
  +%ignore DOMBuilder::parseURI(const char *const ,const bool );
  +
   // These are just const versions of the others, and should be ignored
   %ignore getPrefix() const;
   %ignore getLocalPart() const;
  @@ -299,13 +306,6 @@
   %include "xercesc/util/HexBin.hpp"
   %include "xercesc/util/Base64.hpp"
   
  -// do we need these Unicode string constants?
  -// %include "xercesc/util/XMLUni.hpp"
  -
  -// does anyone want to use this class for formatting Unicode?
  -// %include "xercesc/framework/XMLFormatter.hpp"
  -
  -
   // Perl has no need for these methods
   // %include "xercesc/util/XMLStringTokenizer.hpp"
   
  @@ -357,7 +357,9 @@
   %include "xercesc/sax2/Attributes.hpp"
   %include "xercesc/sax2/ContentHandler.hpp"
   %include "xercesc/sax2/LexicalHandler.hpp"
  +%include "xercesc/sax2/DeclHandler.hpp"
   %include "xercesc/sax2/DefaultHandler.hpp"
  +
   // the overloaded factory method is useless for perl
   %ignore createXMLReader(const XMLCh*);
   %include "xercesc/sax2/XMLReaderFactory.hpp"
  @@ -381,6 +383,20 @@
   %ignore URLInputSource(const XMLCh* const,const char* const);
   %include "xercesc/framework/URLInputSource.hpp"
   
  +%ignore XMLFormatter::XMLFormatter(char const *const,XMLFormatTarget *const,
  +                                EscapeFlags const,UnRepFlags const);
  +%ignore XMLFormatter::operator <<;
  +
  +//
  +// Format Targets for DOMWriter
  +//
  +%include "xercesc/framework/XMLFormatter.hpp"
  +%include "xercesc/framework/MemBufFormatTarget.hpp"
  +%include "xercesc/framework/StdOutFormatTarget.hpp"
  +
  +// Unicode string constants for XML Formatter
  +%include "xercesc/util/XMLUni.hpp"
  +
   //
   // XMLScanner support
   //
  @@ -441,12 +457,6 @@
   // scan token helper class for progressive parsing
   %include "xercesc/framework/XMLPScanToken.hpp"
   
  -// Overloaded methods
  -%rename(parse__overload__is) parse(const InputSource&, const bool);
  -%ignore parse(const XMLCh* const,const bool);
  -%rename(parseFirst__overload__is) parseFirst(const InputSource&, XMLPScanToken &, 
const bool);
  -%ignore parseFirst(const XMLCh *const ,XMLPScanToken &,const bool );
  -
   /*
    * methods not needed by the public Parser interfaces
    *
  @@ -496,77 +506,35 @@
   %ignore startExtSubset;
   %ignore TextDecl;
   
  -// %include "xercesc/sax/Parser.hpp"
  -%exception SAX2XMLReader::setProperty {
  -    try {
  -        $function
  -    } 
  -    catch (const XMLException& e)
  -        {
  -         makeXMLException(e);
  -        }
  -    catch (const SAXNotSupportedException& e)
  -     {
  -         makeSAXNotSupportedException(e);
  -     }
  -    catch (const SAXNotRecognizedException& e)
  -     {
  -         makeSAXNotRecognizedException(e);
  -     }
  -    catch (...)
  -        {
  -            XMLPlatformUtils::Terminate();
  -            croak("%s", "Handling Unknown exception");
  -        }
  -}
  +// These are char* versions of XMLCh* methods, and should be ignored
  +%ignore SAX2XMLReader::parse(const char *const );
  +%ignore AbstractDOMParser::setExternalSchemaLocation(const char* const);
  +%ignore AbstractDOMParser::setExternalNoNamespaceSchemaLocation(const char* const);
  +%ignore parse(const char* const, const bool);
  +%ignore parseFirst(const char *const,XMLPScanToken&,const bool);
   
  -%exception SAX2XMLReader::setFeature {
  -    try {
  -        $function
  -    } 
  -    catch (const XMLException& e)
  -        {
  -         makeXMLException(e);
  -        }
  -    catch (const SAXNotSupportedException& e)
  -     {
  -         makeSAXNotSupportedException(e);
  -     }
  -    catch (const SAXNotRecognizedException& e)
  -     {
  -         makeSAXNotRecognizedException(e);
  -     }
  -    catch (...)
  -        {
  -            XMLPlatformUtils::Terminate();
  -            croak("%s", "Handling Unknown exception");
  -        }
  -}
  +// These are just const versions of the others, and should be ignored
  +%ignore XercesDOMParser::getErrorHandler() const;
  +%ignore XercesDOMParser::getEntityResolver() const;
   
  -%exception SAX2XMLReader::getProperty {
  -    try {
  -        $function
  -    } 
  -    catch (const XMLException& e)
  -        {
  -         makeXMLException(e);
  -        }
  -    catch (const SAXNotSupportedException& e)
  -     {
  -         makeSAXNotSupportedException(e);
  -     }
  -    catch (const SAXNotRecognizedException& e)
  -     {
  -         makeSAXNotRecognizedException(e);
  -     }
  -    catch (...)
  -        {
  -            XMLPlatformUtils::Terminate();
  -            croak("%s", "Handling Unknown exception");
  -        }
  -}
  +// Overloaded methods
  +%rename(parse__overload__is) parse(const InputSource&, const bool);
  +%rename(parseFirst__overload__is) parseFirst(const InputSource&, 
  +                                          XMLPScanToken &, const bool);
  +//
  +// The abstract base classes for Parsers
  +// 
  +%include "xercesc/sax/Parser.hpp"
  +%include "xercesc/framework/XMLDocumentHandler.hpp"
  +%include "xercesc/framework/XMLErrorReporter.hpp"
  +%include "xercesc/framework/XMLEntityHandler.hpp"
  +%include "xercesc/validators/DTD/DocTypeHandler.hpp"
   
  -%exception SAX2XMLReader::getFeature {
  +//
  +// define the exceptions for SAX2XMLReader
  +//
  +%define SAXEXCEPTION(method)
  +%exception method {
       try {
           $function
       } 
  @@ -588,20 +556,29 @@
               croak("%s", "Handling Unknown exception");
           }
   }
  +%enddef
   
  +SAXEXCEPTION(SAX2XMLReader::getFeature)
  +SAXEXCEPTION(SAX2XMLReader::setFeature)
  +SAXEXCEPTION(SAX2XMLReader::setProperty)
  +SAXEXCEPTION(SAX2XMLReader::getProperty)
  +
  +
  +//
  +// The Parsers classes
  +// 
   %include "xercesc/sax2/SAX2XMLReader.hpp"
   %include "xercesc/parsers/SAXParser.hpp"
  -
  -%rename(DOMParser) IDOMParser;
  -%include "xercesc/parsers/IDOMParser.hpp"
  +%include "xercesc/parsers/AbstractDOMParser.hpp"
  +%include "xercesc/parsers/XercesDOMParser.hpp"
   
   %include "xercesc/validators/common/Grammar.hpp"
   
   /* 
  - * THE NEW DOM IMPLEMENATION 
  + * DOM
    */
   
  -// the IDOM classes gets a special exception handler
  +// the DOM classes gets a special exception handler
   %exception {
       try {
           $function
  @@ -610,9 +587,9 @@
           {
            makeXMLException(e);
           }
  -    catch (const IDOM_DOMException& e)
  +    catch (const DOMException& e)
        {
  -         makeIDOMException(e);
  +         makeDOMException(e);
        }
       catch (...)
           {
  @@ -621,67 +598,121 @@
           }
   }
   
  -//
  -// we rename all the IDOM* classes to DOM* instead
  -//
  -%rename(DOM_Node) IDOM_Node;
  -%rename(DOM_Attr) IDOM_Attr;
  -%rename(DOM_CharacterData) IDOM_CharacterData;
  -%rename(DOM_Text) IDOM_Text;
  -%rename(DOM_CDATASection) IDOM_CDATASection;
  -%rename(DOM_Comment) IDOM_Comment;
  -%rename(DOM_Document) IDOM_Document;
  -%rename(DOM_DocumentFragment) IDOM_DocumentFragment;
  -%rename(DOM_DocumentType) IDOM_DocumentType;
  -%rename(DOM_DOMException) IDOM_DOMException;
  -%rename(DOM_DOMImplementation) IDOM_DOMImplementation;
  -%rename(DOM_Element) IDOM_Element;
  -%rename(DOM_Entity) IDOM_Entity;
  -%rename(DOM_EntityReference) IDOM_EntityReference;
  -%rename(DOM_NamedNodeMap) IDOM_NamedNodeMap;
  -%rename(DOM_NodeFilter) IDOM_NodeFilter;
  -%rename(DOM_NodeIterator) IDOM_NodeIterator;
  -%rename(DOM_NodeList) IDOM_NodeList;
  -%rename(DOM_Notation) IDOM_Notation;
  -%rename(DOM_ProcessingInstruction) IDOM_ProcessingInstruction;
  -%rename(DOM_Range) IDOM_Range;
  -%rename(DOM_RangeException) IDOM_RangeException;
  -%rename(DOM_TreeWalker) IDOM_TreeWalker;
  -
  -%include "xercesc/idom/IDOM_Node.hpp"
  -%include "xercesc/idom/IDOM_Attr.hpp"
  -%include "xercesc/idom/IDOM_CharacterData.hpp"
  -%include "xercesc/idom/IDOM_Text.hpp"
  -%include "xercesc/idom/IDOM_CDATASection.hpp"
  -%include "xercesc/idom/IDOM_Comment.hpp"
  -%include "xercesc/idom/IDOM_Document.hpp"
  -%include "xercesc/idom/IDOM_DocumentFragment.hpp"
  -%include "xercesc/idom/IDOM_DocumentType.hpp"
  -%include "xercesc/idom/IDOM_DOMException.hpp"
  -%include "xercesc/idom/IDOM_DOMImplementation.hpp"
  -%include "xercesc/idom/IDOM_Element.hpp"
  -%include "xercesc/idom/IDOM_Entity.hpp"
  -%include "xercesc/idom/IDOM_EntityReference.hpp"
  -%include "xercesc/idom/IDOM_NamedNodeMap.hpp"
  -%include "xercesc/idom/IDOM_NodeFilter.hpp"
  -%include "xercesc/idom/IDOM_NodeIterator.hpp"
  -%include "xercesc/idom/IDOM_NodeList.hpp"
  -%include "xercesc/idom/IDOM_Notation.hpp"
  -%include "xercesc/idom/IDOM_ProcessingInstruction.hpp"
  -%include "xercesc/idom/IDOM_Range.hpp"
  -%include "xercesc/idom/IDOM_RangeException.hpp"
  -%include "xercesc/idom/IDOM_TreeWalker.hpp"
  -
  -%addmethods IDOM_Node {
  -   bool operator==(const IDOM_Node &other) {
  -       return self == &other;
  -   }
  -   bool operator!=(const IDOM_Node &other) {
  -       return self != &other;
  -   }
  -};
  +// Introduced in DOM Level 1
  +%include "xercesc/dom/DOMException.hpp"
  +
  +// Introduced in DOM Level 2
  +%include "xercesc/dom/DOMDocumentRange.hpp"
  +%include "xercesc/dom/DOMDocumentTraversal.hpp"
  +%include "xercesc/dom/DOMNodeFilter.hpp"
  +%include "xercesc/dom/DOMNodeIterator.hpp"
  +%include "xercesc/dom/DOMRange.hpp"
  +%include "xercesc/dom/DOMRangeException.hpp"
  +%include "xercesc/dom/DOMTreeWalker.hpp"
  +
  +// Introduced in DOM Level 1
  +%include "xercesc/dom/DOMNode.hpp"
  +%include "xercesc/dom/DOMAttr.hpp"
  +%include "xercesc/dom/DOMCharacterData.hpp"
  +%include "xercesc/dom/DOMText.hpp"
  +%include "xercesc/dom/DOMCDATASection.hpp"
  +%include "xercesc/dom/DOMComment.hpp"
  +%include "xercesc/dom/DOMDocument.hpp"
  +%include "xercesc/dom/DOMDocumentFragment.hpp"
  +%include "xercesc/dom/DOMDocumentType.hpp"
  +%include "xercesc/dom/DOMImplementationLS.hpp"
  +%include "xercesc/dom/DOMImplementation.hpp"
  +%include "xercesc/dom/DOMElement.hpp"
  +%include "xercesc/dom/DOMEntity.hpp"
  +%include "xercesc/dom/DOMEntityReference.hpp"
  +%include "xercesc/dom/DOMNamedNodeMap.hpp"
  +%include "xercesc/dom/DOMNodeList.hpp"
  +%include "xercesc/dom/DOMNotation.hpp"
  +%include "xercesc/dom/DOMProcessingInstruction.hpp"
  +
  +// Introduced in DOM Level 3
  +// Experimental - subject to change
  +%include "xercesc/dom/DOMBuilder.hpp"
  +%include "xercesc/dom/DOMImplementationLS.hpp"
  +%include "xercesc/dom/DOMImplementationRegistry.hpp"
  +%include "xercesc/dom/DOMImplementationSource.hpp"
  +%include "xercesc/dom/DOMInputSource.hpp"
  +%include "xercesc/dom/DOMLocator.hpp"
  +%include "xercesc/dom/DOMWriter.hpp"
  +%include "xercesc/dom/DOMWriterFilter.hpp"
  +
  +// %addmethods IDOM_Node {
  +//    bool operator==(const IDOM_Node &other) {
  +//        return self == &other;
  +//    }
  +//    bool operator!=(const IDOM_Node &other) {
  +//        return self != &other;
  +//    }
  +// };
  +
  +/* 
  + * FOR ERROR HANDLING and other callbacks - this needs to be at the very end
  + *   so that SWIG can wrap the superclass methods properly
  + */
   
  +%rename(PerlErrorCallbackHandler__constructor__arg) 
PerlErrorCallbackHandler::PerlErrorCallbackHandler(SV*);
  +%rename(PerlNodeFilterCallbackHandler__constructor__arg) 
PerlNodeFilterCallbackHandler::PerlNodeFilterCallbackHandler(SV*);
  +%rename(PerlContentCallbackHandler__constructor__arg) 
PerlContentCallbackHandler::PerlContentCallbackHandler(SV*);
  +%rename(PerlDocumentCallbackHandler__constructor__arg) 
PerlDocumentCallbackHandler::PerlDocumentCallbackHandler(SV*);
  +%rename(PerlEntityResolverHandler__constructor__arg) 
PerlEntityResolverHandler::PerlEntityResolverHandler(SV*);
  +
  +%ignore PerlErrorCallbackHandler::warning(const SAXParseException&);
  +%ignore PerlErrorCallbackHandler::error(const SAXParseException&);
  +%ignore PerlErrorCallbackHandler::fatalError(const SAXParseException&);
  +
  +%import "PerlCallbackHandler.hpp"
  +%include "PerlErrorCallbackHandler.hpp"
  +%include "PerlDocumentCallbackHandler.hpp"
  +%include "PerlContentCallbackHandler.hpp"
  +
  +%ignore PerlEntityResolverHandler::resolveEntity (const XMLCh* const, 
  +                                              const XMLCh* const);
  +%include "PerlEntityResolverHandler.hpp"
  +
  +%ignore PerlNodeFilterCallbackHandler::acceptNode (const IDOM_Node*) const;
  +%include "PerlNodeFilterCallbackHandler.hpp"
  +
  +/* 
  + * Include extra verbatim C code in the initialization function
  + */
  +%init {
  +    // we create the global transcoder for UTF-8 to UTF-16
  +    XMLTransService::Codes failReason;
  +    XMLPlatformUtils::Initialize(); // first we must create the transservice
  +    UTF8_ENCODING = XMLString::transcode("UTF-8");
  +    UTF8_TRANSCODER =
  +      XMLPlatformUtils::fgTransService->makeNewTranscoderFor(UTF8_ENCODING,
  +                                                             failReason,
  +                                                             1024);
  +    if (! UTF8_TRANSCODER) {
  +     croak("ERROR: XML::Xerces: INIT: Could not create UTF-8 transcoder");
  +    }
  +
  +
  +    ISO_8859_1_ENCODING = XMLString::transcode("ISO-8859-1");
  +    ISO_8859_1_TRANSCODER =
  +      XMLPlatformUtils::fgTransService->makeNewTranscoderFor(ISO_8859_1_ENCODING,
  +                                                             failReason,
  +                                                             1024);
  +    if (! ISO_8859_1_TRANSCODER) {
  +     croak("ERROR: XML::Xerces: INIT: Could not create ISO-8859-1 transcoder");
  +    }
  +
  +}
  +
  +/* 
  + * Include extra verbatim Perl code
  + */
   %pragma(perl5) include="Xerces-extra.pm"
  +
  +/* 
  + * Include extra verbatim Perl code immediately after Module header
  + */
   %pragma(perl5) code="package XML::Xerces; 
   use vars qw($VERSION @EXPORT);
   $VERSION = q[1.7.0-1];";
  
  
  

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

Reply via email to