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 2006/10/13 23:34:17 UTC

svn commit: r463845 [1/2] - in /xerces/c/trunk/swig/interfaces: ./ Perl/ dom/ framework/ parsers/

Author: jasons
Date: Fri Oct 13 14:34:15 2006
New Revision: 463845

URL: http://svn.apache.org/viewvc?view=rev&rev=463845
Log:
updated for sub-module reorg

Modified:
    xerces/c/trunk/swig/interfaces/Perl/Xerces-extra.pm
    xerces/c/trunk/swig/interfaces/Perl/Xerces_DOM-extra.pm
    xerces/c/trunk/swig/interfaces/Perl/callback.i
    xerces/c/trunk/swig/interfaces/Perl/defines.i
    xerces/c/trunk/swig/interfaces/Perl/dom-callback.i
    xerces/c/trunk/swig/interfaces/Perl/dom-shadow.i
    xerces/c/trunk/swig/interfaces/Perl/includes.i
    xerces/c/trunk/swig/interfaces/Perl/shadow.i
    xerces/c/trunk/swig/interfaces/Perl/typemaps-xmlch.i
    xerces/c/trunk/swig/interfaces/Perl/typemaps.i
    xerces/c/trunk/swig/interfaces/SAX.i
    xerces/c/trunk/swig/interfaces/SAX2.i
    xerces/c/trunk/swig/interfaces/Xerces.i
    xerces/c/trunk/swig/interfaces/Xerces_DOM.i
    xerces/c/trunk/swig/interfaces/defines.i
    xerces/c/trunk/swig/interfaces/dom-includes.i
    xerces/c/trunk/swig/interfaces/dom/DOMImplementation.i
    xerces/c/trunk/swig/interfaces/dom/DOMImplementationRegistry.i
    xerces/c/trunk/swig/interfaces/dom/DOMLSParserFilter.i
    xerces/c/trunk/swig/interfaces/dom/DOMXPathResult.i
    xerces/c/trunk/swig/interfaces/framework/Wrapper4InputSource.i
    xerces/c/trunk/swig/interfaces/framework/XMLFormatter.i
    xerces/c/trunk/swig/interfaces/grammars.i
    xerces/c/trunk/swig/interfaces/ignore.i
    xerces/c/trunk/swig/interfaces/includes.i
    xerces/c/trunk/swig/interfaces/parsers.i
    xerces/c/trunk/swig/interfaces/parsers/AbstractDOMParser.i
    xerces/c/trunk/swig/interfaces/typemaps-dom.i
    xerces/c/trunk/swig/interfaces/typemaps-general.i
    xerces/c/trunk/swig/interfaces/util.i

Modified: xerces/c/trunk/swig/interfaces/Perl/Xerces-extra.pm
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/Perl/Xerces-extra.pm?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/Perl/Xerces-extra.pm (original)
+++ xerces/c/trunk/swig/interfaces/Perl/Xerces-extra.pm Fri Oct 13 14:34:15 2006
@@ -3,8 +3,8 @@
 use strict;
 use Carp;
 use vars qw(@EXPORT_OK $VERSION %REMEMBER);
-@EXPORT_OK = qw(error);
-$VERSION = 300.060829;
+@EXPORT_OK = qw(fatal_error error);
+$VERSION = 300.061003;
 
 #
 # Cleanup removes all objects being remembered by an object
@@ -23,9 +23,16 @@
 #   }
 }
 
