You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ja...@apache.org on 2001/10/07 01:39:05 UTC

cvs commit: xml-xerces/perl Xerces.i

jasons      01/10/06 16:39:05

  Modified:    perl     Xerces.i
  Log:
  	* Xerces.i (Repository):
  	Switched from #include <> to #include ""
  	Removed typemaps
  	Added EXPORT_* #defines
  	Now using %ignore to remove redundant methods
  	Using %rename for overloaded methods and constructors
  	Fully implemented:
  	   *Parser
  	   XMLPScanToken
  	   *InputSource
  	   XMLURL
  	   *::operator=
  	   *::operator==
  	   *::operator!=
  	Using %except to handle exceptions
  	Only using private headers for files with parse errors:
  	   framework/StdInInputSource.hpp
  	   framework/XMLPScanToken.hpp
  	   util/PlatformUtils.hpp
  	   util/XMLURL.hpp
  	   util/XMLUri.hpp
  	Removed all depricate methods for *Parser classes
  	Removed all XMLDocumentHandler, and XMLEntityHandler methods for
  	   *Parser classes
  
  Revision  Changes    Path
  1.11      +368 -687  xml-xerces/perl/Xerces.i
  
  Index: Xerces.i
  ===================================================================
  RCS file: /home/cvs/xml-xerces/perl/Xerces.i,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Xerces.i	2001/08/02 02:45:22	1.10
  +++ Xerces.i	2001/10/06 23:39:05	1.11
  @@ -1,39 +1,43 @@
   %module Xerces
   %{
  -#include <stdio.h>
  -#include <strstream.h>
  -#include <iostream.h>
  -#include <string.h>
  -#include <sax/InputSource.hpp>
  -#include <sax/SAXException.hpp>
  -#include <sax/SAXParseException.hpp>
  -#include <sax/Locator.hpp>
  -#include <sax/HandlerBase.hpp>
  -#include <sax2/Attributes.hpp>
  -#include <sax2/ContentHandler.hpp>
  -#include <sax2/LexicalHandler.hpp>
  -#include <sax2/DefaultHandler.hpp>
  -#include <sax2/SAX2XMLReader.hpp>
  -#include <sax2/XMLReaderFactory.hpp>
  -#include <framework/URLInputSource.hpp>
  -#include <util/PlatformUtils.hpp>
  -#include <util/XMLString.hpp>
  -#include <parsers/DOMParser.hpp>
  -#include <parsers/IDOMParser.hpp>
  -#include <parsers/SAXParser.hpp>
  -#include <idom/IDOM.hpp>
  -#include <dom/DOM.hpp>
  -#include <dom/DOM_DOMException.hpp>
  -#include <dom/DOM_RangeException.hpp>
  -#include <framework/LocalFileInputSource.hpp>
  -#include <framework/MemBufInputSource.hpp>
  -#include <framework/StdInInputSource.hpp>
  -#include <framework/URLInputSource.hpp>
  -#include <PerlErrorCallbackHandler.hpp>
  -#include <PerlEntityResolverHandler.i>
  -#include <PerlDocumentCallbackHandler.hpp>
  -#include <PerlContentCallbackHandler.hpp>
  -#include <PerlExceptionHandler.hpp>
  +#include "stdio.h"
  +#include "strstream.h"
  +#include "iostream.h"
  +#include "string.h"
  +#include "sax/InputSource.hpp"
  +#include "sax/SAXException.hpp"
  +#include "sax/SAXParseException.hpp"
  +#include "sax/Locator.hpp"
  +#include "sax/HandlerBase.hpp"
  +#include "sax2/Attributes.hpp"
  +#include "sax2/ContentHandler.hpp"
  +#include "sax2/LexicalHandler.hpp"
  +#include "sax2/DefaultHandler.hpp"
  +#include "sax2/SAX2XMLReader.hpp"
  +#include "sax2/XMLReaderFactory.hpp"
  +#include "util/PlatformUtils.hpp"
  +#include "util/XMLString.hpp"
  +#include "util/XMLUri.hpp"
  +#include "util/QName.hpp"
  +#include "util/HexBin.hpp"
  +#include "util/Base64.hpp"
  +#include "parsers/DOMParser.hpp"
  +#include "parsers/IDOMParser.hpp"
  +#include "parsers/SAXParser.hpp"
  +#include "idom/IDOM.hpp"
  +#include "dom/DOM.hpp"
  +#include "dom/DOM_DOMException.hpp"
  +#include "dom/DOM_RangeException.hpp"
  +#include "framework/LocalFileInputSource.hpp"
  +#include "framework/MemBufInputSource.hpp"
  +#include "framework/StdInInputSource.hpp"
  +#include "framework/URLInputSource.hpp"
  +#include "framework/XMLValidator.hpp"
  +#include "PerlErrorCallbackHandler.hpp"
  +#include "PerlEntityResolverHandler.i"
  +#include "PerlDocumentCallbackHandler.hpp"
  +#include "PerlContentCallbackHandler.hpp"
  +#include "PerlExceptionHandler.hpp"
   %}
   
   /**************/
  @@ -42,684 +46,361 @@
   /*            */
   /**************/
   
  +%include typemaps.i
   
  -/**************/
  -/*            */
  -/* DOMStrings */
  -/*            */
  -/**************/
  -
  -/***************************************************************************/
  -/*                                                                         */
  -/* FOR FUNCTIONS TAKING DOMString AS AN ARGUMENT --                        */
  -/*    NOW YOU CAN JUST SUPPLY A STRING                                     */ 
  -/* THIS TYPEMAP CONVERTS PERL-STRINGS TO DOMStrings AUTOMATICALLY          */
  -/*                                                                         */
  -/***************************************************************************/
  -%typemap(perl5, in) DOMString * (DOMString temp) {
  -  if (  SvPOK( $source )  ) {
  -    char *ptr = (char *)SvPV( $source, na );
  -    temp = DOMString(ptr);
  -    $target = &temp;
  -#ifdef SWIG_1_1
  -  } else if(SWIG_GetPtr($source,(void **) &$target,"DOMString")) {
  -#else
  -  } else if(SWIG_ConvertPtr($source,(void **) &$target,SWIGTYPE_p_DOMString)) {
  -#endif
  -    croak("Type error in argument 2 of $name, Expected perl-string or DOMString.");
  -    XSRETURN(1);
  -  }
  -}
  -
  -/***********************************************/
  -/*                                             */
  -/* COVER ALL THE BASES FOR DOMString ARGUMENTS */
  -/*                                             */
  -/***********************************************/
  -%typemap(perl5, in) const DOMString * = DOMString *;
  -%typemap(perl5, in)       DOMString & = DOMString *;
  -%typemap(perl5, in) const DOMString & = DOMString *;
  -
  -
  -/*************************************************************************/
  -/*                                                                       */
  -/* RETURN VALUE OF DOMString IS AUTOMATICALLY CONVERTED TO A PERL-STRING */
  -/* (WITHOUT A CALL TO transcode IN THE PERL SCRIPT)                      */
  -/*                                                                       */
  -/*************************************************************************/
  -%typemap(perl5, out) DOMString {
  -  $target = sv_newmortal();
  -  sv_setpv( (SV*)$target,(char *) $source->transcode() );
  -  delete $source;
  -  ++argvi;
  -}
  -
  -/***************************************************/
  -/*                                                 */
  -/* COVER ALL THE BASES FOR DOMString RETURN VALUES */
  -/*                                                 */
  -/***************************************************/
  -%typemap(perl5, out) const DOMString = DOMString;
  -
  -
  -
  -/***********/
  -/*         */
  -/* XMLCh * */
  -/*         */
  -/***********/
  -
  -/************************************************************************/
  -/*                                                                      */
  -/* FOR FUNCTIONS TAKING XMLCh * (I.E AN XMLCh STRING) AS AN ARGUMENT -- */
  -/* NOW YOU CAN JUST SUPPLY A STRING.  THIS TYPEMAP CONVERTS             */
  -/* PERL-STRINGS TO XMLCh STRINGS AUTOMATICALLY                          */
  -/*                                                                      */
  -/************************************************************************/
  -
  -/************************************************************************/
  -/*                                                                      */
  -/* CAVEAT:                                                              */
  -/* TO CONVERT STRINGS TO XMLCh STRINGS, A TEMPORARY POINTER MUST BE     */
  -/* CREATED IN THE in TYPEMAP TO POINT TO MEMORY THAT HOLDS THE          */
  -/* CONVERSION.  THE MEMORY IS DYNAMIC, SO IT MUST BE FREED AFTER THE C  */
  -/* FUNCTION THAT USES IT IS CALLED.  THIS IS DONE VIA A "freearg"       */
  -/* TYPEMAP.  IT IS MAJORLY KLUDGY, BUT IT WORKS.                        */
  -/*                                                                      */
  -/* ONE PROBLEM:  A FEW XERCES FUNCTIONS TAKE MULTIPLE ARGUMENTS OF      */
  -/* TYPE XMLCh STRING.  THEREFORE, A DIFFERENT TEMPORARY VARIABLE MUST   */
  -/* BE USED FOR EACH ONE.  THIS IS ACCOMPLISHED BY MAKING SEPERATE       */
  -/* in AND freearg TYPEMAPS FOR EACH ARGUMENT OF A GIVEN NAME. ONCE      */
  -/* AGAIN, THIS IS KLUDGY, BUT IT WORKS.                                 */
  -/*                                                                      */
  -/************************************************************************/
  -
  -/**********************/
  -/*                    */
  -/* msgDomain ARGUMENT */
  -/*                    */
  -/**********************/
  -%typemap(perl5, in) XMLCh *msgDomain (XMLCh *temp_msgDomain) {
  -  if (  SvPOK( $source )  ) {
  -    char *ptr = (char *)SvPV( $source, na );
  -    $target = temp_msgDomain = XMLString::transcode(ptr);
  -  } else {
  -    croak("Type error in argument 2 of $name, Expected perl-string.");
  -    XSRETURN(1);
  -  }
  -}
  -
  -/******************************************************/
  -/*                                                    */
  -/* DUP in TYPEMAP FOR const XMLCh *msgDomain ARGUMENT */
  -/*                                                    */
  -/******************************************************/
  -%typemap(perl5, in) const XMLCh *msgDomain = XMLCh *msgDomain;
  -
  -/*************************************************************/
  -/*                                                           */
  -/* KLUDGE! CLEAN UP WHAT temp_msgDomain ABOVE IS POINTING TO */
  -/*                                                           */
  -/*************************************************************/
  -%typemap(perl5, freearg) XMLCh *msgDomain {
  -  delete[] temp_msgDomain;
  -}
  -
  -/***********************************************************/
  -/*                                                         */
  -/* DUP freearg TYPEMAP FOR const XMLCh *msgDomain ARGUMENT */
  -/*                                                         */
  -/***********************************************************/
  -%typemap(perl5, freearg) const XMLCh *msgDomain = XMLCh *msgDomain;
  -
  -
  -/**********************/
  -/*                    */
  -/* errorText ARGUMENT */
  -/*                    */
  -/**********************/
  -%typemap(perl5, in) XMLCh *errorText (XMLCh *temp_errorText) {
  -  if (  SvPOK( $source )  ) {
  -    char *ptr = (char *)SvPV( $source, na );
  -    $target = temp_errorText = XMLString::transcode(ptr);
  -  } else {
  -    croak("Type error in argument 2 of $name, Expected perl-string.");
  -    XSRETURN(1);
  -  }
  -}
  -
  -/******************************************************/
  -/*                                                    */
  -/* DUP in TYPEMAP FOR const XMLCh *errorText ARGUMENT */
  -/*                                                    */
  -/******************************************************/
  -%typemap(perl5, in) const XMLCh *errorText = XMLCh *errorText;
  -
  -/*************************************************************/
  -/*                                                           */
  -/* KLUDGE! CLEAN UP WHAT temp_errorText ABOVE IS POINTING TO */
  -/*                                                           */
  -/*************************************************************/
  -%typemap(perl5, freearg) XMLCh *errorText {
  -  delete[] temp_errorText;
  -}
  -
  -/***********************************************************/
  -/*                                                         */
  -/* DUP freearg TYPEMAP FOR const XMLCh *errorText ARGUMENT */
  -/*                                                         */
  -/***********************************************************/
  -%typemap(perl5, freearg) const XMLCh *errorText = XMLCh *errorText;
  -
  -
  -/*********************/
  -/*                   */
  -/* systemId ARGUMENT */
  -/*                   */
  -/*********************/
  -%typemap(perl5, in) XMLCh *systemId (XMLCh *temp_systemId) {
  -  if (  SvPOK( $source )  ) {
  -    char *ptr = (char *)SvPV( $source, na );
  -    $target = temp_systemId = XMLString::transcode(ptr);
  -  } else {
  -    croak("Type error in argument 2 of $name, Expected perl-string.");
  -    XSRETURN(1);
  -  }
  -}
  -
  -/*****************************************************/
  -/*                                                   */
  -/* DUP in TYPEMAP FOR const XMLCh *systemId ARGUMENT */
  -/*                                                   */
  -/*****************************************************/
  -%typemap(perl5, in) const XMLCh *systemId = XMLCh *systemId;
  -
  -/************************************************************/
  -/*                                                          */
  -/* KLUDGE! CLEAN UP WHAT temp_systemId ABOVE IS POINTING TO */
  -/*                                                          */
  -/************************************************************/
  -%typemap(perl5, freearg) XMLCh *systemId {
  -  delete[] temp_systemId;
  -}
  -
  -/**********************************************************/
  -/*                                                        */
  -/* DUP freearg TYPEMAP FOR const XMLCh *systemId ARGUMENT */
  -/*                                                        */
  -/**********************************************************/
  -%typemap(perl5, freearg) const XMLCh *systemId = XMLCh *systemId;
  -
  -
  -/*********************/
  -/*                   */
  -/* publicId ARGUMENT */
  -/*                   */
  -/*********************/
  -%typemap(perl5, in) XMLCh *publicId (XMLCh *temp_publicId) {
  -  if (  SvPOK( $source )  ) {
  -    char *ptr = (char *)SvPV( $source, na );
  -    $target = temp_publicId = XMLString::transcode(ptr);
  -  } else {
  -    croak("Type error in argument 2 of $name, Expected perl-string.");
  -    XSRETURN(1);
  -  }
  -}
  -
  -/*****************************************************/
  -/*                                                   */
  -/* DUP in TYPEMAP FOR const XMLCh *publicId ARGUMENT */
  -/*                                                   */
  -/*****************************************************/
  -%typemap(perl5, in) const XMLCh *publicId = XMLCh *publicId;
  -
  -/************************************************************/
  -/*                                                          */
  -/* KLUDGE! CLEAN UP WHAT temp_publicId ABOVE IS POINTING TO */
  -/*                                                          */
  -/************************************************************/
  -%typemap(perl5, freearg) XMLCh *publicId {
  -  delete[] temp_publicId;
  -}
  -
  -/**********************************************************/
  -/*                                                        */
  -/* DUP freearg TYPEMAP FOR const XMLCh *publicId ARGUMENT */
  -/*                                                        */
  -/**********************************************************/
  -%typemap(perl5, freearg) const XMLCh *publicId = XMLCh *publicId;
  -
  -
  -/***********************/
  -/*                     */
  -/* versionStr ARGUMENT */
  -/*                     */
  -/***********************/
  -%typemap(perl5, in) XMLCh *versionStr (XMLCh *temp_versionStr) {
  -  if (  SvPOK( $source )  ) {
  -    char *ptr = (char *)SvPV( $source, na );
  -    $target = temp_versionStr = XMLString::transcode(ptr);
  -  } else {
  -    croak("Type error in argument 2 of $name, Expected perl-string.");
  -    XSRETURN(1);
  -  }
  -}
  -
  -/*******************************************************/
  -/*                                                     */
  -/* DUP in TYPEMAP FOR const XMLCh *versionStr ARGUMENT */
  -/*                                                     */
  -/*******************************************************/
  -%typemap(perl5, in) const XMLCh *versionStr = XMLCh *versionStr;
  -
  -/**************************************************************/
  -/*                                                            */
  -/* KLUDGE! CLEAN UP WHAT temp_versionStr ABOVE IS POINTING TO */
  -/*                                                            */
  -/**************************************************************/
  -%typemap(perl5, freearg) XMLCh *versionStr {
  -  delete[] temp_versionStr;
  -}
  -
  -/************************************************************/
  -/*                                                          */
  -/* DUP freearg TYPEMAP FOR const XMLCh *versionStr ARGUMENT */
  -/*                                                          */
  -/************************************************************/
  -%typemap(perl5, freearg) const XMLCh *versionStr = XMLCh *versionStr;
  -
  -
  -/************************/
  -/*                      */
  -/* encodingStr ARGUMENT */
  -/*                      */
  -/************************/
  -%typemap(perl5, in) XMLCh *encodingStr (XMLCh *temp_encodingStr) {
  -  if (  SvPOK( $source )  ) {
  -    char *ptr = (char *)SvPV( $source, na );
  -    $target = temp_encodingStr = XMLString::transcode(ptr);
  -  } else {
  -    croak("Type error in argument 2 of $name, Expected perl-string.");
  -    XSRETURN(1);
  -  }
  -}
  -
  -/********************************************************/
  -/*                                                      */
  -/* DUP in TYPEMAP FOR const XMLCh *encodingStr ARGUMENT */
  -/*                                                      */
  -/********************************************************/
  -%typemap(perl5, in) const XMLCh *encodingStr = XMLCh *encodingStr;
  -
  -/***************************************************************/
  -/*                                                             */
  -/* KLUDGE! CLEAN UP WHAT temp_encodingStr ABOVE IS POINTING TO */
  -/*                                                             */
  -/***************************************************************/
  -%typemap(perl5, freearg) XMLCh *encodingStr {
  -  delete[] temp_encodingStr;
  -}
  -
  -/*************************************************************/
  -/*                                                           */
  -/* DUP freearg TYPEMAP FOR const XMLCh *encodingStr ARGUMENT */
  -/*                                                           */
  -/*************************************************************/
  -%typemap(perl5, freearg) const XMLCh *encodingStr = XMLCh *encodingStr;
  -
  -
  -/**************************/
  -/*                        */
  -/* standaloneStr ARGUMENT */
  -/*                        */
  -/**************************/
  -%typemap(perl5, in) XMLCh *standaloneStr (XMLCh *temp_standaloneStr) {
  -  if (  SvPOK( $source )  ) {
  -    char *ptr = (char *)SvPV( $source, na );
  -    $target = temp_standaloneStr = XMLString::transcode(ptr);
  -  } else {
  -    croak("Type error in argument 2 of $name, Expected perl-string.");
  -    XSRETURN(1);
  -  }
  -}
  -
  -/**********************************************************/
  -/*                                                        */
  -/* DUP in TYPEMAP FOR const XMLCh *standaloneStr ARGUMENT */
  -/*                                                        */
  -/**********************************************************/
  -%typemap(perl5, in) const XMLCh *standaloneStr = XMLCh *standaloneStr;
  -
  -/*****************************************************************/
  -/*                                                               */
  -/* KLUDGE! CLEAN UP WHAT temp_standaloneStr ABOVE IS POINTING TO */
  -/*                                                               */
  -/*****************************************************************/
  -%typemap(perl5, freearg) XMLCh *standaloneStr {
  -  delete[] temp_standaloneStr;
  -}
  -
  -/***************************************************************/
  -/*                                                             */
  -/* DUP freearg TYPEMAP FOR const XMLCh *standaloneStr ARGUMENT */
  -/*                                                             */
  -/***************************************************************/
  -%typemap(perl5, freearg) const XMLCh *standaloneStr = XMLCh *standaloneStr;
  -
  -
  -/*************************/
  -/*                       */
  -/* actualEncStr ARGUMENT */
  -/*                       */
  -/*************************/
  -%typemap(perl5, in) XMLCh *actualEncStr (XMLCh *temp_actualEncStr) {
  -  if (  SvPOK( $source )  ) {
  -    char *ptr = (char *)SvPV( $source, na );
  -    $target = temp_actualEncStr = XMLString::transcode(ptr);
  -  } else {
  -    croak("Type error in argument 2 of $name, Expected perl-string.");
  -    XSRETURN(1);
  -  }
  -}
  -
  -/*********************************************************/
  -/*                                                       */
  -/* DUP in TYPEMAP FOR const XMLCh *actualEncStr ARGUMENT */
  -/*                                                       */
  -/*********************************************************/
  -%typemap(perl5, in) const XMLCh *actualEncStr = XMLCh *actualEncStr;
  -
  -/****************************************************************/
  -/*                                                              */
  -/* KLUDGE! CLEAN UP WHAT temp_actualEncStr ABOVE IS POINTING TO */
  -/*                                                              */
  -/****************************************************************/
  -%typemap(perl5, freearg) XMLCh *actualEncStr {
  -  delete[] temp_actualEncStr;
  -}
  -
  -/**************************************************************/
  -/*                                                            */
  -/* DUP freearg TYPEMAP FOR const XMLCh *actualEncStr ARGUMENT */
  -/*                                                            */
  -/**************************************************************/
  -%typemap(perl5, freearg) const XMLCh *actualEncStr = XMLCh *actualEncStr;
  -
  -
   /*******************/
   /*                 */
  -/* target ARGUMENT */
  +/*  INCLUDE FILES  */
   /*                 */
   /*******************/
  -%typemap(perl5, in) XMLCh *target (XMLCh *temp_target) {
  -  if (  SvPOK( $source )  ) {
  -    char *ptr = (char *)SvPV( $source, na );
  -    $target = temp_target = XMLString::transcode(ptr);
  -  } else {
  -    croak("Type error in argument 2 of $name, Expected perl-string.");
  -    XSRETURN(1);
  -  }
  -}
  -
  -/***************************************************/
  -/*                                                 */
  -/* DUP in TYPEMAP FOR const XMLCh *target ARGUMENT */
  -/*                                                 */
  -/***************************************************/
  -%typemap(perl5, in) const XMLCh *target = XMLCh *target;
  -
  -/**********************************************************/
  -/*                                                        */
  -/* KLUDGE! CLEAN UP WHAT temp_target ABOVE IS POINTING TO */
  -/*                                                        */
  -/**********************************************************/
  -%typemap(perl5, freearg) XMLCh *target {
  -  delete[] temp_target;
  -}
  -
  -/********************************************************/
  -/*                                                      */
  -/* DUP freearg TYPEMAP FOR const XMLCh *target ARGUMENT */
  -/*                                                      */
  -/********************************************************/
  -%typemap(perl5, freearg) const XMLCh *target = XMLCh *target;
  -
  -
  -/*****************/
  -/*               */
  -/* data ARGUMENT */
  -/*               */
  -/*****************/
  -%typemap(perl5, in) XMLCh *data (XMLCh *temp_data) {
  -  if (  SvPOK( $source )  ) {
  -    char *ptr = (char *)SvPV( $source, na );
  -    $target = temp_data = XMLString::transcode(ptr);
  -  } else {
  -    croak("Type error in argument 2 of $name, Expected perl-string.");
  -    XSRETURN(1);
  -  }
  -}
   
  -/*************************************************/
  -/*                                               */
  -/* DUP in TYPEMAP FOR const XMLCh *data ARGUMENT */
  -/*                                               */
  -/*************************************************/
  -%typemap(perl5, in) const XMLCh *data = XMLCh *data;
  -
  -/********************************************************/
  -/*                                                      */
  -/* KLUDGE! CLEAN UP WHAT temp_data ABOVE IS POINTING TO */
  -/*                                                      */
  -/********************************************************/
  -%typemap(perl5, freearg) XMLCh *data {
  -  delete[] temp_data;
  -}
  +%pragma nodefault
   
  -/******************************************************/
  -/*                                                    */
  -/* DUP freearg TYPEMAP FOR const XMLCh *data ARGUMENT */
  -/*                                                    */
  -/******************************************************/
  -%typemap(perl5, freearg) const XMLCh *data = XMLCh *data;
  -
  -
  -/********************/
  -/*                  */
  -/* GENERIC ARGUMENT */
  -/*                  */
  -/********************/
  -%typemap(perl5, in) XMLCh * (XMLCh *temp) {
  -  if (  SvPOK( $source )  ) {
  -    char *ptr = (char *)SvPV( $source, na );
  -    $target = temp = XMLString::transcode(ptr);
  -  } else {
  -    croak("Type error in argument 2 of $name, Expected perl-string.");
  -    XSRETURN(1);
  -  }
  -}
  +// We have to define these in order to get past the occurrence of the
  +// macro in class declaration line
  +#define SAX_EXPORT
  +#define PLATFORM_EXPORT
  +#define PLATFORM_IMPORT
  +#define PARSERS_EXPORT
  +#define CDOM_EXPORT
  +#define SAX2_EXPORT
  +#define XMLUTIL_EXPORT
  +#define PARSERS_EXPORT
  +#define XMLPARSER_EXPORT
  +#define VALIDATORS_EXPORT
   
  -/*****************************************************/
  -/*                                                   */
  -/* DUP in TYPEMAP FOR const XMLCh * GENERIC ARGUMENT */
  -/*                                                   */
  -/*****************************************************/
  -%typemap(perl5, in) const XMLCh * = XMLCh *;
  -
  -/***************************************************/
  -/*                                                 */
  -/* KLUDGE! CLEAN UP WHAT temp ABOVE IS POINTING TO */
  -/*                                                 */
  -/***************************************************/
  -%typemap(perl5, freearg) XMLCh * {
  -  delete[] temp;
  +/*
  + * The generic exception handler
  + */
  +%except(perl5) {
  +    try {
  +        $function
  +    } 
  +    catch (const XMLException& e)
  +        {
  +            PerlExceptionHandler* handler;
  +            handler = PerlExceptionHandler::getInstance();
  +            handler->catchXMLException(e);
  +        }
  +    catch (...)
  +        {
  +            XMLPlatformUtils::Terminate();
  +            croak("%s", "Handling Unknown exception");
  +        }
   }
   
  -/**********************************************************/
  -/*                                                        */
  -/* DUP freearg TYPEMAP FOR const XMLCh * GENERIC ARGUMENT */
  -/*                                                        */
  -/**********************************************************/
  -%typemap(perl5, freearg) const XMLCh * = XMLCh *;
  +// we remove this macro for PlatformUtils and XMLURL
  +#define MakeXMLException(theType, expKeyword)
   
  +/* 
  + * NEEDED FOR INITIALIZATION AND TERMINATION 
  + */
  +%rename(operator_assignment) operator=;
  +%rename(operator_equal_to) operator==;
  +%rename(operator_not_equal_to) operator!=;
  +%ignore XMLPlatformUtils::fgTransService;
  +%ignore XMLPlatformUtils::fgNetAccessor;
  +%include "Xerces_headers/util/PlatformUtils.hpp"
   
   /*
  - * RETURN VALUE OF getMessage METHOD ON A saxException (WHAT A 
  - * perlErrorHandler) FUNCTION SUCH AS "warning" RECEIVES AS AN ARGUMENT
  + * Utility Classes
    */
  -%typemap(perl5, out) XMLCh * {
  -  char *cptr = XMLString::transcode($source);
  +%ignore XMLURL::XMLURL(const   XMLCh* const, const XMLCh* const);
  +%rename(XMLURL__constructor__base) XMLURL::XMLURL(const   XMLCh* const, const char* const);
  +%rename(XMLURL__constructor__text) XMLURL::XMLURL(const char* const);
  +%ignore XMLURL::XMLURL(const   XMLCh* const);
  +%ignore XMLURL::XMLURL(const   XMLCh&, const XMLCh* const);
  +%ignore XMLURL::XMLURL(const   XMLCh&, const char* const);
  +
  +%include "util/XMLURL.hpp"
  +%include "Xerces_headers/util/XMLUri.hpp"
  +%include "util/QName.hpp"
  +
  +// although not really necessary for Perl, why not?
  +%include "util/HexBin.hpp"
  +%include "util/Base64.hpp"
  +
  +// do we need these Unicode string constants?
  +// %include "util/XMLUni.hpp"
  +
  +// does anyone want to use this class for formatting Unicode?
  +// %include "framework/XMLFormatter.hpp"
  +
  +
  +// Perl has no need for these methods
  +// %include "util/XMLStringTokenizer.hpp"
  +
  +// this macro will get redefined and swig 1.3.8 thinks that's an error
  +#undef MakeXMLException
  +%include "util/XMLExceptMsgs.hpp"
  +%include "util/XMLException.hpp"
  +
  +// in case someone wants to re-use validators
  +%include "framework/XMLValidator.hpp"
  +
  +// I will wait until someone asks for these scanner classes
  +// %include "framework/XMLAttDef.hpp"
  +// %include "framework/XMLAttDefList.hpp"
  +// %include "framework/XMLAttr.hpp"
  +// %include "framework/XMLContentModel.hpp"
  +// %include "framework/XMLElementDecl.hpp"
  +// %include "framework/XMLEntityDecl.hpp"
  +// %include "framework/XMLNotationDecl.hpp"
  +// %include "framework/XMLEntityHandler.hpp"
  +// %include "framework/XMLErrorCodes.hpp"
  +// %include "framework/XMLValidityCodes.hpp"
  +// %include "framework/XMLDocumentHandler.hpp"
   
  -  $target = sv_newmortal();
  -  sv_setpv( (SV*)$target, (char *)cptr );
  -  delete[] cptr;
  -  ++argvi;
  -}
  -
  -%typemap(perl5, out) const XMLCh * = XMLCh *;
  +/* 
  + * FOR SAX 1.0 API 
  + */
  +%include "sax/SAXException.hpp"
  +%include "sax/SAXParseException.hpp"
  +%include "sax/ErrorHandler.hpp"
  +%include "sax/DTDHandler.hpp"
  +%include "sax/DocumentHandler.hpp"
  +%include "sax/EntityResolver.hpp"
  +%include "sax/AttributeList.hpp"
  +%include "sax/HandlerBase.hpp"
  +%include "sax/Locator.hpp"
   
  +/* 
  + * FOR SAX 2.0 API 
  + */
  +%include "sax2/Attributes.hpp"
  +%include "sax2/ContentHandler.hpp"
  +%include "sax2/LexicalHandler.hpp"
  +%include "sax2/DefaultHandler.hpp"
  +%include "sax2/XMLReaderFactory.hpp"
   
  -/*
  - * FOR MemBufInputSource CONSTRUCTOR, ALWAYS ADOPT BUFFER (I.E. MAKE A COPY 
  - * OF IT) SINCE IT IS TAKEN FROM PERL, AND WHO KNOWS WHAT WILL HAPPEN TO IT
  - * AFTER IT IS GIVEN TO THE CONSTRUCTOR
  - */
  -%typemap(perl5, in) XMLByte *srcDocBytes {
  -  STRLEN length;
  -  if (  SvPOK( $source )  ) {
  -    XMLByte *xmlbytes = (XMLByte *)SvPV( $source, length );
  -    $target = new XMLByte[length];
  -    memcpy($target, xmlbytes, length);
  -#ifdef SWIG_1_1
  -    _arg1 = length;	// MAJOR KLUDGE -- SHOULDN'T HAVE TO PASS FROM PERL -- CALCULATED AUTOMATICALLY
  -#else
  -    arg1 = length;	// MAJOR KLUDGE -- SHOULDN'T HAVE TO PASS FROM PERL -- CALCULATED AUTOMATICALLY
  -#endif
  -  } else {
  -    croak("Type error in argument 2 of $name, Expected perl-string.");
  -    XSRETURN(1);
  -  }
  -}
  -%typemap(perl5, in) const XMLByte *srcDocBytes = XMLByte *srcDocBytes;
  +/* 
  + * FOR ERROR HANDLING and other callbacks  
  + */
  +%include "PerlErrorCallbackHandler.swig.hpp"
  +%include "PerlDocumentCallbackHandler.swig.hpp"
  +%include "PerlContentCallbackHandler.swig.hpp"
  +%include "PerlExceptionHandler.swig.hpp"
  +%include "PerlEntityResolverHandler.swig.hpp" 
   
  -/* PERL SHOULD IGNORE THIS ARGUMENT -- CALCULATE IN KLUDGE ABOVE FOR MemBufInputSource */
  -%typemap(perl5, ignore) unsigned int byteCount {
  -}
  -%typemap(perl5, ignore) const unsigned int byteCount = unsigned int byteCount;
  +/* 
  + * THE NEW DOM IMPLEMENATION 
  + */
   
  -%typemap(perl5, ignore) bool adoptBuffer {
  -  $target = true;
  -}
  -%typemap(perl5, ignore) const bool adoptBuffer = bool adoptBuffer;
  +// the IDOM classes gets a special exception handler
  +%except(perl5) {
  +    try {
  +        $function
  +    } 
  +    catch (const XMLException& e)
  +        {
  +            PerlExceptionHandler* handler;
  +            handler = PerlExceptionHandler::getInstance();
  +            handler->catchXMLException(e);
  +        }
  +    catch (const IDOM_DOMException& toCatch)
  +    {
  +            PerlExceptionHandler* handler;
  +            handler = PerlExceptionHandler::getInstance();
  +            handler->catchIDOMException(toCatch);
  +    }
  +    catch (...)
  +        {
  +            XMLPlatformUtils::Terminate();
  +            croak("%s", "Handling Unknown exception");
  +        }
  +}
  +
  +%include "idom/IDOM_Node.hpp"
  +%include "idom/IDOM_Attr.hpp"
  +%include "idom/IDOM_CharacterData.hpp"
  +%include "idom/IDOM_Text.hpp"
  +%include "idom/IDOM_CDATASection.hpp"
  +%include "idom/IDOM_Comment.hpp"
  +%include "idom/IDOM_Document.hpp"
  +%include "idom/IDOM_DocumentFragment.hpp"
  +%include "idom/IDOM_DocumentType.hpp"
  +%include "idom/IDOM_DOMException.hpp"
  +%include "idom/IDOM_DOMImplementation.hpp"
  +%include "idom/IDOM_Element.hpp"
  +%include "idom/IDOM_Entity.hpp"
  +%include "idom/IDOM_EntityReference.hpp"
  +%include "idom/IDOM_NamedNodeMap.hpp"
  +%include "idom/IDOM_NodeFilter.hpp"
  +%include "idom/IDOM_NodeIterator.hpp"
  +%include "idom/IDOM_NodeList.hpp"
  +%include "idom/IDOM_Notation.hpp"
  +%include "idom/IDOM_ProcessingInstruction.hpp"
  +%include "idom/IDOM_Range.hpp"
  +%include "idom/IDOM_RangeException.hpp"
  +%include "idom/IDOM_TreeWalker.hpp"
   
  -/*
  - * FOR perlErrorHandler MEMBER FUNCTIONS, SO PERL SCALAR DOESN'T GET WRAPPED 
  - * BY SWIG
  +/* 
  + * The old DOM implementation
  + */
  +// the DOM classes gets a special exception handler
  +%except(perl5) {
  +    try {
  +        $function
  +    } 
  +    catch (const XMLException& e)
  +        {
  +            PerlExceptionHandler* handler;
  +            handler = PerlExceptionHandler::getInstance();
  +            handler->catchXMLException(e);
  +        }
  +    catch (const DOM_DOMException& toCatch)
  +    {
  +            PerlExceptionHandler* handler;
  +            handler = PerlExceptionHandler::getInstance();
  +            handler->catchDOMException(toCatch);
  +    }
  +    catch (...)
  +        {
  +            XMLPlatformUtils::Terminate();
  +            croak("%s", "Handling Unknown exception");
  +        }
  +}
  +
  +// we ignore the nulling operator= and the != NULL operator
  +%ignore operator_assignment(const DOM_NullPtr *);
  +%ignore operator_not_equal_to(const DOM_NullPtr *);
  + 
  +%include "dom/DOMString.hpp"
  +%include "dom/DOM_Node.hpp"
  +%rename(DOM_Attr__constructor__copy) DOM_Attr(const DOM_Attr&);
  +%include "dom/DOM_Attr.hpp"
  +%include "dom/DOM_CharacterData.hpp"
  +%include "dom/DOM_Text.hpp"
  +%include "dom/DOM_CDATASection.hpp"
  +%include "dom/DOM_Comment.hpp"
  +%include "dom/DOM_DOMException.hpp"
  +%include "dom/DOM_DOMImplementation.hpp"
  +%include "dom/DOM_Document.hpp"
  +%include "dom/DOM_DocumentFragment.hpp"
  +%include "dom/DOM_DocumentType.hpp"
  +%include "dom/DOM_Element.hpp"
  +%include "dom/DOM_Entity.hpp"
  +%include "dom/DOM_EntityReference.hpp"
  +%include "dom/DOM_NamedNodeMap.hpp"
  +%include "dom/DOM_NodeFilter.hpp"
  +%include "dom/DOM_NodeIterator.hpp"
  +%include "dom/DOM_NodeList.hpp"
  +%include "dom/DOM_Notation.hpp"
  +%include "dom/DOM_ProcessingInstruction.hpp"
  +%include "dom/DOM_Range.hpp"
  +%include "dom/DOM_RangeException.hpp"
  +
  +// this method is broken -- it is declared in the header, but never defined
  +%ignore DOM_TreeWalker::getExpandEntityReferences();
  +%include "dom/DOM_TreeWalker.hpp"
  +
  +%rename(DOM_XMLDecl__constructor__copy) DOM_XMLDecl(const DOM_XMLDecl&);
  +%include "dom/DOM_XMLDecl.hpp"
  +
  +/* 
  + * INPUT SOURCES 
  + *
    */
  -%typemap(perl5, in) SV * {
  -  $target = $source;
  +// we return to our previously scheduled handler
  +%except(perl5) {
  +    try {
  +        $function
  +    } 
  +    catch (const XMLException& e)
  +        {
  +            PerlExceptionHandler* handler;
  +            handler = PerlExceptionHandler::getInstance();
  +            handler->catchXMLException(e);
  +        }
  +    catch (...)
  +        {
  +            XMLPlatformUtils::Terminate();
  +            croak("%s", "Handling Unknown exception");
  +        }
   }
  +%include "sax/InputSource.hpp"
   
  -/*******************/
  -/*                 */
  -/*  INCLUDE FILES  */
  -/*                 */
  -/*******************/
  -/* NECESSARY SUPPORT FILES (typedefs 'N THINGS) */
  -%include "Xerces_headers/util/XercesDefs.hpp"
  -%include "Xerces_headers/util/XMLURL.hpp"
  -%include "Xerces_headers/util/XMLException.hpp"
  -%include "Xerces_headers/util/Compilers/GCCDefs.hpp"
  +%ignore MemBufInputSource(const XMLByte* const, const unsigned int, const XMLCh* const,const bool);
  +%include "framework/MemBufInputSource.hpp"
  +%include "Xerces_headers/framework/StdInInputSource.hpp"
   
  -/* NEEDED FOR INITIALIZATION AND TERMINATION */
  -%include "Xerces_headers/util/PlatformUtils.hpp"
  +%rename(LocalFileInputSource__constructor__base) LocalFileInputSource(const XMLCh* const,const XMLCh* const);
  +%include "framework/LocalFileInputSource.hpp"
   
  -/* FOR SAX 1.0 API */
  -%include "Xerces_headers/sax/SAXException.hpp"
  -%include "Xerces_headers/sax/SAXParseException.hpp"
  -%include "Xerces_headers/sax/ErrorHandler.hpp"
  -%include "Xerces_headers/sax/DTDHandler.hpp"
  -%include "Xerces_headers/sax/DocumentHandler.hpp"
  -%include "Xerces_headers/sax/EntityResolver.hpp"
  -%include "Xerces_headers/sax/AttributeList.hpp"
  -%include "Xerces_headers/sax/HandlerBase.hpp"
  -%include "Xerces_headers/sax/Locator.hpp"
  -
  -/* FOR SAX 2.0 API */
  -%include "Xerces_headers/sax2/Attributes.hpp"
  -%include "Xerces_headers/sax2/ContentHandler.hpp"
  -%include "Xerces_headers/sax2/LexicalHandler.hpp"
  -%include "Xerces_headers/sax2/DefaultHandler.hpp"
  -%include "Xerces_headers/sax2/SAX2XMLReader.hpp"
  -%include "Xerces_headers/sax2/XMLReaderFactory.hpp"
  +%rename(URLInputSource__constructor__pub) URLInputSource(const XMLCh* const,const char* const,const char* const);
  +%rename(URLInputSource__constructor__sys) URLInputSource(const XMLCh* const,const char* const);
  +%ignore URLInputSource(const XMLCh* const,const XMLCh* const, const XMLCh* const);
  +%ignore URLInputSource(const XMLCh* const,const XMLCh* const);
  +%include "framework/URLInputSource.hpp"
  +
  +/* 
  + * PARSERS (PRETTY IMPORTANT) 
  + *
  + */
  +// scan token helper class for progressive parsing
  +// has assignment operator and needs private header
  +%include "Xerces_headers/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 );
   
  -/* FOR ERROR HANDLING (PARSER EXCEPTIONS IN PARTICULAR) */
  -%include "PerlErrorCallbackHandler.swig.hpp"
  -%include "PerlDocumentCallbackHandler.swig.hpp"
  -%include "PerlContentCallbackHandler.swig.hpp"
  -%include "PerlExceptionHandler.swig.hpp"
  -%include "PerlEntityResolverHandler.swig.hpp" 
  +/*
  + * methods not needed by the public Parser interfaces
  + *
  + *   this is probably because I'm not using AdvDocHandlers and things
  + *   that want to control the parsing process, but until someone asks
  + *   for them, I'm going to leave them out.
  + */
   
  -/* INCLUDE FILES IN "idom" DIRECTORY, THE NEW DOM IMPLEMENATION */
  -%include "Xerces_headers/idom/IDOM_Attr.hpp"
  -%include "Xerces_headers/idom/IDOM_CDATASection.hpp"
  -%include "Xerces_headers/idom/IDOM_CharacterData.hpp"
  -%include "Xerces_headers/idom/IDOM_Comment.hpp"
  -%include "Xerces_headers/idom/IDOM_Document.hpp"
  -%include "Xerces_headers/idom/IDOM_DocumentFragment.hpp"
  -%include "Xerces_headers/idom/IDOM_DocumentType.hpp"
  -%include "Xerces_headers/idom/IDOM_DOMException.hpp"
  -%include "Xerces_headers/idom/IDOM_DOMImplementation.hpp"
  -%include "Xerces_headers/idom/IDOM_Element.hpp"
  -%include "Xerces_headers/idom/IDOM_Entity.hpp"
  -%include "Xerces_headers/idom/IDOM_EntityReference.hpp"
  -%include "Xerces_headers/idom/IDOM_NamedNodeMap.hpp"
  -%include "Xerces_headers/idom/IDOM_Node.hpp"
  -%include "Xerces_headers/idom/IDOM_NodeFilter.hpp"
  -%include "Xerces_headers/idom/IDOM_NodeIterator.hpp"
  -%include "Xerces_headers/idom/IDOM_NodeList.hpp"
  -%include "Xerces_headers/idom/IDOM_Notation.hpp"
  -%include "Xerces_headers/idom/IDOM_ProcessingInstruction.hpp"
  -%include "Xerces_headers/idom/IDOM_Range.hpp"
  -%include "Xerces_headers/idom/IDOM_RangeException.hpp"
  -%include "Xerces_headers/idom/IDOM_Text.hpp"
  -%include "Xerces_headers/idom/IDOM_TreeWalker.hpp"
  -
  -/* INCLUDE FILES IN "dom" DIRECTORY, ESSENTIALLY ALL OF THESE ARE NODE TYPES */
  -%include "Xerces_headers/dom/DOMString.hpp"
  -%include "Xerces_headers/dom/DOM_Node.hpp"
  -%include "Xerces_headers/dom/DOM_Attr.hpp"
  -%include "Xerces_headers/dom/DOM_CharacterData.hpp"
  -%include "Xerces_headers/dom/DOM_Text.hpp"
  -%include "Xerces_headers/dom/DOM_CDATASection.hpp"
  -%include "Xerces_headers/dom/DOM_Comment.hpp"
  -%include "Xerces_headers/dom/DOM_DOMException.hpp"
  -%include "Xerces_headers/dom/DOM_DOMImplementation.hpp"
  -%include "Xerces_headers/dom/DOM_Document.hpp"
  -%include "Xerces_headers/dom/DOM_DocumentFragment.hpp"
  -%include "Xerces_headers/dom/DOM_DocumentType.hpp"
  -%include "Xerces_headers/dom/DOM_Element.hpp"
  -%include "Xerces_headers/dom/DOM_Entity.hpp"
  -%include "Xerces_headers/dom/DOM_EntityReference.hpp"
  -%include "Xerces_headers/dom/DOM_NamedNodeMap.hpp"
  -%include "Xerces_headers/dom/DOM_NodeFilter.hpp"
  -%include "Xerces_headers/dom/DOM_NodeIterator.hpp"
  -%include "Xerces_headers/dom/DOM_NodeList.hpp"
  -%include "Xerces_headers/dom/DOM_Notation.hpp"
  -%include "Xerces_headers/dom/DOM_ProcessingInstruction.hpp"
  -%include "Xerces_headers/dom/DOM_Range.hpp"
  -%include "Xerces_headers/dom/DOM_RangeException.hpp"
  -%include "Xerces_headers/dom/DOM_TreeWalker.hpp"
  -%include "Xerces_headers/dom/DOM_XMLDecl.hpp"
  -
  -/* INPUT SOURCES */
  -%include "Xerces_headers/sax/InputSource.hpp"
  -%include "Xerces_headers/framework/LocalFileInputSource.hpp"
  -%include "Xerces_headers/framework/MemBufInputSource.hpp"
  -%include "Xerces_headers/framework/StdInInputSource.hpp"
  -%include "Xerces_headers/framework/URLInputSource.hpp"
  +// XMLEntityHandler interface
  +%ignore endInputSource;
  +%ignore expandSystemId;
  +%ignore resetEntities;
  +%ignore resolveEntity;
  +%ignore startInputSource;
  +
  +// XMLDocumentHandler interface.
  +%ignore docCharacters;
  +%ignore docComment;
  +%ignore docPI;
  +%ignore endDocument;
  +%ignore endElement;
  +%ignore endEntityReference;
  +%ignore ignorableWhitespace;
  +%ignore resetDocument;
  +%ignore startDocument;
  +%ignore startElement;
  +%ignore startEntityReference;
  +%ignore XMLDecl;
  +
  +// depricated methods - don't ask me to include these
  +%ignore getDoValidation;
  +%ignore setDoValidation;
  +%ignore attDef;
  +%ignore doctypeComment;
  +%ignore doctypeDecl;
  +%ignore doctypePI;
  +%ignore doctypeWhitespace;
  +%ignore elementDecl;
  +%ignore endAttList;
  +%ignore endIntSubset;
  +%ignore endExtSubset;
  +%ignore entityDecl;
  +%ignore resetDocType;
  +%ignore notationDecl;
  +%ignore startAttList;
  +%ignore startIntSubset;
  +%ignore startExtSubset;
  +%ignore TextDecl;
  +
  +// %include "sax/Parser.hpp"
  +%include "sax2/SAX2XMLReader.hpp"
  +%include "parsers/SAXParser.hpp"
  +%include "parsers/DOMParser.hpp"
  +%include "parsers/IDOMParser.hpp"
  +
  +/* %pragma(perl5) include="Xerces-extra.pm" */
   
  -/* THE PARSER (PRETTY IMPORTANT) */
  -%include "Xerces_headers/parsers/SAXParser.hpp"
  -%include "Xerces_headers/parsers/DOMParser.hpp"
  -%include "Xerces_headers/parsers/IDOMParser.hpp"
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org