+sub fatal_error {
+  my $error = shift;
+  my $context = shift;
+  error($error,$context, my $fatal = 1);
+}
+
 sub error {
   my $error = shift;
   my $context = shift;
+  my $fatal = defined (shift) ? 1 : 0;
   my $msg = "Error in eval: ";
   if (ref $error) {
     if ($error->isa('XML::Xerces::DOMException')) {
@@ -41,29 +48,13 @@
   }
   $msg .= ", Context: $context"
     if defined $context;
-  croak($msg);
+  if ($fatal) {
+    croak($msg);
+  } else {
+    carp($msg);
+  }
 }
 
-package XML::Xerces::DOMException;
-use vars qw(@CODES);
-@CODES = qw(__NONEXISTENT__
-	    INDEX_SIZE_ERR
-	    DOMSTRING_SIZE_ERR
-	    HIERARCHY_REQUEST_ERR
-	    WRONG_DOCUMENT_ERR
-	    INVALID_CHARACTER_ERR
-	    NO_DATA_ALLOWED_ERR
-	    NO_MODIFICATION_ALLOWED_ERR
-	    NOT_FOUND_ERR
-	    NOT_SUPPORTED_ERR
-	    INUSE_ATTRIBUTE_ERR
-	    INVALID_STATE_ERR
-	    SYNTAX_ERR
-	    INVALID_MODIFICATION_ERR
-	    NAMESPACE_ERR
-	    INVALID_ACCESS_ERR
-	   );
-
 package XML::Xerces::XMLExcepts;
 use vars qw(@CODES);
 @CODES = qw(NoError
@@ -472,53 +463,10 @@
 	    E_HighBounds
 	   );
 
-############# Class : XML::Xerces::PerlContentHandler ##############
-package XML::Xerces::PerlContentHandler;
-use vars qw(@ISA);
-@ISA = qw();
-sub new {
-  my $class = shift;
-  return bless {}, $class;
-}
-
-sub start_element {}
-sub end_element {}
-sub start_prefix_mapping {}
-sub end_prefix_mapping {}
-sub skipped_entity {}
-sub start_document {}
-sub end_document {}
-sub reset_document {}
-sub characters {}
-sub processing_instruction {}
-sub set_document_locator {}
-sub ignorable_whitespace {}
-
-
-############# Class : XML::Xerces::PerlDocumentHandler ##############
-package XML::Xerces::PerlDocumentHandler;
-use vars qw(@ISA);
-@ISA = qw();
-sub new {
-  my $class = shift;
-  return bless {}, $class;
-}
-
-sub start_element {}
-sub end_element {}
-sub start_document {}
-sub end_document {}
-sub reset_document {}
-sub characters {}
-sub processing_instruction {}
-sub set_document_locator {}
-sub ignorable_whitespace {}
-
-
 ############# Class : XML::Xerces::PerlEntityResolver ##############
 package XML::Xerces::PerlEntityResolver;
 use vars qw(@ISA);
-@ISA = qw();
+@ISA = qw(XML::Xerces::XMLEntityResolver XML::Xerces::EntityResolver);
 sub new {
   my $class = shift;
   return bless {}, $class;
@@ -529,20 +477,6 @@
 }
 
 
-############# Class : XML::Xerces::PerlNodeFilter ##############
-package XML::Xerces::PerlNodeFilter;
-use vars qw(@ISA);
-@ISA = qw();
-sub new {
-  my $class = shift;
-  return bless {}, $class;
-}
-
-sub acceptNode {
-  return undef;
-}
-
-
 ############# Class : XML::Xerces::PerlErrorHandler ##############
 package XML::Xerces::PerlErrorHandler;
 use Carp;
@@ -598,6 +532,20 @@
 
 sub reset_errors {}
 
+package XML::Xerces::XMLChVector;
+# convert the XMLChVector to a perl list
+sub to_list {
+  my $self = shift;
+  my @list;
+  my $count = $self->size();
+  if ($count) {
+    for (my $i=0;$i<$count;$i++) {
+      push(@list,$self->elementAt($i));
+    }
+  }
+  return @list;
+}
+
 package XML::Xerces::XMLAttDefList;
 #
 # This class is both a list and a hash, so at the moment we
@@ -609,9 +557,10 @@
 sub to_list {
   my $self = shift;
   my @list;
-  if ($self->hasMoreElements()) {
-    while ($self->hasMoreElements()) {
-      push(@list,$self->nextElement());
+  my $count = $self->getAttDefCount();
+  if ($count) {
+    for (my $i=0;$i<$count;$i++) {
+      push(@list,$self->getAttDef($i));
     }
   }
   return @list;
@@ -621,39 +570,16 @@
 sub to_hash {
   my $self = shift;
   my %hash;
-  if ($self->hasMoreElements()) {
-    while ($self->hasMoreElements()) {
-      my $attr = $self->nextElement();
+  my $count = $self->getAttDefCount();
+  if ($count) {
+    for (my $i=0;$i<$count;$i++) {
+      my $attr = $self->getAttDef($i);
       $hash{$attr->getFullName()} = $attr;
     }
   }
   return %hash;
 }
 
-package XML::Xerces::Attributes;
-sub to_hash {
-  my $self = shift;
-  my %hash;
-  for (my $i=0; $i < $self->getLength(); $i++) {
-    my $qname = $self->getQName($i);
-    $hash{$qname}->{localName} = $self->getLocalName($i);
-    $hash{$qname}->{URI} = $self->getURI($i);
-    $hash{$qname}->{value} = $self->getValue($i);
-    $hash{$qname}->{type} = $self->getType($i);
-  }
-  return %hash;
-}
-
-package XML::Xerces::AttributeList;
-sub to_hash {
-  my $self = shift;
-  my %hash;
-  for (my $i=0;$i<$self->getLength();$i++) {
-    $hash{$self->getName($i)} = $self->getValue($i)
-  }
-  return %hash;
-}
-
 package XML::Xerces::XMLCatalogResolver;
 use strict;
 use Carp;
@@ -680,7 +606,7 @@
 sub initialize {
   my $self = shift;
   my $CATALOG = $self->catalog();
-  XML::Xerces::error (__PACKAGE__ . ": Must set catalog before calling initialize")
+  XML::Xerces::fatal_error(__PACKAGE__ . ": Must set catalog before calling initialize")
       unless defined $CATALOG;
 
   my $DOM = XML::Xerces::XercesDOMParser->new();
@@ -689,7 +615,7 @@
 
   # we parse the example XML Catalog
   eval{$DOM->parse($CATALOG)};
-  XML::Xerces::error ($@, __PACKAGE__ . ": Couldn't parse catalog: $CATALOG")
+  XML::Xerces::fatal_error($@, __PACKAGE__ . ": Couldn't parse catalog: $CATALOG")
       if $@;
 
   # now retrieve the mappings and store them
@@ -733,7 +659,10 @@
   # print STDERR "Got PUBLIC: $pub\n";
   # print STDERR "Got SYSTEM: $sys\n";
 
-  XML::Xerces::error (__PACKAGE__ . ": Must call initialize before using the resolver")
+  #
+  # FIXME - this should be creating and throwing an exception
+  #
+  XML::Xerces::fatal_error(__PACKAGE__ . ": Must call initialize before using the resolver")
       unless defined $self->maps or defined $self->remaps;
 
   # now check which one we were asked for

Modified: xerces/c/trunk/swig/interfaces/Perl/Xerces_DOM-extra.pm
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/Perl/Xerces_DOM-extra.pm?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/Perl/Xerces_DOM-extra.pm (original)
+++ xerces/c/trunk/swig/interfaces/Perl/Xerces_DOM-extra.pm Fri Oct 13 14:34:15 2006
@@ -1,3 +1,23 @@
+package XML::Xerces::DOMException;
+use vars qw(@CODES);
+@CODES = qw(__NONEXISTENT__
+	    INDEX_SIZE_ERR
+	    DOMSTRING_SIZE_ERR
+	    HIERARCHY_REQUEST_ERR
+	    WRONG_DOCUMENT_ERR
+	    INVALID_CHARACTER_ERR
+	    NO_DATA_ALLOWED_ERR
+	    NO_MODIFICATION_ALLOWED_ERR
+	    NOT_FOUND_ERR
+	    NOT_SUPPORTED_ERR
+	    INUSE_ATTRIBUTE_ERR
+	    INVALID_STATE_ERR
+	    SYNTAX_ERR
+	    INVALID_MODIFICATION_ERR
+	    NAMESPACE_ERR
+	    INVALID_ACCESS_ERR
+	   );
+
 package XML::Xerces::DOMNodeList;
 # convert the NodeList to a perl list
 sub to_list {
@@ -200,3 +220,82 @@
   return $self->getTextContent(@_);
 }
 
+############# Class : XML::Xerces::PerlNodeFilter ##############
+package XML::Xerces::PerlNodeFilter;
+use vars qw(@ISA);
+@ISA = qw(XML::Xerces::DOMNodeFilter
+	  XML::Xerces::DOMLSParserFilter
+	  XML::Xerces::DOMLSSerializerFilter);
+
+sub new {
+  my $class = shift;
+
+  # support copy constructor syntax
+  $class = ref($class) if ref($class);
+
+  return bless {}, $class;
+}
+
+sub acceptNode {
+  my $self = shift;
+  return $self->accept_node(@_);
+}
+
+sub getWhatToShow {
+  my $self = shift;
+  return $self->get_what_to_show();
+}
+
+sub startElement {
+  my $self = shift;
+  return $self->start_element(@_);
+}
+
+#
+# support alternate Perl-friendly syntax
+#
+sub accept_node {
+  return undef;
+}
+
+sub get_what_to_whow {
+  return undef;
+}
+
+sub start_element {
+  return undef;
+}
+
+
+############# Class : XML::Xerces::PerlDOMErrorHandler ##############
+package XML::Xerces::PerlDOMErrorHandler;
+use Carp;
+use vars qw(@ISA);
+@ISA = qw(XML::Xerces::DOMErrorHandler);
+
+sub new {
+  my $class = shift;
+
+  # support copy constructor syntax
+  $class = ref($class) if ref($class);
+
+  return bless {}, $class;
+}
+
+sub handleError {
+  my $self = shift;
+  return $self->handle_error(@_);
+}
+
+#
+# support alternate Perl-friendly syntax
+#
+sub handle_error {
+  my $severity = $_[1]->getSeverity;
+  my $msg = $_[1]->getMessage;
+  croak(<<EOT);
+ERROR:
+SEVERITY: $severity
+MESSAGE:  $msg
+EOT
+}

Modified: xerces/c/trunk/swig/interfaces/Perl/callback.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/Perl/callback.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/Perl/callback.i (original)
+++ xerces/c/trunk/swig/interfaces/Perl/callback.i Fri Oct 13 14:34:15 2006
@@ -21,11 +21,10 @@
 
 %include "PerlCallbackHandler.hpp"
 %include "PerlErrorCallbackHandler.hpp"
-%include "PerlEntityResolverHandler.hpp"
-%include "PerlDocumentCallbackHandler.hpp"
-%include "PerlContentCallbackHandler.hpp"
 
-// %include "PerlNodeFilterCallbackHandler.hpp"
+%import "xercesc/sax/EntityResolver.hpp"
+
+%include "PerlEntityResolverHandler.hpp"
 
 /*
  * PerlCallbackHandler* - this is broken and useless

Modified: xerces/c/trunk/swig/interfaces/Perl/defines.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/Perl/defines.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/Perl/defines.i (original)
+++ xerces/c/trunk/swig/interfaces/Perl/defines.i Fri Oct 13 14:34:15 2006
@@ -21,93 +21,4 @@
 
 %{
 
-static void
-SWIG_Disown(SV *sv) {
-  
-  if (SvGMAGICAL(sv)) {
-      mg_get(sv);
-  }
-    
-
-  /* Check to see if this is an object */
-  if (sv_isobject(sv)) {
-    SV *tsv = (SV*) SvRV(sv);
-    if ((SvTYPE(tsv) == SVt_PVHV)) {
-      MAGIC *mg;
-      if (SvMAGICAL(tsv)) {
-        mg = mg_find(tsv,'P');
-        if (mg) {
-          sv = mg->mg_obj;
-          if (sv_isobject(sv)) {
-              fprintf(stderr,"Found object for disown\n");
-
-	      HV *stash;
-	      stash=SvSTASH(SvRV(sv));
-
-	      if (stash != 0)
-              {
-                  fprintf(stderr,"Found stash: %x\n",stash);
-                  HV *hv;
-                  GV *gv=*(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
-                  if (isGV(gv))
-                  {
-                      fprintf(stderr,"Found OWNER glob: %x\n",gv);
-                      fprintf(stderr,"Found object: %x\n",sv);
-                      fprintf(stderr,"Found ref object: %x\n",SvRV(sv));
-                      hv=GvHVn(gv);
-
-                      HE *entry;
-                      char *key;
-                      I32 klen;
-                      SV *hval;
-	    
-                      (void)hv_iterinit(hv);
-                      while ((entry = hv_iternext(hv)))  {
-                          key = hv_iterkey(entry, &klen);
-                          fprintf(stderr,"Found hash entry: %s\n",key);
-                      }
-            
-		      if (hv_exists_ent(hv, sv, 0))
-                      {
-                          fprintf(stderr,"Found key in OWNER hash!\n");
-                          if (hv_delete_ent(hv,sv,0,0))
-                          {
-                              fprintf(stderr,"Deleted key in OWNER hash!\n");
-                          }
-                          else 
-                          {
-                              SWIG_SetError("Couldn't delete key from OWNER hash :-<\n");
-                          }
-                      }
-                      else
-                      {
-                          SWIG_SetError("no key in OWNER hash :-<\n");
-                      }
-                  }
-                  else
-                  {
-                      SWIG_SetError("no GV\n");
-                  }
-              }
-              else
-              {
-                  SWIG_SetError("no stash found\n");
-              }
-          } else {
-              SWIG_SetError("SWIG_Disown: mg is not object");
-          }
-        } else {
-            SWIG_SetError("SWIG_Disown: no mg");
-        }
-      } else {
-          SWIG_SetError("SWIG_Disown: not magical");
-      }
-    } else {
-      SWIG_SetError("SWIG_Disown: not PVHV");
-    }
-  } else {            /* not an object */
-      SWIG_SetError("SWIG_Disown: not an object");
-  }
-}
-
 %}

Modified: xerces/c/trunk/swig/interfaces/Perl/dom-callback.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/Perl/dom-callback.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/Perl/dom-callback.i (original)
+++ xerces/c/trunk/swig/interfaces/Perl/dom-callback.i Fri Oct 13 14:34:15 2006
@@ -15,51 +15,10 @@
  */
 
 /*
- * Perl/callback.i - an experimental typecheck for returning callback subclasses
+ * Perl/dom-callback.i - callback handlers for the DOM
  *
  */ 
 
 %import "PerlCallbackHandler.hpp"
 %include "PerlNodeFilterCallbackHandler.hpp"
-
-/*
- * PerlCallbackHandler* - this is broken and useless
- */
-
-/*
-%typemap(out) XERCES_CPP_NAMESPACE::PerlCallbackHandler * = SWIGTYPE *DYNAMIC;
-
-DYNAMIC_CAST(SWIGTYPE_p_PerlCallbackHandler, PerlCallbackHandler_dynamic_cast);
-
-%{
-
-static swig_type_info *
-PerlCallbackHandler_dynamic_cast(void **ptr) {
-   PerlCallbackHandler **nptr = (PerlCallbackHandler **) ptr;
-   if (*nptr == NULL) {
-       return NULL;
-   }
-   short int type = (*nptr)->type();
-   if (type == PERLCALLBACKHANDLER_BASE_TYPE) {
-      die("Can't cast a PerlCallbackHandler base type node\n");
-   }
-   if (type == PERLCALLBACKHANDLER_ERROR_TYPE) {
-      return SWIGTYPE_p_PerlErrorCallbackHandler;
-   }
-   if (type == PERLCALLBACKHANDLER_ENTITY_TYPE) {
-      return SWIGTYPE_p_PerlEntityResolverHandler;
-   }
-   if (type == PERLCALLBACKHANDLER_CONTENT_TYPE) {
-      return SWIGTYPE_p_PerlContentCallbackHandler;
-   }
-   if (type == PERLCALLBACKHANDLER_DOCUMENT_TYPE) {
-      return SWIGTYPE_p_PerlDocumentCallbackHandler;
-   }
-   if (type == PERLCALLBACKHANDLER_NODE_TYPE) {
-      return SWIGTYPE_p_PerlNodeFilterCallbackHandler;
-   }
-   return NULL;
-}
-
-%}
-*/
\ No newline at end of file
+%include "PerlDOMCallbackHandler.hpp"

Modified: xerces/c/trunk/swig/interfaces/Perl/dom-shadow.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/Perl/dom-shadow.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/Perl/dom-shadow.i (original)
+++ xerces/c/trunk/swig/interfaces/Perl/dom-shadow.i Fri Oct 13 14:34:15 2006
@@ -19,20 +19,26 @@
  *
  */ 
 
-%feature("shadow") XERCES_CPP_NAMESPACE::DOMConfiguration::setParameter {
-    sub setParameter {
-      my ($self,$name,$value) = @_;
-
-      if ($name eq $XML::Xerces::XMLUni::fgDOMErrorHandler) {
-        $value = XML::Xerces::PerlErrorCallbackHandler->new($_[2]);
-        $XML::Xerces::REMEMBER{tied(% {$self})}->{__ERROR_HANDLER} = $value;
-      } elsif ($name eq $XML::Xerces::XMLUni::fgXercesEntityResolver) {
-        $value = XML::Xerces::PerlEntityResolverHandler->new($_[2]);
-        $XML::Xerces::REMEMBER{tied(% {$self})}->{__ENTITY_RESOLVER} = $value;
-      }
-      return XML::Xercesc::DOMConfiguration_setParameter($self,$name,$value);
+%feature("shadow") XERCES_CPP_NAMESPACE::DOMConfiguration::setParameter %{
+sub setParameter {
+  my ($self,$name,$value) = @_;
+
+  # we allow undef to unset existing values
+  if (defined $value) {
+    if ($name eq $XML::Xerces::XMLUni::fgDOMErrorHandler) {
+      $value = XML::Xerces::PerlDOMCallbackHandler->new($value);
+      $XML::Xerces::REMEMBER{tied(% {$self})}->{__ERROR_HANDLER} = $value;
+    } elsif ($name eq $XML::Xerces::XMLUni::fgDOMResourceResolver) {
+      $value = XML::Xerces::PerlDOMCallbackHandler->new($value);
+      $XML::Xerces::REMEMBER{tied(% {$self})}->{__ENTITY_RESOLVER} = $value;
+    } elsif ($name eq $XML::Xerces::XMLUni::fgXercesEntityResolver) {
+      $value = XML::Xerces::PerlEntityResolverHandler->new($value);
+      $XML::Xerces::REMEMBER{tied(% {$self})}->{__ENTITY_RESOLVER} = $value;
     }
+  }
+  return XML::Xercesc::DOMConfiguration_setParameter($self,$name,$value);
 }
+%}
 
 // Define a macro to rewrite all methods that return a list of DOMNodes
 
@@ -158,11 +164,12 @@
 }
 %}
 
-%feature("shadow") ~DOMDocument %{
+%define CLEANUP(class)
+%feature("shadow") ~class %{
 sub DESTROY {
     return unless $_[0]->isa('HASH');
     my $self = tied(%{$_[0]});
-    return unless defined $self;
+    return unless defined ## $self;
 
     if ($self->can('cleanup')) {
         $_[0]->cleanup();
@@ -170,9 +177,12 @@
 
     delete $ITERATORS{$self};
     if (exists $OWNER{$self}) {
-        XML::Xercesc::delete_DOMDocument($self);
+        XML::Xercesc::delete_##class($self);
         delete $OWNER{$self};
     }
 }
 %}
+%enddef
 
+CLEANUP(DOMDocument)
+CLEANUP(DOMConfiguration)
\ No newline at end of file

Modified: xerces/c/trunk/swig/interfaces/Perl/includes.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/Perl/includes.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/Perl/includes.i (original)
+++ xerces/c/trunk/swig/interfaces/Perl/includes.i Fri Oct 13 14:34:15 2006
@@ -15,7 +15,7 @@
  */
 
 /*
- * Perl/includes.i - all #includes needed for Xerces.cpp
+ * Perl/includes.i - all Perl #includes needed for Xerces.cpp
  *
  */ 
 
@@ -26,8 +26,7 @@
 
 #include "PerlCallbackHandler.hpp"
 #include "PerlErrorCallbackHandler.hpp"
-#include "PerlDocumentCallbackHandler.hpp"
-#include "PerlContentCallbackHandler.hpp"
+#include "PerlDOMCallbackHandler.hpp"
 #include "PerlEntityResolverHandler.hpp"
 
 %}

Modified: xerces/c/trunk/swig/interfaces/Perl/shadow.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/Perl/shadow.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/Perl/shadow.i (original)
+++ xerces/c/trunk/swig/interfaces/Perl/shadow.i Fri Oct 13 14:34:15 2006
@@ -27,13 +27,17 @@
 
 %define SET_ERRORHANDLER(class)
 %feature("shadow") XERCES_CPP_NAMESPACE::class::setErrorHandler {
-    sub setErrorHandler {
-      my ($self,$handler) = @_;
-      my $callback = XML::Xerces::PerlErrorCallbackHandler->new($handler);
-      $XML::Xerces::REMEMBER{tied(% {$self})}->{__ERROR_HANDLER} = $callback;
+sub setErrorHandler {
+  my ($self,$handler) = @_;
 
-      return XML::Xercesc::class ##_setErrorHandler($self,$callback);
-    }
+  # allow undef to unset current value
+  my $callback;
+  if (defined ## $handler) {
+    $callback = XML::Xerces::PerlErrorCallbackHandler->new($handler);
+    $XML::Xerces::REMEMBER{tied(% {$self})}->{__ERROR_HANDLER} = $callback;
+  }
+  return XML::Xercesc::class ##_setErrorHandler($self,$callback);
+}
 }
 %enddef
 
@@ -46,13 +50,17 @@
 
 %define SET_ENTITYRESOLVER(class)
 %feature("shadow") XERCES_CPP_NAMESPACE::class::setEntityResolver {
-    sub setEntityResolver {
-      my ($self,$handler) = @_;
-      my $callback = XML::Xerces::PerlEntityResolverHandler->new($handler);
-      $XML::Xerces::REMEMBER{tied(% {$self})}->{__ENTITY_RESOLVER} = $callback;
+sub setEntityResolver {
+  my ($self,$handler) = @_;
 
-      return XML::Xercesc::class ##_setEntityResolver($self,$callback);
-    }
+  # allow undef to unset current value
+  my $callback;
+  if (defined ## $handler) {
+    $callback = XML::Xerces::PerlEntityResolverHandler->new($handler);
+    $XML::Xerces::REMEMBER{tied(% {$self})}->{__ENTITY_RESOLVER} = $callback;
+  }
+  return XML::Xercesc::class ##_setEntityResolver($self,$callback);
+}
 }
 %enddef
 
@@ -82,24 +90,40 @@
 }
 %}
 
-%feature("shadow") XERCES_CPP_NAMESPACE::SAXParser::setDocumentHandler %{
-sub setDocumentHandler {
-    my ($self,$handler) = @_;
-    my $callback = XML::Xerces::PerlDocumentCallbackHandler->new($handler);
-    $XML::Xerces::REMEMBER{tied(% {$self})}->{__DOCUMENT_HANDLER} = $callback;
+// Define a macro to rewrite all methods that return a list 
 
-    my @args = ($self,$callback);
-    return XML::Xercesc::SAXParser_setDocumentHandler(@args);
+// we need the "defined ## $result hack because defined is a cpp operator
+%define LIST_METHOD(class,method)
+  %feature("shadow") XERCES_CPP_NAMESPACE::class::method {
+sub method {
+    my $result = XML::Xercesc:: ## class ## _ ## method (@_);
+    unless (defined ## $result) {
+      return () if wantarray;
+      return undef; # if *not* wantarray
+    }
+    return $result->to_list() if wantarray;
+    return $result; # if *not* wantarray
 }
-%}
+  }
+%enddef
 
-%feature("shadow") XERCES_CPP_NAMESPACE::SAX2XMLReader::setContentHandler %{
-sub setContentHandler {
-    my ($self,$handler) = @_;
-    my $callback = XML::Xerces::PerlContentCallbackHandler->new($handler);
-    $XML::Xerces::REMEMBER{tied(% {$self})}->{__CONTENT_HANDLER} = $callback;
+// Define a macro to rewrite all methods that return a map 
 
-    my @args = ($self,$callback);
-    return XML::Xercesc::SAX2XMLReader_setContentHandler(@args);
+// we need the "defined ## $result hack because defined is a cpp operator
+%define MAP_METHOD(class,method)
+  %feature("shadow") XERCES_CPP_NAMESPACE::class::method {
+sub method {
+    my $result = XML::Xercesc:: ## class ## _ ## method (@_);
+    unless (defined ## $result) {
+      return () if wantarray;
+      return undef; # if *not* wantarray
+    }
+    return $result->to_hash() if wantarray;
+    return $result; # if *not* wantarray
 }
-%}
+  }
+%enddef
+
+LIST_METHOD(XMLElementDecl,getAttDefList)
+LIST_METHOD(XMLSchemaDescription,getLocationHints)
+// MAP_METHOD(XMLElementDecl,getAttDefList)
\ No newline at end of file

Modified: xerces/c/trunk/swig/interfaces/Perl/typemaps-xmlch.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/Perl/typemaps-xmlch.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/Perl/typemaps-xmlch.i (original)
+++ xerces/c/trunk/swig/interfaces/Perl/typemaps-xmlch.i Fri Oct 13 14:34:15 2006
@@ -14,88 +14,19 @@
  * limitations under the License.
  */
 
-/***********/
-/*         */
-/* 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.                                                             */
-/*                                                                      */
-/************************************************************************/
-
-// in typemap
-%typemap(in) XMLCh * %{
-  if ($input == &PL_sv_undef) {
-    SWIG_Perl_NullRef("perl-string",$argnum,"$symname");
-    goto fail;
-  } else {
-    // we convert *everything* into a string that isn't undef
-    $1 = UTF8_TRANSCODER->Perl2XMLString($input);
-  }
-%}
-
-%typemap(freearg) XMLCh * %{
-  delete[] $1;
-%}
-
-// out typemap
-%typemap(out) XMLCh * %{
-  $result = UTF8_TRANSCODER->XMLString2Perl($1);
-  ++argvi;
-%}
-
 // varout typemap (for global variables)
 // useful for XMLUni constants
 %typemap(varout) XMLCh[] %{
-  sv_setsv((SV*)$result, UTF8_TRANSCODER->XMLString2Perl($1));
+  sv_setsv((SV*)$result, UTF8_TRANSCODER->XMLString2Local($1));
 %}
 
 // fgBooleanValueSpace is an array of XMLCh*
 %typemap(varout) XMLCh[][8] %{
     AV *myav = newAV();
     for (int i=0;i<4;i++) {
-        av_push(myav, UTF8_TRANSCODER->XMLString2Perl($1[i]));
+        av_push(myav, UTF8_TRANSCODER->XMLString2Local($1[i]));
     }
 
     SV* rv = newRV((SV*)myav);
     sv_setsv((SV*)$result, rv);
 %}
-
-/*
- * Enable conversion of void* => XMLCh* in setProperty()
- *
- * The in typemap converts the void* to an XMLCh*
- *
- * The freearg typemap deletes the transcoded string
- *
- */
-%typemap(in) (void* value) {
-  // now check the value
-  if ($input == &PL_sv_undef) {
-    SWIG_Perl_NullRef("perl-string",$argnum,"$symname");
-    goto fail;
-  } else {
-    // we convert *everything* into a string that isn't undef
-    $1 = UTF8_TRANSCODER->Perl2XMLString($input);
-  }
-}
-%typemap(freearg) void * %{
-  delete[] $1;
-%}
-

Modified: xerces/c/trunk/swig/interfaces/Perl/typemaps.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/Perl/typemaps.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/Perl/typemaps.i (original)
+++ xerces/c/trunk/swig/interfaces/Perl/typemaps.i Fri Oct 13 14:34:15 2006
@@ -1,73 +1,38 @@
-// 
-// FOR Perl*Handler MEMBER FUNCTIONS, SO PERL SCALAR DOESN'T GET WRAPPED 
-// 
-%typemap(in) SV * {
-  $1 = $input;
-}
-
-// For setProperty() - store the SV* directly
-%typemap(in) void * {
-  $1 = (void*) $input;
-}
-
-%typemap(in) (const XMLByte* const srcDocBytes, 
-	      unsigned int byteCount) {
-  if (SvPOK($input)||SvIOK($input)||SvNOK($input)) {
-    STRLEN len;
-    XMLByte *xmlbytes = (XMLByte *)SvPV($input, len);
-    $2 = len;
-    $1 = new XMLByte[len];
-    memcpy($1, xmlbytes, len);
-  } else {
-    SWIG_croak("Type error in argument 2 of $symname, Expected perl-string.");
-  }
-}
-
-// XMLByte arrays are just unisgned char*'s
-// force loading of FromCharPtr fragment - needed for DOM
-%typemap(out, noblock=1, fragment="SWIG_FromCharPtr") const XMLByte* getRawBuffer() {
-  %set_output(SWIG_FromCharPtr((char*)$1));
-}
-
 /*
  * Adopting a validator
  *
  *   we have to disown the validator, because Xerces will adopt it
- *   first we create a temp variable to store it's value in the
- *   'in' typemap, and the after all conversion has succeeded
- *   the 'check' typemap will disown it.
+ *   after all conversion has succeeded
+ *   the SWIG_POINTER_DISOWN flag makes sure it is disowned.
  */
-%typemap(in) XERCES_CPP_NAMESPACE::XMLValidator* valToAdopt (SV *temp)
+%typemap(in) XERCES_CPP_NAMESPACE::XMLValidator* valToAdopt
 {
-        temp = $input;
-	if (SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor,0) < 0) {
-            SWIG_Perl_TypeError("$1_mangle",$argnum,"$symname");
+    if ($input != &PL_sv_undef) {
+        int rc = SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor, SWIG_POINTER_DISOWN |  0);
+	if (!SWIG_IsOK(rc)) {
+            %argument_fail(SWIG_TypeError, "$type", $symname, $argnum);
         }
+    }
 }
 
-%typemap(check) XERCES_CPP_NAMESPACE::XMLValidator* valToAdopt
-{
-   SWIG_Disown(temp$argnum);
+// 
+// FOR Perl*Handler MEMBER FUNCTIONS, SO PERL SCALAR DOESN'T GET WRAPPED 
+// 
+%typemap(in) SV * {
+  $1 = $input;
 }
 
-// The typecheck functions are for use by SWIG's auto-overloading support
-%typemap(typecheck, precedence=60)
-SV*
-{
-  $1 = SvOK($input) ? 1 : 0;
+// For setProperty() - store the SV* directly
+%typemap(in) void * {
+  $1 = (void*) $input;
 }
 
 // The typecheck functions are for use by SWIG's auto-overloading support
+// we must set a *really* low precedence on this because it will return
+// true for *everything* 
 %typemap(typecheck, precedence=60)
 SV*
 {
-  $1 = SvOK($input) ? 1 : 0;
+  $1 = 1;
 }
 
-// %typemap(typecheck, precedence=70)
-// as long as the SV is not undef, convert it to a string
-%typecheck(SWIG_TYPECHECK_UNISTRING)
-XMLCh*, const XMLCh* 
-{
-  $1 = SvOK($input) ? 1 : 0; 
-}
\ No newline at end of file

Modified: xerces/c/trunk/swig/interfaces/SAX.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/SAX.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/SAX.i (original)
+++ xerces/c/trunk/swig/interfaces/SAX.i Fri Oct 13 14:34:15 2006
@@ -1,9 +1,8 @@
-%include "xercesc/sax/SAXException.hpp"
-%include "xercesc/sax/SAXParseException.hpp"
-%include "xercesc/sax/ErrorHandler.hpp"
+%import "xercesc/sax/ErrorHandler.hpp"
+
 %include "xercesc/sax/DTDHandler.hpp"
 %include "xercesc/sax/DocumentHandler.hpp"
-%include "xercesc/sax/EntityResolver.hpp"
+%import  "xercesc/sax/EntityResolver.hpp"
 %include "xercesc/sax/AttributeList.hpp"
 %include "xercesc/sax/HandlerBase.hpp"
 %include "xercesc/sax/Locator.hpp"

Modified: xerces/c/trunk/swig/interfaces/SAX2.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/SAX2.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/SAX2.i (original)
+++ xerces/c/trunk/swig/interfaces/SAX2.i Fri Oct 13 14:34:15 2006
@@ -2,5 +2,5 @@
 %include "xercesc/sax2/ContentHandler.hpp"
 %include "xercesc/sax2/LexicalHandler.hpp"
 %include "xercesc/sax2/DeclHandler.hpp"
-%include "xercesc/sax2/DefaultHandler.hpp"
+// %include "xercesc/sax2/DefaultHandler.hpp"
 

Modified: xerces/c/trunk/swig/interfaces/Xerces.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/Xerces.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/Xerces.i (original)
+++ xerces/c/trunk/swig/interfaces/Xerces.i Fri Oct 13 14:34:15 2006
@@ -29,84 +29,32 @@
 %module "XML::Xerces"
 #endif
 
-%include "includes.i"
-
 /*
- * Import the language specific macros - not namespace dependent
- *   we place these first so that they can define any master
- *   macros needed by the language-independent interface files
+ * Import the common macros
  */
-
-#ifdef SWIGPERL
-%include "Perl/shadow.i"
-// %include "Perl/dom-shadow.i"
-%include "Perl/defines.i"
-%include "Perl/errors.i"
-%include "Perl/includes.i"
-%include "Perl/typemaps.i"
-%include "Perl/typemaps-xmlch.i"
-#endif
+%include "Xerces_common.i"
 
 /*
- * Start the XERCES_CPP_NAMESPACE
  *    after this everything will be in Xerces namespace
  */ 
-%include "defines.i"
-
-/*
- * language dependent features that are namespace dependent
- *   such as the transcoders
- *
- */
-#ifdef SWIGPERL
-// %include "Perl/transcode.i"
-#endif
-
-
-%include typemaps-general.i
-
-// %include "typemaps-dom.i"
-
-/*****************************/
-/*                           */
-/*  Platforms and Compilers  */
-/*                           */
-/*****************************/
+%{
 
-// we seem to need these defs loaded before parsing XercesDefs.hpp
-// as of Xerces-3.0
-%import "xercesc/util/Xerces_autoconf_config.hpp" // for XMLSize_t and namespaces
+XERCES_CPP_NAMESPACE_USE
 
-%import "xercesc/util/XercesDefs.hpp"
+%}
 
-/******************/
-/*                */
-/*  General code  */
-/*                */
-/******************/
+// This prevents a million warnings
+%ignore XSerializable;
+class XSerializable {
+private:
+XSerializable::XSerializable();
+};
 
 /*
- * The generic exception handler
- *    'goto fail' must be called - either explicitly, or via SWIG_croak()
- *    to ensure that any variable cleanup is done - to avoid memory leaks.
- *    By making these macros, it reduces the code *file* size dramatically
- *    (but doesn't reduce the compiled file size at all...)
+ * Define exception handlers
+ *
  */
 
-%{
-#define CATCH_XML_EXCEPTION       \
-    catch (const XMLException& e) \
-    {                             \
-        makeXMLException(e);      \
-	goto fail;                \
-    }                             \
-    catch (...)                   \
-    {                             \
-        SWIG_croak("Handling Unknown exception"); \
-	goto fail;                \
-    }
-%}
-
 %exception {
     try 
     {
@@ -116,31 +64,15 @@
 }
 
 /*
- * Have the scripting language manage the memory for objects created
- * in factory methods SWIG will automatically handle objects created
- * in constructors but it must be told what methods are factory
- * methods
- */
-// %newobject createDOMWriter;
-// %newobject createDocumentType;
-// %newobject createDocument;
-// %newobject getDOMImplementation;
-%newobject createXMLReader;
-
-/* 
- * All %ignore directives
+ * Module specific classes
+ *
  */
 
-%include "ignore.i"
-
 /*
- * Operator support
+ * Unicode contants
  */
 
-// Operators we do want
-// %rename(operator_assignment) operator=;
-%rename(operator_equal_to) operator==;
-%rename(operator_not_equal_to) operator!=;
+%include "unicode.i"
 
 /*
  * Utility Classes
@@ -154,56 +86,12 @@
 
 %include "grammars.i"
 
-/*
- * InputSource
- */
-
-%include "input-source.i"
-
-/*
- * DOM
- */
-
-// %include "DOM.i"
-
-// %include "xercesc/dom/DOMNode.hpp"
-
-/*
- * SAX1
- */
-
-%include "SAX.i"
-
-/*
- * SAX2
- */
-
-%include "SAX2.i"
-
 /* 
- * Parsers
+ * Auxiliary classes need for both DOM and SAX parsers
  */
 
 %include "parsers.i"
 
-/* 
- * Include extra verbatim C code in the initialization function
- */
-%init {
-    // we create the global transcoder for UTF-8 to UTF-16
-    // must initialize the Xerces-C transcoding service
-    XMLPlatformUtils::Initialize();
-    UTF8_TRANSCODER = Transcoder::getInstance();
-    if (! UTF8_TRANSCODER) {
-	croak("ERROR: XML::Xerces: INIT: Could not create UTF-8 transcoder");
-    }
-
-    XML_EXCEPTION_HANDLER = XMLExceptionHandler::getInstance();
-    if (! XML_EXCEPTION_HANDLER) {
-	croak("ERROR: XML::Xerces: INIT: Could not create XMLExceptionHandler");
-    }
-}
-
 #ifdef SWIGPERL
 
 /* 
@@ -211,6 +99,8 @@
  *   so that SWIG can wrap the superclass methods properly
  */
 
+// must %include this or getErrorHandler() fails to return proper type
+%include "xercesc/sax/ErrorHandler.hpp"
 %include "Perl/callback.i"
 
 /* 

Modified: xerces/c/trunk/swig/interfaces/Xerces_DOM.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/Xerces_DOM.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/Xerces_DOM.i (original)
+++ xerces/c/trunk/swig/interfaces/Xerces_DOM.i Fri Oct 13 14:34:15 2006
@@ -23,30 +23,14 @@
  *   the namespace
  */
 #ifdef SWIGPERL
-%module(package="XML::Xerces") "DOM"
-// %module "XML::Xerces::DOM"
+%module(package="XML::Xerces") "XML::Xerces::DOM"
 #endif
-
-%include "includes.i"
-
-%include "dom-includes.i"
-
-/*
- * Import the language specific macros
- */
-
-#ifdef SWIGPERL
-%include "Perl/errors.i"
-%include "Perl/defines.i"
-%include "Perl/dom-shadow.i"
-%include "Perl/typemaps.i"
-%include "Perl/typemaps-xmlch.i"
-%include "Perl/includes.i"
-%include "Perl/dom-includes.i"
+#ifdef SWIGXML
+%module(package="XML::Xerces") "XML::Xerces::DOM"
 #endif
 
-// Get the type information
-%import "Xerces.i"
+%include "io-includes.i"
+%include "dom-includes.i"
 
 /*
  * After this we will be under the Xerces namespace
@@ -57,60 +41,47 @@
 
 XERCES_CPP_NAMESPACE_USE
 
-// we initialize the static UTF-8 transcoding info
-// these are used by the typemaps to convert between
-// Xerces internal UTF-16 and Perl's internal UTF-8
-static Transcoder* UTF8_TRANSCODER  = NULL;
-
-static XMLExceptionHandler* XML_EXCEPTION_HANDLER  = NULL;
-
-void
-makeXMLException(const XMLException& e){
-    SV *error = ERRSV;
-    SWIG_MakePtr(error, (void *) XML_EXCEPTION_HANDLER->copyXMLException(e), SWIGTYPE_p_XERCES_CPP_NAMESPACE__XMLException, SWIG_SHADOW|0);
-}
-
 void
 makeDOMException(const DOMException& e){
     SV *error = ERRSV;
     SWIG_MakePtr(error, (void *) new DOMException(e), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException, SWIG_SHADOW|0);
 }
 
-%}
-
-// %include "make-xml-exception.i"
+// void
+// makeDOMXPathException(const DOMXPathException& e){
+//     SV *error = ERRSV;
+//     SWIG_MakePtr(error, (void *) new DOMXPathException(e), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMXPathException, SWIG_SHADOW|0);
+// }
 
-%include "typemaps-dom.i"
+%}
 
-%include "typemaps-general.i"
+/*
+ * Import the common macros
+ */
+%include "Xerces_common.i"
 
-/*****************************/
-/*                           */
-/*  Platforms and Compilers  */
-/*                           */
-/*****************************/
-
-// we seem to need these defs loaded before parsing XercesDefs.hpp
-// as of Xerces-3.0
-%import "xercesc/util/Xerces_autoconf_config.hpp" // for XMLSize_t and namespaces
+/*
+ * Import the language-specific macros
+ */
 
-%import "xercesc/util/XercesDefs.hpp"
+#ifdef SWIGPERL
+%include "Perl/dom-shadow.i"
+%include "Perl/dom-includes.i"
+#endif
 
-/* 
- * All %ignore directives
+/*
+ * Import the module-specific typemaps
  */
 
-%include "ignore.i"
+%include "typemaps-dom.i"
+%include "typemaps-domnode.i"
 
 /*
- * Operator support
+ * Import the type information from other modules
  */
 
-// Operators we do want
-// %rename(operator_assignment) operator=;
-%rename(operator_equal_to) operator==;
-%rename(operator_not_equal_to) operator!=;
-
+%import "Xerces.i"
+%import "Xerces_IO.i"
 
 /*
  * the DOM classes gets a special exception handler
@@ -137,6 +108,23 @@
         SWIG_croak("Handling Unknown exception"); \
         goto fail;                  \
     }
+
+#define CATCH_DOMXPATH_EXCEPTION    \
+    catch (const XMLException& e)   \
+    {                               \
+        makeXMLException(e);        \
+	goto fail;                  \
+    }                               \
+    catch (const DOMXPathException& e)   \
+    {                               \
+	makeDOMXPathException(e);    \
+	goto fail;                  \
+    }                               \
+    catch (...)                     \
+    {                               \
+        SWIG_croak("Handling Unknown exception"); \
+        goto fail;                  \
+    }
 %}
 
 %exception {
@@ -147,6 +135,25 @@
     CATCH_DOM_EXCEPTION
 }
 
+%define XPATH_METHOD(class,method)
+%exception XERCES_CPP_NAMESPACE::class::method %{
+    try 
+    {
+        $action
+    } 
+    CATCH_DOMXPATH_EXCEPTION
+%}
+%enddef
+
+%define XPATH_CLASS(class)
+%exception XERCES_CPP_NAMESPACE::class %{
+    try 
+    {
+        $action
+    } 
+    CATCH_DOMXPATH_EXCEPTION
+%}
+%enddef
 
 // Introduced in DOM Level 1
 %include "dom/DOMException.i"
@@ -170,18 +177,12 @@
 %include "dom/DOMTypeInfo.i"
 %include "dom/DOMPSVITypeInfo.i"
 
-// XPath
-%include "dom/DOMXPathEvaluator.i"
-%include "dom/DOMXPathException.i"
-%include "dom/DOMXPathExpression.i"
-%include "dom/DOMXPathNamespace.i"
-%include "dom/DOMXPathNSResolver.i"
-%include "dom/DOMXPathResult.i"
-
 // Introduced in DOM Level 2
 %include "dom/DOMDocumentRange.i"
 %include "dom/DOMDocumentTraversal.i"
 %include "dom/DOMNodeIterator.i"
+
+%feature("notabstract", 1) DOMNodeFilter;
 %include "dom/DOMNodeFilter.i"
 %include "dom/DOMRange.i"
 %include "dom/DOMRangeException.i"
@@ -190,62 +191,56 @@
 /*
  * Introduced in DOM Level 3
  */
+%include "dom/DOMStringList.i"
 %include "dom/DOMUserDataHandler.i"
 %include "dom/DOMConfiguration.i"
-%include "dom/DOMStringList.i"
 %include "dom/DOMImplementationLS.i"
 %include "dom/DOMImplementation.i"
 %include "dom/DOMImplementationList.i"
-%include "dom/DOMImplementationSource.i"
 %include "dom/DOMImplementationRegistry.i"
 
+// XPath - currently unimplemented
+%import "dom/DOMXPathEvaluator.i"
+%import "dom/DOMXPathException.i"
+%import "dom/DOMXPathExpression.i"
+%import "dom/DOMXPathNamespace.i"
+%import "dom/DOMXPathNSResolver.i"
+%import "dom/DOMXPathResult.i"
+
+// Interfaces not useful for scripting languages
+// %include "dom/DOMImplementationSource.i"
+
 %include "dom/DOMError.i"
 %include "dom/DOMErrorHandler.i"
+
+// from Level 1, but with extensions from Level 3
 %include "dom/DOMDocument.i"
+
 %include "dom/DOMLocator.i"
 %include "dom/DOMLSResourceResolver.i"
 
-// DOMLSParser
-%include "dom/DOMLSInput.i"
-%include "framework/Wrapper4InputSource.i"
-%include "framework/Wrapper4DOMLSInput.i"
-%include "dom/DOMLSParserFilter.i"
-%include "dom/DOMLSParser.i"
-
-// DOMWriter
+// DOMLSSerializer
 %include "dom/DOMLSOutput.i"
-%include "framework/XMLFormatter.i"
-%include "framework/StdOutFormatTarget.i"
-%include "framework/LocalFileFormatTarget.i"
-%include "framework/MemBufFormatTarget.i"
 
 %include "dom/DOMLSException.i"
-%include "dom/DOMLSSerializer.i"
-%include "dom/DOMLSSerializerFilter.i"
 
-%import "xercesc/framework/XMLPScanToken.hpp"
-%import "xercesc/framework/psvi/PSVIHandler.hpp"
+%feature("notabstract", 1) DOMLSSerializerFilter;
+%include "dom/DOMLSSerializerFilter.i"
+%include "dom/DOMLSSerializer.i"
 
+// Base class for DOMLSParser and XercesDOMParser
 %include "parsers/AbstractDOMParser.i"
-%include "parsers/XercesDOMParser.i"
 
-/* 
- * Include extra verbatim C code in the initialization function
- */
-%init {
-    // we create the global transcoder for UTF-8 to UTF-16
-    // must initialize the Xerces-C transcoding service
-    XMLPlatformUtils::Initialize();
-    UTF8_TRANSCODER = Transcoder::getInstance();
-    if (! UTF8_TRANSCODER) {
-	croak("ERROR: XML::Xerces: INIT: Could not create UTF-8 transcoder");
-    }
+// DOMLSParser
+%include "dom/DOMLSInput.i"
+%include "framework/Wrapper4InputSource.i"
+%include "framework/Wrapper4DOMLSInput.i"
+%include "dom/DOMLSParserFilter.i"
+%include "dom/DOMLSParser.i"
 
-    XML_EXCEPTION_HANDLER = XMLExceptionHandler::getInstance();
-    if (! XML_EXCEPTION_HANDLER) {
-	croak("ERROR: XML::Xerces: INIT: Could not create XMLExceptionHandler");
-    }
-}
+// XercesDOMParser
+%feature("notabstract", 1) XercesDOMParser;
+%include "parsers/XercesDOMParser.i"
 
 #ifdef SWIGPERL
 
@@ -260,13 +255,5 @@
  * Include extra verbatim Perl code
  */
 %pragma(perl5) include="../../interfaces/Perl/Xerces_DOM-extra.pm"
-
-/* 
- * Include extra verbatim Perl code immediately after Module header
- */
-
-%pragma(perl5) code="package XML::Xerces::DOM; 
-use XML::Xerces;
-use vars qw($VERSION @EXPORT);"
 
 #endif

Modified: xerces/c/trunk/swig/interfaces/defines.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/defines.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/defines.i (original)
+++ xerces/c/trunk/swig/interfaces/defines.i Fri Oct 13 14:34:15 2006
@@ -19,47 +19,3 @@
  *   verbatim into the C++ output file
  */
 
-%{
-
-XERCES_CPP_NAMESPACE_USE
-
-// we initialize the static UTF-8 transcoding info
-// these are used by the typemaps to convert between
-// Xerces internal UTF-16 and Perl's internal UTF-8
-static Transcoder* UTF8_TRANSCODER  = NULL;
-
-static XMLExceptionHandler* XML_EXCEPTION_HANDLER  = NULL;
-
-static bool DEBUG_UTF8_OUT = 0;
-static bool DEBUG_UTF8_IN = 0;
-
-%}
-
-// These get wrapped by SWIG so that we can modify them from the scripting language
-bool DEBUG_UTF8_OUT;
-bool DEBUG_UTF8_IN;
-
-
-%{
-
-void
-makeXMLException(const XMLException& e){
-    SV *error = ERRSV;
-    SWIG_MakePtr(error, (void *) XML_EXCEPTION_HANDLER->copyXMLException(e), SWIGTYPE_p_XERCES_CPP_NAMESPACE__XMLException, SWIG_SHADOW|0);
-}
-
-void
-makeSAXNotRecognizedException(const SAXNotRecognizedException& e){
-    SV *error = ERRSV;
-    SWIG_MakePtr(error, (void *) new SAXNotRecognizedException(e), SWIGTYPE_p_XERCES_CPP_NAMESPACE__SAXNotRecognizedException, SWIG_SHADOW|0);
-}
-
-void
-makeSAXNotSupportedException(const SAXNotSupportedException& e){
-    SV *error = ERRSV;
-    SWIG_MakePtr(error, (void *) new SAXNotSupportedException(e), SWIGTYPE_p_XERCES_CPP_NAMESPACE__SAXNotSupportedException, SWIG_SHADOW|0);
-}
-
-%}
-
-// %include "make-xml-exception.i"

Modified: xerces/c/trunk/swig/interfaces/dom-includes.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/dom-includes.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/dom-includes.i (original)
+++ xerces/c/trunk/swig/interfaces/dom-includes.i Fri Oct 13 14:34:15 2006
@@ -16,15 +16,14 @@
 
 %{
 #include "xercesc/dom/DOM.hpp"
+
 #include "xercesc/util/XMLException.hpp"
+
 #include "xercesc/framework/Wrapper4InputSource.hpp"
 #include "xercesc/framework/Wrapper4DOMLSInput.hpp"
+
 #include "xercesc/parsers/AbstractDOMParser.hpp"
 #include "xercesc/parsers/XercesDOMParser.hpp"
-#include "xercesc/framework/MemBufFormatTarget.hpp"
-#include "xercesc/framework/LocalFileFormatTarget.hpp"
-#include "xercesc/framework/StdOutFormatTarget.hpp"
-#include "xercesc/util/XMLUni.hpp"
 
 %}
 

Modified: xerces/c/trunk/swig/interfaces/dom/DOMImplementation.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/dom/DOMImplementation.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/dom/DOMImplementation.i (original)
+++ xerces/c/trunk/swig/interfaces/dom/DOMImplementation.i Fri Oct 13 14:34:15 2006
@@ -1 +1,3 @@
+%ignore XERCES_CPP_NAMESPACE::DOMImplementation::loadDOMExceptionMsg;
+
 %include "xercesc/dom/DOMImplementation.hpp"

Modified: xerces/c/trunk/swig/interfaces/dom/DOMImplementationRegistry.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/dom/DOMImplementationRegistry.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/dom/DOMImplementationRegistry.i (original)
+++ xerces/c/trunk/swig/interfaces/dom/DOMImplementationRegistry.i Fri Oct 13 14:34:15 2006
@@ -1 +1,4 @@
+// we cannot create DOMImplementationSource
+%ignore XERCES_CPP_NAMESPACE::DOMImplementationRegistry::addSource;
+
 %include "xercesc/dom/DOMImplementationRegistry.hpp"

Modified: xerces/c/trunk/swig/interfaces/dom/DOMLSParserFilter.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/dom/DOMLSParserFilter.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/dom/DOMLSParserFilter.i (original)
+++ xerces/c/trunk/swig/interfaces/dom/DOMLSParserFilter.i Fri Oct 13 14:34:15 2006
@@ -1 +1 @@
-%import  "xercesc/dom/DOMLSParserFilter.hpp"
\ No newline at end of file
+%include  "xercesc/dom/DOMLSParserFilter.hpp"
\ No newline at end of file

Modified: xerces/c/trunk/swig/interfaces/dom/DOMXPathResult.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/dom/DOMXPathResult.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/dom/DOMXPathResult.i (original)
+++ xerces/c/trunk/swig/interfaces/dom/DOMXPathResult.i Fri Oct 13 14:34:15 2006
@@ -1 +1,2 @@
+XPATH_CLASS(DOMXPathResult)
 %include "xercesc/dom/DOMXPathResult.hpp"

Modified: xerces/c/trunk/swig/interfaces/framework/Wrapper4InputSource.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/framework/Wrapper4InputSource.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/framework/Wrapper4InputSource.i (original)
+++ xerces/c/trunk/swig/interfaces/framework/Wrapper4InputSource.i Fri Oct 13 14:34:15 2006
@@ -1 +1,5 @@
+// The API currently blocks these
+%ignore XERCES_CPP_NAMESPACE::Wrapper4InputSource::setStringData;
+%ignore XERCES_CPP_NAMESPACE::Wrapper4InputSource::setByteStream;
+
 %include "xercesc/framework/Wrapper4InputSource.hpp"

Modified: xerces/c/trunk/swig/interfaces/framework/XMLFormatter.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/framework/XMLFormatter.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/framework/XMLFormatter.i (original)
+++ xerces/c/trunk/swig/interfaces/framework/XMLFormatter.i Fri Oct 13 14:34:15 2006
@@ -1 +1 @@
-%import "xercesc/framework/XMLFormatter.hpp"
\ No newline at end of file
+%include "xercesc/framework/XMLFormatter.hpp"
\ No newline at end of file

Modified: xerces/c/trunk/swig/interfaces/grammars.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/grammars.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/grammars.i (original)
+++ xerces/c/trunk/swig/interfaces/grammars.i Fri Oct 13 14:34:15 2006
@@ -2,6 +2,51 @@
  * XML Schema Grammar support (DTD and W3C XML Schema)
  */
 
+/*
+ * methods not needed by the XMLValidator interfaces
+ */
+%ignore XERCES_CPP_NAMESPACE::XMLValidator::emitError;
+%ignore XERCES_CPP_NAMESPACE::XMLValidator::reinitMsgMutex;
+%ignore XERCES_CPP_NAMESPACE::XMLValidator::reinitMsgLoader;
+%ignore XERCES_CPP_NAMESPACE::XMLValidator::setErrorReporter;
+%ignore XERCES_CPP_NAMESPACE::XMLValidator::setScannerInfo;
+%ignore XERCES_CPP_NAMESPACE::XMLValidator::validateElement;
+%ignore XERCES_CPP_NAMESPACE::XMLValidator::validateAttrValue;
+%ignore XERCES_CPP_NAMESPACE::XMLValidator::reset;
+%ignore XERCES_CPP_NAMESPACE::XMLValidator::postParseValidation;
+%ignore XERCES_CPP_NAMESPACE::XMLValidator::preContentValidation;
+%ignore XERCES_CPP_NAMESPACE::XMLValidator::faultInAttr;
+%ignore XERCES_CPP_NAMESPACE::XMLValidator::checkContent;
+
+// ignore all the constructors for the Grammar components
+%ignore XERCES_CPP_NAMESPACE::DTDAttDef::DTDAttDef;
+%ignore XERCES_CPP_NAMESPACE::DTDElementDecl::DTDElementDecl;
+%ignore XERCES_CPP_NAMESPACE::DTDEntityDecl::DTDEntityDecl;
+%ignore XERCES_CPP_NAMESPACE::SchemaElementDecl::SchemaElementDecl;
+%ignore XERCES_CPP_NAMESPACE::SchemaAttDef::SchemaAttDef;
+%ignore	XERCES_CPP_NAMESPACE::DTDAttDefList::DTDAttDefList;
+%ignore	XERCES_CPP_NAMESPACE::SchemaAttDefList::SchemaAttDefList;
+
+// these methods are useless until we implement the XSerialize interface
+%ignore XERCES_CPP_NAMESPACE::Grammar::loadGrammar;
+%ignore XERCES_CPP_NAMESPACE::Grammar::storeGrammar;
+
+// these methods are useless
+%ignore XERCES_CPP_NAMESPACE::Grammar::findOrAddElemDecl;
+
+// these methods I'm not sure about
+%ignore XERCES_CPP_NAMESPACE::Grammar::getElemId;
+%ignore XERCES_CPP_NAMESPACE::Grammar::getElemDecl;
+%ignore XERCES_CPP_NAMESPACE::Grammar::getNotationDecl;
+%ignore XERCES_CPP_NAMESPACE::Grammar::putElemDecl;
+%ignore XERCES_CPP_NAMESPACE::Grammar::putNotationDecl;
+%ignore XERCES_CPP_NAMESPACE::Grammar::reset;
+// %ignore XERCES_CPP_NAMESPACE::Grammar::setGrammarDescription;
+// %ignore XERCES_CPP_NAMESPACE::Grammar::getGrammarDescription;
+%ignore XERCES_CPP_NAMESPACE::Grammar::setValidated;
+
+%ignore XERCES_CPP_NAMESPACE::XMLGrammarDescription::getMemoryManager;
+
 // for now these have no methods we need, and are only imported
 %import "xercesc/framework/XMLContentModel.hpp"
 
@@ -13,9 +58,17 @@
 %include "xercesc/framework/XMLAttDefList.hpp"
 %include "xercesc/framework/XMLAttDef.hpp"
 %include "xercesc/framework/XMLValidator.hpp"
+
 %include "xercesc/validators/common/Grammar.hpp"
 %include "xercesc/framework/XMLGrammarDescription.hpp"
 %include "xercesc/framework/XMLDTDDescription.hpp"
+
+%import "xercesc/util/BaseRefVectorOf.hpp";
+%import "xercesc/util/RefArrayVectorOf.hpp";
+namespace XERCES_CPP_NAMESPACE {
+  %template(BaseXMLChVector)  BaseRefVectorOf<XMLCh>;
+  %template(XMLChVector)  RefArrayVectorOf<XMLCh>;
+}
 %include "xercesc/framework/XMLSchemaDescription.hpp"
 
 // these are needed for both the DTD and Schema templates

Modified: xerces/c/trunk/swig/interfaces/ignore.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/ignore.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/ignore.i (original)
+++ xerces/c/trunk/swig/interfaces/ignore.i Fri Oct 13 14:34:15 2006
@@ -5,62 +5,6 @@
 %ignore createXMLReader(const XMLCh *);
 
 
-// Operators we don't want to wrap
-%ignore operator =;
-%ignore operator new;
-%ignore operator delete;
-%ignore operator <<;
-
-
-// both of these static variables cause trouble
-// the transcoding service is only useful to C++ anyway.
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::fgTransService;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::fgNetAccessor;
-
-// these are other static variables that are useless to Perl
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::fgUserPanicHandler;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::fgDefaultPanicHandler;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::fgMemoryManager;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::fgDefaulPanicHandler;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::fgArrayMemoryManager;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::fgAtomicMutex;
-
-// these are methods that are useless in Perl
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::curFilePos;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::closeFile;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::fileSize;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::openFile;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::openFileToWrite;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::openStdInHandle;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::readFileBuffer;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::writeBufferToFile;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::resetFile;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::getFullPath;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::getCurrentDirectory;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::isAnySlash;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::removeDotSlash;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::removeDotDotSlash;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::isRelative;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::weavePaths;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::getCurrentMillis;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::closeMutex;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::lockMutex;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::makeMutex;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::unlockMutex;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::loadMsgSet;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::compareAndSwap;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::atomicIncrement;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::atomicDecrement;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::recognizeNEL;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::isNELRecognized;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::strictIANAEncoding;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::isStrictIANAEncoding;
-%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::alignPointerForNewBlockAllocation;
-
-%ignore PerlErrorCallbackHandler::warning(const SAXParseException&);
-%ignore PerlErrorCallbackHandler::error(const SAXParseException&);
-%ignore PerlErrorCallbackHandler::fatalError(const SAXParseException&);
-
 // ignore the char* versions of ALL constructors
 %ignore XERCES_CPP_NAMESPACE::DOMLSParser::parseURI(const char *const );
 %ignore MemBufInputSource(const XMLByte* const, const unsigned int, const char* const,
@@ -93,19 +37,6 @@
         ,       MemoryManager* const    manager = XMLPlatformUtils::fgMemoryManager);
 
 %ignore XERCES_CPP_NAMESPACE::AttributeList::getValue(const char* const) const;
-%ignore setExternalSchemaLocation(const char* const);
-%ignore setExternalNoNamespaceSchemaLocation(const char* const);
-
-/* 
- * Ignore these char* methods for all Parsers
- */
-%ignore loadGrammar(const char* const systemId,
-                                 const short grammarType,
-                                 const bool toCache = false);
-
-
-%ignore parse(const char* const);
-%ignore parseFirst(const char *const,XMLPScanToken&,const bool);
 
 /*
  * We need these constructors to always adopt the input strings
@@ -129,17 +60,6 @@
         DOMLSInput* const
 	, DOMLSResourceResolver*);
 
-// These are odd cases. We want access to skip the method with the
-// memory manager argument, but we want access to the optional argument
-// *after* the memory manager. So we just ignore the method that doesn't 
-// include the memory manager - since our typemap defaults that argument
-// they are redundant
-%ignore createLSParser(short const,const XMLCh* const);
-%ignore SAXParser(XMLValidator*   const);
-
-// FIXME SWIG-1.3.30 broke this
-// %ignore createXMLReader();
-
 /*
  * ignore the constructors which set the MemoryManager
  */
@@ -209,16 +129,6 @@
     );
 
 
-// changing the locale and the NLS home is probably useful
-// but changing the panic manager and memory manager is not
-%ignore Initialize(const char*          const
-                         , const char*          const
-                         ,       PanicHandler*  const
-                         ,       MemoryManager* const);
-%ignore Initialize(const char*          const
-                         , const char*          const
-                         ,       PanicHandler*  const);
-
 // this constructor has a single XMLCh that interfers with another bool constructor
 %ignore DTDEntityDecl(
         const   XMLCh* const
@@ -226,10 +136,8 @@
         , const bool            fromIntSubset = false
         , const bool            specialChar = false);
 
-%ignore XERCES_CPP_NAMESPACE::DOMImplementation::loadDOMExceptionMsg;
-
 /*
- * Perl won't need to create exceptions -- FIXME -- not true
+ * Scripting languages won't need to create exceptions -- FIXME -- not true
  *   callbacks should be able to call exceptions
  */
 
@@ -281,84 +189,6 @@
         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     );
 %ignore    SAXParseException(const SAXParseException& toCopy);
-
-/*
- * methods not needed by the XMLValidator interfaces
- */
-%ignore XERCES_CPP_NAMESPACE::XMLValidator::emitError;
-%ignore XERCES_CPP_NAMESPACE::XMLValidator::checkRootElement;
-%ignore XERCES_CPP_NAMESPACE::XMLValidator::reinitMsgMutex;
-%ignore XERCES_CPP_NAMESPACE::XMLValidator::reinitMsgLoader;
-%ignore XERCES_CPP_NAMESPACE::XMLValidator::setErrorReporter;
-%ignore XERCES_CPP_NAMESPACE::XMLValidator::setScannerInfo;
-%ignore XERCES_CPP_NAMESPACE::XMLValidator::handlesSchema;
-%ignore XERCES_CPP_NAMESPACE::XMLValidator::handlesDTD;
-%ignore XERCES_CPP_NAMESPACE::XMLValidator::validateElement;
-%ignore XERCES_CPP_NAMESPACE::XMLValidator::validateAttrValue;
-%ignore XERCES_CPP_NAMESPACE::XMLValidator::requiresNamespaces;
-%ignore XERCES_CPP_NAMESPACE::XMLValidator::reset;
-%ignore XERCES_CPP_NAMESPACE::XMLValidator::postParseValidation;
-%ignore XERCES_CPP_NAMESPACE::XMLValidator::preContentValidation;
-%ignore XERCES_CPP_NAMESPACE::XMLValidator::faultInAttr;
-%ignore XERCES_CPP_NAMESPACE::XMLValidator::checkContent;
-
-// ignore all the constructors for the Grammar components
-%ignore XERCES_CPP_NAMESPACE::DTDAttDef::DTDAttDef;
-%ignore XERCES_CPP_NAMESPACE::DTDElementDecl::DTDElementDecl;
-%ignore XERCES_CPP_NAMESPACE::DTDEntityDecl::DTDEntityDecl;
-%ignore XERCES_CPP_NAMESPACE::SchemaElementDecl::SchemaElementDecl;
-%ignore XERCES_CPP_NAMESPACE::SchemaAttDef::SchemaAttDef;
-%ignore	XERCES_CPP_NAMESPACE::DTDAttDefList::DTDAttDefList;
-%ignore	XERCES_CPP_NAMESPACE::SchemaAttDefList::SchemaAttDefList;
-
-/*
- * 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.
- */
-
-// 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;
 
 // const methods
 %ignore getDocumentHandler() const;

Modified: xerces/c/trunk/swig/interfaces/includes.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/includes.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/includes.i (original)
+++ xerces/c/trunk/swig/interfaces/includes.i Fri Oct 13 14:34:15 2006
@@ -19,35 +19,36 @@
  */
 
 %{
-#include "xercesc/sax/InputSource.hpp"
 #include "xercesc/sax/SAXException.hpp"
 #include "xercesc/sax/SAXParseException.hpp"
-#include "xercesc/sax/Locator.hpp"
-#include "xercesc/sax/HandlerBase.hpp"
-#include "xercesc/sax2/Attributes.hpp"
-#include "xercesc/sax2/ContentHandler.hpp"
-#include "xercesc/sax2/LexicalHandler.hpp"
-#include "xercesc/sax2/DefaultHandler.hpp"
-#include "xercesc/sax2/SAX2XMLReader.hpp"
-#include "xercesc/sax2/XMLReaderFactory.hpp"
+#include "xercesc/sax/EntityResolver.hpp"
+
 #include "xercesc/util/PlatformUtils.hpp"
-#include "xercesc/util/TransService.hpp"
 #include "xercesc/util/XMLString.hpp"
 #include "xercesc/util/XMLUri.hpp"
 #include "xercesc/util/QName.hpp"
 #include "xercesc/util/HexBin.hpp"
 #include "xercesc/util/Base64.hpp"
-#include "xercesc/parsers/SAXParser.hpp"
-#include "xercesc/framework/LocalFileInputSource.hpp"
-#include "xercesc/framework/MemBufInputSource.hpp"
-#include "xercesc/framework/StdInInputSource.hpp"
-#include "xercesc/framework/URLInputSource.hpp"
-#include "xercesc/framework/XMLGrammarDescription.hpp"
-#include "xercesc/framework/XMLDTDDescription.hpp"
-#include "xercesc/framework/XMLSchemaDescription.hpp"
 #include "xercesc/util/NameIdPool.hpp"
 #include "xercesc/util/XMLEnumerator.hpp"
+#include "xercesc/util/SecurityManager.hpp"
+#include "xercesc/util/XMLException.hpp"
+#include "xercesc/util/XMLEntityResolver.hpp"
+
 #include "xercesc/framework/XMLValidator.hpp"
+#include "xercesc/framework/XMLDocumentHandler.hpp"
+#include "xercesc/framework/XMLPScanToken.hpp"
+
+#include "xercesc/framework/psvi/PSVIHandler.hpp"
+#include "xercesc/framework/psvi/PSVIItem.hpp"
+#include "xercesc/framework/psvi/PSVIElement.hpp"
+#include "xercesc/framework/psvi/PSVIAttribute.hpp"
+#include "xercesc/framework/psvi/PSVIAttributeList.hpp"
+
+#include "xercesc/framework/XMLGrammarDescription.hpp"
+#include "xercesc/framework/XMLDTDDescription.hpp"
+#include "xercesc/framework/XMLSchemaDescription.hpp"
+
 #include "xercesc/validators/common/Grammar.hpp"
 #include "xercesc/validators/DTD/DTDAttDef.hpp"
 #include "xercesc/validators/DTD/DTDAttDefList.hpp"
@@ -57,11 +58,7 @@
 #include "xercesc/validators/schema/SchemaValidator.hpp"
 #include "xercesc/validators/schema/SchemaAttDefList.hpp"
 #include "xercesc/validators/schema/SchemaAttDef.hpp"
-#include "xercesc/framework/XMLFormatter.hpp"
-#include "xercesc/framework/MemBufFormatTarget.hpp"
-#include "xercesc/framework/LocalFileFormatTarget.hpp"
-#include "xercesc/framework/StdOutFormatTarget.hpp"
-#include "xercesc/framework/psvi/PSVIHandler.hpp"
 
+#include "PSVIWriter/PSVIUni.hpp"
 %}
 

Modified: xerces/c/trunk/swig/interfaces/parsers.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/parsers.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/parsers.i (original)
+++ xerces/c/trunk/swig/interfaces/parsers.i Fri Oct 13 14:34:15 2006
@@ -1,57 +1,80 @@
+/*
+ * methods not needed by the public Parser interfaces
+ *
+ */
+
+// XMLEntityHandler interface
+%ignore endInputSource;
+%ignore expandSystemId;
+%ignore resetEntities;
+%ignore resolveEntity;
+%ignore startInputSource;
+
+// depricated methods - don't ask me to include these
+%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;
+
+/* 
+ * Ignore these char* methods for all Parsers
+ */
+%ignore loadGrammar(const char* const systemId,
+                                 const short grammarType,
+                                 const bool toCache = false);
+
+
+%ignore parse(const char* const);
+%ignore parseFirst(const char *const,XMLPScanToken&,const bool);
+
+%ignore setExternalSchemaLocation(const char* const);
+%ignore setExternalNoNamespaceSchemaLocation(const char* const);
+
+// These are odd cases. We want access to skip the method with the
+// memory manager argument, but we want access to the optional argument
+// *after* the memory manager. So we just ignore the method that doesn't 
+// include the memory manager - since our typemap defaults that argument
+// they are redundant
+%ignore createLSParser(short const,const XMLCh* const);
+%ignore SAXParser(XMLValidator*   const);
+%ignore XercesDOMParser(XMLValidator*   const);
+
+// FIXME SWIG-1.3.30 broke this
+// %ignore createXMLReader();
+
+// exceptions needed by SAXParser and XercesDOMParser
+%include "xercesc/sax/SAXException.hpp"
+%include "xercesc/sax/SAXParseException.hpp"
+
 // scan token helper class for progressive parsing
 %include "xercesc/framework/XMLPScanToken.hpp"
-%include "xercesc/framework/psvi/PSVIHandler.hpp"
 
-// these want to be removed to a separate DOM module
-// %include "parsers/AbstractDOMParser.i"
-// %include "parsers/XercesDOMParser.i"
+// advanced document handler interface
+%include "framework/XMLDocumentHandler.i"
 
-%include "xercesc/sax/Parser.hpp"
-%include "xercesc/parsers/SAXParser.hpp"
+// old entity resolver interface
+%include "xercesc/sax/EntityResolver.hpp"
 
-/*
- * the SAX2XMLReader methods gets a special exception handler
- *    'goto fail' must be called - either explicitly, or via SWIG_croak()
- *    to ensure that any variable cleanup is done - to avoid memory leaks.
- *    We make this a macro to be similar to the other exception handlers.
- */
-%{
-#define CATCH_SAX_EXCEPTION                           \
-    catch (const XMLException& e)                     \
-        {                                             \
-	    makeXMLException(e);                      \
-            goto fail;                                \
-        }                                             \
-    catch (const SAXNotSupportedException& e)         \
-	{                                             \
-	    makeSAXNotSupportedException(e);          \
-            goto fail;                                \
-	}                                             \
-    catch (const SAXNotRecognizedException& e)        \
-	{                                             \
-	    makeSAXNotRecognizedException(e);         \
-            goto fail;                                \
-	}                                             \
-    catch (...)                                       \
-        {                                             \
-            SWIG_croak("Handling Unknown exception"); \
-            goto fail;                                \
-        }
-%}
-
-%define SAXEXCEPTION(method)
-%exception method {
-    try {
-        $action
-    } 
-    CATCH_SAX_EXCEPTION
-}
-%enddef
-
-SAXEXCEPTION(XERCES_CPP_NAMESPACE::SAX2XMLReader::getFeature)
-SAXEXCEPTION(XERCES_CPP_NAMESPACE::SAX2XMLReader::setFeature)
-SAXEXCEPTION(XERCES_CPP_NAMESPACE::SAX2XMLReader::setProperty)
-SAXEXCEPTION(XERCES_CPP_NAMESPACE::SAX2XMLReader::getProperty)
+// new entity resolver interface
+%include "util/XMLResourceIdentifier.i"
+%include "util/XMLEntityResolver.i"
+
+// PSVI
+%include "xercesc/framework/psvi/PSVIItem.hpp"
+%include "xercesc/framework/psvi/PSVIElement.hpp"
+%include "xercesc/framework/psvi/PSVIAttribute.hpp"
+%include "xercesc/framework/psvi/PSVIAttributeList.hpp"
+%include "xercesc/framework/psvi/PSVIHandler.hpp"
 
-%include "xercesc/sax2/SAX2XMLReader.hpp"
-%include "xercesc/sax2/XMLReaderFactory.hpp"

Modified: xerces/c/trunk/swig/interfaces/parsers/AbstractDOMParser.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/parsers/AbstractDOMParser.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/parsers/AbstractDOMParser.i (original)
+++ xerces/c/trunk/swig/interfaces/parsers/AbstractDOMParser.i Fri Oct 13 14:34:15 2006
@@ -1 +1,8 @@
+%ignore XERCES_CPP_NAMESPACE::AbstractDOMParser::parseFirst(
+        const   char* const
+        ,       XMLPScanToken&);
+%ignore XERCES_CPP_NAMESPACE::AbstractDOMParser::setExternalSchemaLocation(const char* const);
+%ignore XERCES_CPP_NAMESPACE::AbstractDOMParser::setExternalNoNamespaceSchemaLocation(const char* const);
+%ignore XERCES_CPP_NAMESPACE::AbstractDOMParser::parse(const char* const);
+
 %include "xercesc/parsers/AbstractDOMParser.hpp"

Modified: xerces/c/trunk/swig/interfaces/typemaps-dom.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/typemaps-dom.i?view=diff&rev=463845&r1=463844&r2=463845
==============================================================================
--- xerces/c/trunk/swig/interfaces/typemaps-dom.i (original)
+++ xerces/c/trunk/swig/interfaces/typemaps-dom.i Fri Oct 13 14:34:15 2006
@@ -14,58 +14,362 @@
  * limitations under the License.
  */
 
-/*
- * DOM_Node*
- */
+// DOMConfiguration::canSetParameter() must handle certain args specially
+%extend XERCES_CPP_NAMESPACE::DOMConfiguration {
+%typemap(in) const void* value (void *argp, int res) {
+  if (XMLString::compareIStringASCII(arg2, XMLUni::fgDOMErrorHandler) == 0) {
+    res = SWIG_ConvertPtr($input, &argp,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMErrorHandler, 0 |  0 );
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "XERCES_CPP_NAMESPACE::DOMErrorHandler const *""'"); 
+    }
+    $1 = reinterpret_cast< XERCES_CPP_NAMESPACE::DOMErrorHandler * >(argp);
+    
+  } else if (XMLString::compareIStringASCII(arg2, XMLUni::fgXercesEntityResolver) == 0) {
+    res = SWIG_ConvertPtr($input, &argp,SWIGTYPE_p_XERCES_CPP_NAMESPACE__XMLEntityResolver, 0 |  0 );
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "XERCES_CPP_NAMESPACE::XMLEntityResolver const *""'"); 
+    }
+    $1 = reinterpret_cast< XERCES_CPP_NAMESPACE::XMLEntityResolver * >(argp);
+    
+  } else if (XMLString::compareIStringASCII(arg2, XMLUni::fgDOMResourceResolver) == 0) {
+    res = SWIG_ConvertPtr($input, &argp,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMLSResourceResolver, 0 |  0 );
+    if (!SWIG_IsOK(res)) {
+      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "$symname" "', argument " "$argnum"" of type '" "XERCES_CPP_NAMESPACE::DOMLSResourceResolver const *""'"); 
+    }
+    $1 = reinterpret_cast< XERCES_CPP_NAMESPACE::DOMLSResourceResolver * >(argp);
+    
+  } else {
+    $1 = UTF8_TRANSCODER->Local2XMLString($input);
+  }
+}
+
+%typemap(out) const void* {
+  if (XMLString::compareIStringASCII(arg2, XMLUni::fgDOMErrorHandler) == 0) {
+    $result = SWIG_NewPointerObj(SWIG_as_voidptr($1), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMErrorHandler, 0 | SWIG_SHADOW); 
+  } else if (XMLString::compareIStringASCII(arg2, XMLUni::fgXercesEntityResolver) == 0) {
+    $result = SWIG_NewPointerObj(SWIG_as_voidptr($1), SWIGTYPE_p_XERCES_CPP_NAMESPACE__XMLEntityResolver, 0 | SWIG_SHADOW); 
+  } else if (XMLString::compareIStringASCII(arg2, XMLUni::fgDOMResourceResolver) == 0) {
+    $result = SWIG_NewPointerObj(SWIG_as_voidptr($1), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMLSResourceResolver, 0 | SWIG_SHADOW); 
+  } else if (isDOMConfigXMLChParameter(arg2)) {
+    $result = UTF8_TRANSCODER->XMLString2Local((XMLCh*)$1);
+  } else {
+    $result = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >($1));
+  }
+  argvi++; 
+}
+
+%typemap(freearg) void * %{
+  if (isDOMConfigXMLChParameter(arg2)) {
+    delete (XMLCh*) $1;
+  }
+%}
+
+%{
+
+bool
+isDOMConfigObjectParameter(const XMLCh* name) {
+    if (XMLString::compareIStringASCII(name, XMLUni::fgXercesEntityResolver) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesSecurityManager) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMResourceResolver) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMErrorHandler) == 0) 
+    {
+        return true;
+    }
+    else
+    {
+        return false;
+    }
+}
+
+bool
+isDOMConfigBoolParameter(const XMLCh* name) {
+    if (XMLString::compareIStringASCII(name, XMLUni::fgDOMCharsetOverridesXMLEncoding) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMDisallowDoctype) == 0) 
+    {
+        // TODO
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMIgnoreUnknownCharacterDenormalization) == 0) 
+    {
+        // TODO
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMNamespaces) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMSupportedMediatypesOnly) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMValidate) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMValidateIfSchema) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMWellFormed) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMCanonicalForm) == 0 ) 
+    {
+        // TODO
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMCDATASections) == 0 ) 
+    {
+        // TODO
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMCheckCharacterNormalization) == 0 ) 
+    {
+        // TODO
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMComments) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMDatatypeNormalization) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMElementContentWhitespace) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMEntities) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMNamespaceDeclarations) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMNormalizeCharacters) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMSchemaLocation) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMSchemaType) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMSplitCDATASections) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMInfoset) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesSchema) == 0)
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesSchemaFullChecking) == 0)
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesIdentityConstraintChecking) == 0)
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesLoadExternalDTD) == 0)
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesContinueAfterFatalError) == 0)
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesValidationErrorAsFatal) == 0)
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesCacheGrammarFromParse) == 0)
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesUseCachedGrammarInParse) == 0)
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesCalculateSrcOfs) == 0)
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesStandardUriConformant) == 0)
+    {
+        return true;
+    }
+    else if(XMLString::compareIStringASCII(name, XMLUni::fgXercesUserAdoptsDOMDocument) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesDOMHasPSVIInfo) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesGenerateSyntheticAnnotations) == 0)
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesValidateAnnotations) == 0)
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesIgnoreCachedDTD) == 0)
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesIgnoreAnnotations) == 0)
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesDisableDefaultEntityResolution) == 0)
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesSkipDTDValidation) == 0)
+    {
+        return true;
+    }
+    else
+    {
+        return false;
+    }
+}
+
+bool
+isDOMConfigXMLChParameter(const XMLCh* name) {
+    if (XMLString::compareIStringASCII(name, XMLUni::fgXercesScannerName) == 0)
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesParserUseDocumentFromImplementation) == 0)
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesSchemaExternalSchemaLocation) == 0) 
+    {
+        return true;
+    }
+    else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesSchemaExternalNoNameSpaceSchemaLocation) == 0) 
+    {
+        return true;
+    }
+    else
+    {
+        return false;
+    }
+}
+
+%}
+
+%typecheck(SWIG_TYPECHECK_VOIDPTR)
+void*, const void* 
+{
+        int res = -1;
+	XMLCh *name = UTF8_TRANSCODER->Local2XMLString(ST(1));
+        if (XMLString::compareIStringASCII(name, XMLUni::fgDOMErrorHandler) == 0) {
+          res = 1;
+        } else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesEntityResolver) == 0) {
+	  res = 1;
+        } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMSchemaLocation) == 0) {
+	  res = 1;
+        } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMSchemaType) == 0) {
+	  res = 1;
+        } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMResourceResolver) == 0) {
+	  res = 1;
+        } else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesSecurityManager) == 0) {
+	  res = 1;
+        } else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesScannerName) == 0) {
+	  res = 1;
+        } else if (XMLString::compareIStringASCII(name, XMLUni::fgDOMSchemaType) == 0) {
+	  res = 1;
+        } else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesSchemaExternalSchemaLocation) == 0) {
+	  res = 1;
+        } else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesSchemaExternalNoNameSpaceSchemaLocation) == 0) {
+	  res = 1;
+        } else if (XMLString::compareIStringASCII(name, XMLUni::fgXercesParserUseDocumentFromImplementation) == 0) {
+	  res = 1;
+        }
+        _v = SWIG_CheckState(res);
+}
+}
+
 
-%typemap(out) XERCES_CPP_NAMESPACE::DOMNode * = SWIGTYPE *DYNAMIC;
+%typemap(out) XERCES_CPP_NAMESPACE::XMLFormatTarget * = SWIGTYPE *DYNAMIC;
 
-DYNAMIC_CAST(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, DOMNode_dynamic_cast);
+DYNAMIC_CAST(SWIGTYPE_p_XERCES_CPP_NAMESPACE__XMLFormatTarget, XMLFormatTarget_dynamic_cast);
 
 %{
 static swig_type_info *
-DOMNode_dynamic_cast(void **ptr) {
-   DOMNode **nptr = (DOMNode **) ptr;
+XMLFormatTarget_dynamic_cast(void **ptr) {
+   XMLFormatTarget **nptr = (XMLFormatTarget **) ptr;
    if (*nptr == NULL) {
        return NULL;
    }
-   short int type = (*nptr)->getNodeType();
-   if (type == DOMNode::TEXT_NODE) {
-      return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText;
-   }
-   if (type == DOMNode::PROCESSING_INSTRUCTION_NODE) {
-      return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction;
-   }
-   if (type == DOMNode::DOCUMENT_NODE) {
-      return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocument;
-   }
-   if (type == DOMNode::ELEMENT_NODE) {
-      return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement;
+   if (dynamic_cast< XERCES_CPP_NAMESPACE::MemBufFormatTarget * >(*nptr)) {
+      return SWIGTYPE_p_XERCES_CPP_NAMESPACE__MemBufFormatTarget;
    }
-   if (type == DOMNode::ENTITY_REFERENCE_NODE) {
-      return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntityReference;
+   if (dynamic_cast< XERCES_CPP_NAMESPACE::LocalFileFormatTarget * >(*nptr)) {
+      return SWIGTYPE_p_XERCES_CPP_NAMESPACE__LocalFileFormatTarget;
    }
-   if (type == DOMNode::CDATA_SECTION_NODE) {
-      return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCDATASection;
+   if (dynamic_cast< XERCES_CPP_NAMESPACE::StdOutFormatTarget * >(*nptr)) {
+      return SWIGTYPE_p_XERCES_CPP_NAMESPACE__StdOutFormatTarget;
    }
-   if (type == DOMNode::CDATA_SECTION_NODE) {
-      return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCDATASection;
+   return NULL;
+}
+%}
+
+%typemap(out) XERCES_CPP_NAMESPACE::InputSource * = SWIGTYPE *DYNAMIC;
+
+DYNAMIC_CAST(SWIGTYPE_p_XERCES_CPP_NAMESPACE__InputSource, InputSource_dynamic_cast);
+
+%{
+static swig_type_info *
+InputSource_dynamic_cast(void **ptr) {
+   InputSource **nptr = (InputSource **) ptr;
+   if (*nptr == NULL) {
+       return NULL;
    }
-   if (type == DOMNode::COMMENT_NODE) {
-      return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMComment;
+
+   if (dynamic_cast< XERCES_CPP_NAMESPACE::Wrapper4DOMLSInput * >(*nptr)) {
+      return SWIGTYPE_p_XERCES_CPP_NAMESPACE__Wrapper4DOMLSInput;
    }
-   if (type == DOMNode::DOCUMENT_TYPE_NODE) {
-      return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType;
+   if (dynamic_cast< XERCES_CPP_NAMESPACE::MemBufInputSource * >(*nptr)) {
+      return SWIGTYPE_p_XERCES_CPP_NAMESPACE__MemBufInputSource;
    }
-   if (type == DOMNode::ENTITY_NODE) {
-      return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity;
+   if (dynamic_cast< XERCES_CPP_NAMESPACE::LocalFileInputSource * >(*nptr)) {
+      return SWIGTYPE_p_XERCES_CPP_NAMESPACE__LocalFileInputSource;
    }
-   if (type == DOMNode::ATTRIBUTE_NODE) {
-      return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr;
+   if (dynamic_cast< XERCES_CPP_NAMESPACE::URLInputSource * >(*nptr)) {
+      return SWIGTYPE_p_XERCES_CPP_NAMESPACE__URLInputSource;
    }
-   if (type == DOMNode::NOTATION_NODE) {
-      return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNotation;
+   if (dynamic_cast< XERCES_CPP_NAMESPACE::StdInInputSource * >(*nptr)) {
+      return SWIGTYPE_p_XERCES_CPP_NAMESPACE__StdInInputSource;
    }
    return NULL;
 }
 %}
+



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