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/09/11 12:08:11 UTC

svn commit: r442160 [1/8] - in /xerces/c/trunk/swig: interfaces/ interfaces/Perl/ perl/ perl/DOM/ perl/Handler/ perl/Transcoder/ perl/samples/ perl/t/

Author: jasons
Date: Mon Sep 11 03:08:07 2006
New Revision: 442160

URL: http://svn.apache.org/viewvc?view=rev&rev=442160
Log:
split out DOM and Transcoder into seperate modules

Added:
    xerces/c/trunk/swig/interfaces/Perl/Xerces_DOM-extra.pm
    xerces/c/trunk/swig/interfaces/Perl/dom-callback.i
    xerces/c/trunk/swig/interfaces/Perl/dom-includes.i
    xerces/c/trunk/swig/interfaces/Perl/includes.i
    xerces/c/trunk/swig/interfaces/Xerces_DOM.i
    xerces/c/trunk/swig/interfaces/dom-includes.i
    xerces/c/trunk/swig/interfaces/includes.i
    xerces/c/trunk/swig/perl/DOM/   (with props)
    xerces/c/trunk/swig/perl/DOM/DOM.pm
    xerces/c/trunk/swig/perl/DOM/Makefile.PL
    xerces/c/trunk/swig/perl/DOM/Xerces_DOM.cpp
    xerces/c/trunk/swig/perl/Handler/PerlEntityResolverHandler.cpp
      - copied, changed from r437653, xerces/c/trunk/swig/perl/Handler/PerlEntityResolverHandler.i
    xerces/c/trunk/swig/perl/Handler/PerlNodeFilterCallbackHandler.cpp
      - copied, changed from r437653, xerces/c/trunk/swig/perl/Handler/PerlNodeFilterCallbackHandler.i
    xerces/c/trunk/swig/perl/Transcoder/   (with props)
    xerces/c/trunk/swig/perl/Transcoder/Makefile.PL
      - copied, changed from r437653, xerces/c/trunk/swig/perl/Handler/Makefile.PL
    xerces/c/trunk/swig/perl/Transcoder/Transcoder.cpp
    xerces/c/trunk/swig/perl/Transcoder/Transcoder.hpp
    xerces/c/trunk/swig/perl/Transcoder/XMLExceptionHandler.cpp
    xerces/c/trunk/swig/perl/Transcoder/XMLExceptionHandler.hpp
    xerces/c/trunk/swig/perl/t/00dom_module.t
    xerces/c/trunk/swig/perl/t/00module.t
    xerces/c/trunk/swig/perl/t/DOMStringList.t
    xerces/c/trunk/swig/perl/xerces-swig-perl.hpp
Removed:
    xerces/c/trunk/swig/interfaces/callback.i
    xerces/c/trunk/swig/interfaces/typemaps.i
    xerces/c/trunk/swig/perl/Handler/PerlEntityResolverHandler.i
    xerces/c/trunk/swig/perl/Handler/PerlNodeFilterCallbackHandler.i
Modified:
    xerces/c/trunk/swig/interfaces/Perl/Xerces-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-shadow.i
    xerces/c/trunk/swig/interfaces/Perl/errors.i
    xerces/c/trunk/swig/interfaces/Perl/typemaps-xmlch.i
    xerces/c/trunk/swig/interfaces/Perl/typemaps.i
    xerces/c/trunk/swig/interfaces/Xerces.i
    xerces/c/trunk/swig/interfaces/defines.i
    xerces/c/trunk/swig/interfaces/parsers.i
    xerces/c/trunk/swig/interfaces/typemaps-general.i
    xerces/c/trunk/swig/perl/   (props changed)
    xerces/c/trunk/swig/perl/Handler/Makefile.PL
    xerces/c/trunk/swig/perl/Handler/PerlCallbackHandler.cpp
    xerces/c/trunk/swig/perl/Handler/PerlCallbackHandler.hpp
    xerces/c/trunk/swig/perl/Handler/PerlContentCallbackHandler.cpp
    xerces/c/trunk/swig/perl/Handler/PerlDocumentCallbackHandler.cpp
    xerces/c/trunk/swig/perl/Handler/PerlErrorCallbackHandler.cpp
    xerces/c/trunk/swig/perl/Makefile.PL
    xerces/c/trunk/swig/perl/TODO
    xerces/c/trunk/swig/perl/Xerces.cpp
    xerces/c/trunk/swig/perl/Xerces.pm
    xerces/c/trunk/swig/perl/samples/DOM2hash.pl
    xerces/c/trunk/swig/perl/samples/DOMCount.pl
    xerces/c/trunk/swig/perl/samples/DOMCreate.pl
    xerces/c/trunk/swig/perl/samples/DOMPrint.pl
    xerces/c/trunk/swig/perl/samples/validator-dom.pl
    xerces/c/trunk/swig/perl/t/01utf8.t
    xerces/c/trunk/swig/perl/t/Attributes.t
    xerces/c/trunk/swig/perl/t/DOMAttr.t
    xerces/c/trunk/swig/perl/t/DOMBuilder.t
    xerces/c/trunk/swig/perl/t/DOMConfig.t
    xerces/c/trunk/swig/perl/t/DOMCount.t
    xerces/c/trunk/swig/perl/t/DOMCreate.t
    xerces/c/trunk/swig/perl/t/DOMDocument.t
    xerces/c/trunk/swig/perl/t/DOMElement.t
    xerces/c/trunk/swig/perl/t/DOMEntity.t
    xerces/c/trunk/swig/perl/t/DOMException.t
    xerces/c/trunk/swig/perl/t/DOMImplementation.t
    xerces/c/trunk/swig/perl/t/DOMNamedNodeMap.t
    xerces/c/trunk/swig/perl/t/DOMNode.t
    xerces/c/trunk/swig/perl/t/DOMNodeIterator.t
    xerces/c/trunk/swig/perl/t/DOMNodeList.t
    xerces/c/trunk/swig/perl/t/DOMParser.t
    xerces/c/trunk/swig/perl/t/DOMPrint.t
    xerces/c/trunk/swig/perl/t/DOMTreeWalker.t
    xerces/c/trunk/swig/perl/t/DOMWriter.t
    xerces/c/trunk/swig/perl/t/SAX2XMLReader.t
    xerces/c/trunk/swig/perl/t/SAXException.t
    xerces/c/trunk/swig/perl/t/SAXParser.t
    xerces/c/trunk/swig/perl/t/TestUtils.pm
    xerces/c/trunk/swig/perl/t/UTF8.t
    xerces/c/trunk/swig/perl/t/XMLUni.t

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=442160&r1=442159&r2=442160
==============================================================================
--- xerces/c/trunk/swig/interfaces/Perl/Xerces-extra.pm (original)
+++ xerces/c/trunk/swig/interfaces/Perl/Xerces-extra.pm Mon Sep 11 03:08:07 2006
@@ -4,7 +4,7 @@
 use Carp;
 use vars qw(@EXPORT_OK $VERSION %REMEMBER);
 @EXPORT_OK = qw(error);
-$VERSION = 260.2;
+$VERSION = 300.060829;
 
 #
 # Cleanup removes all objects being remembered by an object
@@ -630,28 +630,6 @@
   return %hash;
 }
 
-package XML::Xerces::DOMNodeList;
-# convert the NodeList to a perl list
-sub to_list {
-  my $self = shift;
-  my @list;
-  for (my $i=0;$i<$self->getLength();$i++) {
-    push(@list,$self->item($i));
-  }
-  return @list;
-}
-
-package XML::Xerces::DOMStringList;
-# convert the StringList to a perl list
-sub to_list {
-  my $self = shift;
-  my @list;
-  for (my $i=0;$i<$self->getLength();$i++) {
-    push(@list,$self->item($i));
-  }
-  return @list;
-}
-
 package XML::Xerces::Attributes;
 sub to_hash {
   my $self = shift;
@@ -674,186 +652,6 @@
     $hash{$self->getName($i)} = $self->getValue($i)
   }
   return %hash;
-}
-
-package XML::Xerces::DOMNamedNodeMap;
-# convert the NamedNodeMap to a perl hash
-sub to_hash {
-  my $self = shift;
-  my @list;
-  for (my $i=0;$i<$self->getLength();$i++) {
-    my $node = $self->item($i);
-    push(@list, $node->to_hash());
-  }
-  return @list;
-}
-
-package XML::Xerces::DOMNode;
-sub to_hash {
-  my $self = shift;
-  return ($self->getNodeName,$self->getNodeValue);
-}
-
-sub quote_content {
-  my ($self,$node_value) = @_;
-
-  $node_value =~ s/&/&amp;/g;
-  $node_value =~ s/</&lt;/g;
-  $node_value =~ s/>/&gt;/g;
-  $node_value =~ s/\"/&quot;/g;
-  $node_value =~ s/\'/&apos;/g;
-
-  return $node_value;
-}
-
-package XML::Xerces::DOMEntity;
-sub to_hash {
-  my $self = shift;
-  if ($self->hasChildNodes) {
-    return ($self->getNodeName(),
-            $self->getFirstChild->getNodeValue());
-  } else {
-    return ($self->getNodeName(), '');
-  }
-}
-
-package XML::Xerces::DOMText;
-sub serialize {
-  return $_[0]->quote_content($_[0]->getNodeValue);
-}
-
-package XML::Xerces::DOMProcessingInstruction;
-sub serialize {
-  my $output .= '<?' . $_[0]->getNodeName;
-  if (length(my $str = $_[0]->getNodeValue)) {
-    $output .= " $str"; 
-  }
-  $output .= '?>';
-  return $output;
-}
-
-package XML::Xerces::DOMDocument;
-sub serialize {
-  my $output;
-  my $indent = 2;
-  for(my $child = $_[0]->getFirstChild() ;
-     defined $child ;
-     $child = $child->getNextSibling())
-  {
-    $output .= $child->serialize($indent);
-  }
-  return "$output\n";
-}
-
-package XML::Xerces::DOMElement;
-sub serialize {
-  my ($self,$indent) = @_;
-  $indent ||= 0;
-  my $output;
-  ELEMENT: {
-    my $node_name = $self->getNodeName;
-    $output .= "<$node_name";
-
-    my $attributes = $self->getAttributes;
-    my $attribute_count = $attributes->getLength;
-
-    for(my $ix = 0 ; $ix < $attribute_count ; ++$ix) {
-      my $attribute = $attributes->item($ix);
-      $output .= ' ' . $attribute->getNodeName . '="' . $self->quote_content($attribute->getNodeValue) . '"';
-    }
-
-    my $child = $self->getFirstChild();
-    if (!defined $child) {
-      $output .= '/>';
-      last ELEMENT;
-    }
-
-    $output .= '>';
-    while (defined $child) {
-      $output .= $child->serialize($indent+2);
-      $child = $child->getNextSibling();
-    }
-    $output .= "</$node_name>";
-  }
-  return $output;
-}
-
-package XML::Xerces::DOMEntityReference;
-sub serialize {
-  my ($self) = @_;
-  my $output;
-  for(my $child = $self->getFirstChild() ;
-     defined $child;
-     $child = $child->getNextSibling())
-  {
-    $output .= $child->serialize();
-  }
-  return $output;
-}
-
-package XML::Xerces::DOMCDATASection;
-sub serialize {
-  return '<![CDATA[' . $_[0]->getNodeValue . ']]>';
-}
-
-package XML::Xerces::DOMComment;
-sub serialize {
-  return '<!--' . $_[0]->getNodeValue . "-->\n";
-}
-
-package XML::Xerces::DOMDocumentType;
-sub serialize {
-  my $output;
-  $output .= '<!DOCTYPE ' . $_[0]->getNodeName;
-
-  my $id;
-  if ($id = $_[0]->getPublicId) {
-    $output .= qq[ PUBLIC "$id"];
-    if ($id = $_[0]->getSystemId) {
-      $output .= qq[ "$id"];
-    }
-  } elsif ($id = $_[0]->getSystemId) {
-    $output .= qq[ SYSTEM "$id"];
-  }
-
-  if ($id = $_[0]->getInternalSubset) {
-    $output .= " [$id]";
-  }
-
-  $output .= ">\n";
-  return $output;
-}
-
-package XML::Xerces::DOMEntity;
-sub serialize {
-  my $output;
-  $output .= '<!ENTITY ' . $_[0]->getNodeName;
-
-  my $id;
-  if ($id = $_[0]->getPublicId) { $output .= qq[ PUBLIC "$id"]; }
-  if ($id = $_[0]->getSystemId) { $output .= qq[ SYSTEM "$id"]; }
-  if ($id = $_[0]->getNotationName) { $output .= qq[ NDATA "$id"]; }
-
-  $output .= '>';
-  return $output;
-}
-
-package XML::Xerces::DOMException;
-sub getMessage {
-  return shift->{msg};
-}
-
-sub getCode {
-  return shift->{code};
-}
-
-# in previous versions we needed to define this method
-# but it is now obsolete
-package XML::Xerces::DOMElement;
-sub get_text {
-  my $self = shift;
-  warn "XML::Xerces::DOMElement::get_text is depricated, use getTextContent instead";
-  return $self->getTextContent(@_);
 }
 
 package XML::Xerces::XMLCatalogResolver;

Added: 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=auto&rev=442160
==============================================================================
--- xerces/c/trunk/swig/interfaces/Perl/Xerces_DOM-extra.pm (added)
+++ xerces/c/trunk/swig/interfaces/Perl/Xerces_DOM-extra.pm Mon Sep 11 03:08:07 2006
@@ -0,0 +1,202 @@
+package XML::Xerces::DOMNodeList;
+# convert the NodeList to a perl list
+sub to_list {
+  my $self = shift;
+  my @list;
+  for (my $i=0;$i<$self->getLength();$i++) {
+    push(@list,$self->item($i));
+  }
+  return @list;
+}
+
+package XML::Xerces::DOMStringList;
+# convert the StringList to a perl list
+sub to_list {
+  my $self = shift;
+  my @list;
+  for (my $i=0;$i<$self->getLength();$i++) {
+    push(@list,$self->item($i));
+  }
+  return @list;
+}
+
+package XML::Xerces::DOMNamedNodeMap;
+# convert the NamedNodeMap to a perl hash
+sub to_hash {
+  my $self = shift;
+  my @list;
+  for (my $i=0;$i<$self->getLength();$i++) {
+    my $node = $self->item($i);
+    push(@list, $node->to_hash());
+  }
+  return @list;
+}
+
+package XML::Xerces::DOMNode;
+sub to_hash {
+  my $self = shift;
+  return ($self->getNodeName,$self->getNodeValue);
+}
+
+sub quote_content {
+  my ($self,$node_value) = @_;
+
+  $node_value =~ s/&/&amp;/g;
+  $node_value =~ s/</&lt;/g;
+  $node_value =~ s/>/&gt;/g;
+  $node_value =~ s/\"/&quot;/g;
+  $node_value =~ s/\'/&apos;/g;
+
+  return $node_value;
+}
+
+package XML::Xerces::DOMEntity;
+sub to_hash {
+  my $self = shift;
+  if ($self->hasChildNodes) {
+    return ($self->getNodeName(),
+            $self->getFirstChild->getNodeValue());
+  } else {
+    return ($self->getNodeName(), '');
+  }
+}
+
+package XML::Xerces::DOMText;
+sub serialize {
+  return $_[0]->quote_content($_[0]->getNodeValue);
+}
+
+package XML::Xerces::DOMProcessingInstruction;
+sub serialize {
+  my $output .= '<?' . $_[0]->getNodeName;
+  if (length(my $str = $_[0]->getNodeValue)) {
+    $output .= " $str"; 
+  }
+  $output .= '?>';
+  return $output;
+}
+
+package XML::Xerces::DOMDocument;
+sub serialize {
+  my $output;
+  my $indent = 2;
+  for(my $child = $_[0]->getFirstChild() ;
+     defined $child ;
+     $child = $child->getNextSibling())
+  {
+    $output .= $child->serialize($indent);
+  }
+  return "$output\n";
+}
+
+package XML::Xerces::DOMElement;
+sub serialize {
+  my ($self,$indent) = @_;
+  $indent ||= 0;
+  my $output;
+  ELEMENT: {
+    my $node_name = $self->getNodeName;
+    $output .= "<$node_name";
+
+    my $attributes = $self->getAttributes;
+    my $attribute_count = $attributes->getLength;
+
+    for(my $ix = 0 ; $ix < $attribute_count ; ++$ix) {
+      my $attribute = $attributes->item($ix);
+      $output .= ' ' . $attribute->getNodeName . '="' . $self->quote_content($attribute->getNodeValue) . '"';
+    }
+
+    my $child = $self->getFirstChild();
+    if (!defined $child) {
+      $output .= '/>';
+      last ELEMENT;
+    }
+
+    $output .= '>';
+    while (defined $child) {
+      $output .= $child->serialize($indent+2);
+      $child = $child->getNextSibling();
+    }
+    $output .= "</$node_name>";
+  }
+  return $output;
+}
+
+package XML::Xerces::DOMEntityReference;
+sub serialize {
+  my ($self) = @_;
+  my $output;
+  for(my $child = $self->getFirstChild() ;
+     defined $child;
+     $child = $child->getNextSibling())
+  {
+    $output .= $child->serialize();
+  }
+  return $output;
+}
+
+package XML::Xerces::DOMCDATASection;
+sub serialize {
+  return '<![CDATA[' . $_[0]->getNodeValue . ']]>';
+}
+
+package XML::Xerces::DOMComment;
+sub serialize {
+  return '<!--' . $_[0]->getNodeValue . "-->\n";
+}
+
+package XML::Xerces::DOMDocumentType;
+sub serialize {
+  my $output;
+  $output .= '<!DOCTYPE ' . $_[0]->getNodeName;
+
+  my $id;
+  if ($id = $_[0]->getPublicId) {
+    $output .= qq[ PUBLIC "$id"];
+    if ($id = $_[0]->getSystemId) {
+      $output .= qq[ "$id"];
+    }
+  } elsif ($id = $_[0]->getSystemId) {
+    $output .= qq[ SYSTEM "$id"];
+  }
+
+  if ($id = $_[0]->getInternalSubset) {
+    $output .= " [$id]";
+  }
+
+  $output .= ">\n";
+  return $output;
+}
+
+package XML::Xerces::DOMEntity;
+sub serialize {
+  my $output;
+  $output .= '<!ENTITY ' . $_[0]->getNodeName;
+
+  my $id;
+  if ($id = $_[0]->getPublicId) { $output .= qq[ PUBLIC "$id"]; }
+  if ($id = $_[0]->getSystemId) { $output .= qq[ SYSTEM "$id"]; }
+  if ($id = $_[0]->getNotationName) { $output .= qq[ NDATA "$id"]; }
+
+  $output .= '>';
+  return $output;
+}
+
+package XML::Xerces::DOMException;
+sub getMessage {
+  return shift->{msg};
+}
+
+sub getCode {
+  return shift->{code};
+}
+
+# in previous versions we needed to define this method
+# but it is now obsolete
+package XML::Xerces::DOMElement;
+sub get_text {
+  my $self = shift;
+  warn "XML::Xerces::DOMElement::get_text is depricated, use getTextContent instead";
+  return $self->getTextContent(@_);
+}
+

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=442160&r1=442159&r2=442160
==============================================================================
--- xerces/c/trunk/swig/interfaces/Perl/callback.i (original)
+++ xerces/c/trunk/swig/interfaces/Perl/callback.i Mon Sep 11 03:08:07 2006
@@ -19,6 +19,14 @@
  *
  */ 
 
+%include "PerlCallbackHandler.hpp"
+%include "PerlErrorCallbackHandler.hpp"
+%include "PerlEntityResolverHandler.hpp"
+%include "PerlDocumentCallbackHandler.hpp"
+%include "PerlContentCallbackHandler.hpp"
+
+// %include "PerlNodeFilterCallbackHandler.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=442160&r1=442159&r2=442160
==============================================================================
--- xerces/c/trunk/swig/interfaces/Perl/defines.i (original)
+++ xerces/c/trunk/swig/interfaces/Perl/defines.i Mon Sep 11 03:08:07 2006
@@ -21,13 +21,6 @@
 
 %{
 
-#include "PerlCallbackHandler.hpp"
-#include "PerlErrorCallbackHandler.hpp"
-#include "PerlDocumentCallbackHandler.hpp"
-#include "PerlContentCallbackHandler.hpp"
-#include "PerlEntityResolverHandler.i"
-#include "PerlNodeFilterCallbackHandler.i"
-
 static void
 SWIG_Disown(SV *sv) {
   

Added: 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=auto&rev=442160
==============================================================================
--- xerces/c/trunk/swig/interfaces/Perl/dom-callback.i (added)
+++ xerces/c/trunk/swig/interfaces/Perl/dom-callback.i Mon Sep 11 03:08:07 2006
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2002,2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Perl/callback.i - an experimental typecheck for returning callback subclasses
+ *
+ */ 
+
+%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

Added: xerces/c/trunk/swig/interfaces/Perl/dom-includes.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/Perl/dom-includes.i?view=auto&rev=442160
==============================================================================
--- xerces/c/trunk/swig/interfaces/Perl/dom-includes.i (added)
+++ xerces/c/trunk/swig/interfaces/Perl/dom-includes.i Mon Sep 11 03:08:07 2006
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2002,2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Perl/includes.i - all #includes needed for Xerces.cpp
+ *
+ */ 
+
+%{
+
+#include "PerlNodeFilterCallbackHandler.hpp"
+
+%}
\ No newline at end of file

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=442160&r1=442159&r2=442160
==============================================================================
--- xerces/c/trunk/swig/interfaces/Perl/dom-shadow.i (original)
+++ xerces/c/trunk/swig/interfaces/Perl/dom-shadow.i Mon Sep 11 03:08:07 2006
@@ -56,6 +56,7 @@
 DOMLIST_METHOD(DOMElement,getElementsByTagName)
 DOMLIST_METHOD(DOMElement,getElementsByTagNameNS)
 DOMLIST_METHOD(DOMNode,getChildNodes)
+DOMLIST_METHOD(DOMConfiguration,getParameterNames)
 
 // Define a macro to rewrite all methods that return a map of DOMNodes
 

Modified: xerces/c/trunk/swig/interfaces/Perl/errors.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/Perl/errors.i?view=diff&rev=442160&r1=442159&r2=442160
==============================================================================
--- xerces/c/trunk/swig/interfaces/Perl/errors.i (original)
+++ xerces/c/trunk/swig/interfaces/Perl/errors.i Mon Sep 11 03:08:07 2006
@@ -1,4 +1,7 @@
 %{
+
+#define SWIG_SetErrorf SWIG_Perl_SetErrorf
+
 static void
 SWIG_Perl_SetErrorf(const char *fmt, ...) {
   va_list args;

Added: xerces/c/trunk/swig/interfaces/Perl/includes.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/Perl/includes.i?view=auto&rev=442160
==============================================================================
--- xerces/c/trunk/swig/interfaces/Perl/includes.i (added)
+++ xerces/c/trunk/swig/interfaces/Perl/includes.i Mon Sep 11 03:08:07 2006
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2002,2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Perl/includes.i - all #includes needed for Xerces.cpp
+ *
+ */ 
+
+%{
+
+#include "Transcoder.hpp"
+#include "XMLExceptionHandler.hpp"
+
+#include "PerlCallbackHandler.hpp"
+#include "PerlErrorCallbackHandler.hpp"
+#include "PerlDocumentCallbackHandler.hpp"
+#include "PerlContentCallbackHandler.hpp"
+#include "PerlEntityResolverHandler.hpp"
+
+%}
\ 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=442160&r1=442159&r2=442160
==============================================================================
--- xerces/c/trunk/swig/interfaces/Perl/typemaps-xmlch.i (original)
+++ xerces/c/trunk/swig/interfaces/Perl/typemaps-xmlch.i Mon Sep 11 03:08:07 2006
@@ -46,7 +46,7 @@
     goto fail;
   } else {
     // we convert *everything* into a string that isn't undef
-    $1 = Perl2XMLString($input);
+    $1 = UTF8_TRANSCODER->Perl2XMLString($input);
   }
 %}
 
@@ -56,23 +56,46 @@
 
 // out typemap
 %typemap(out) XMLCh * %{
-  $result = XMLString2Perl($1);
+  $result = UTF8_TRANSCODER->XMLString2Perl($1);
   ++argvi;
 %}
 
 // varout typemap (for global variables)
 // useful for XMLUni constants
 %typemap(varout) XMLCh[] %{
-  sv_setsv((SV*)$result, XMLString2Perl($1));
+  sv_setsv((SV*)$result, UTF8_TRANSCODER->XMLString2Perl($1));
 %}
 
 // fgBooleanValueSpace is an array of XMLCh*
 %typemap(varout) XMLCh[][8] %{
     AV *myav = newAV();
     for (int i=0;i<4;i++) {
-        av_push(myav, XMLString2Perl($1[i]));
+        av_push(myav, UTF8_TRANSCODER->XMLString2Perl($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=442160&r1=442159&r2=442160
==============================================================================
--- xerces/c/trunk/swig/interfaces/Perl/typemaps.i (original)
+++ xerces/c/trunk/swig/interfaces/Perl/typemaps.i Mon Sep 11 03:08:07 2006
@@ -24,8 +24,9 @@
 }
 
 // XMLByte arrays are just unisgned char*'s
-%typemap(out) const XMLByte* getRawBuffer() {
-  %set_output(SWIG_FromCharPtr((char*)result));
+// force loading of FromCharPtr fragment - needed for DOM
+%typemap(out, noblock=1, fragment="SWIG_FromCharPtr") const XMLByte* getRawBuffer() {
+  %set_output(SWIG_FromCharPtr((char*)$1));
 }
 
 /*

Modified: xerces/c/trunk/swig/interfaces/Xerces.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/Xerces.i?view=diff&rev=442160&r1=442159&r2=442160
==============================================================================
--- xerces/c/trunk/swig/interfaces/Xerces.i (original)
+++ xerces/c/trunk/swig/interfaces/Xerces.i Mon Sep 11 03:08:07 2006
@@ -29,22 +29,44 @@
 %module "XML::Xerces"
 #endif
 
-%include "defines.i"
-
-%include "typemaps.i"
-
-%include "typemaps-dom.i"
+%include "includes.i"
 
 /*
- * Import the language specific macros
+ * 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
  */
 
 #ifdef SWIGPERL
-%include "Perl/callback.i"
 %include "Perl/shadow.i"
-%include "Perl/dom-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
 
+/*
+ * 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  */
@@ -142,7 +164,7 @@
  * DOM
  */
 
-%include "DOM.i"
+// %include "DOM.i"
 
 // %include "xercesc/dom/DOMNode.hpp"
 
@@ -165,31 +187,31 @@
 %include "parsers.i"
 
 /* 
- * Callbacks - this needs to be at the very end
- *   so that SWIG can wrap the superclass methods properly
- */
-
-%include "callback.i"
-
-/* 
  * Include extra verbatim C code in the initialization function
  */
 %init {
     // we create the global transcoder for UTF-8 to UTF-16
-    XMLTransService::Codes failReason;
-    XMLPlatformUtils::Initialize(); // first we must create the transservice
-    UTF8_ENCODING = XMLString::transcode("UTF-8");
-    UTF8_TRANSCODER =
-      XMLPlatformUtils::fgTransService->makeNewTranscoderFor(UTF8_ENCODING,
-                                                             failReason,
-                                                             1024,
-							     XMLPlatformUtils::fgMemoryManager);
+    // 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
+
+/* 
+ * Callbacks - this needs to be at the very end
+ *   so that SWIG can wrap the superclass methods properly
+ */
+
+%include "Perl/callback.i"
 
 /* 
  * Include extra verbatim Perl code

Added: xerces/c/trunk/swig/interfaces/Xerces_DOM.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/Xerces_DOM.i?view=auto&rev=442160
==============================================================================
--- xerces/c/trunk/swig/interfaces/Xerces_DOM.i (added)
+++ xerces/c/trunk/swig/interfaces/Xerces_DOM.i Mon Sep 11 03:08:07 2006
@@ -0,0 +1,272 @@
+/*
+ * Copyright 2002,2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* 
+ * All DOM classes and their related SWIG alterations go in this interface file
+ */
+
+/*
+ * Modulename - this *must* be in double quotes to properly handle
+ *   the namespace
+ */
+#ifdef SWIGPERL
+%module(package="XML::Xerces") "DOM"
+// %module "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"
+#endif
+
+// Get the type information
+%import "Xerces.i"
+
+/*
+ * After this we will be under the Xerces namespace
+ *
+ */
+
+%{
+
+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"
+
+%include "typemaps-dom.i"
+
+%include "typemaps-general.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 "xercesc/util/XercesDefs.hpp"
+
+/* 
+ * All %ignore directives
+ */
+
+%include "ignore.i"
+
+/*
+ * Operator support
+ */
+
+// Operators we do want
+// %rename(operator_assignment) operator=;
+%rename(operator_equal_to) operator==;
+%rename(operator_not_equal_to) operator!=;
+
+
+/*
+ * the DOM classes 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.
+ *    By making these macros, it reduces the code *file* size dramatically
+ *    (but doesn't reduce the compiled file size at all...)
+ */
+
+%{
+#define CATCH_DOM_EXCEPTION         \
+    catch (const XMLException& e)   \
+    {                               \
+        makeXMLException(e);        \
+	goto fail;                  \
+    }                               \
+    catch (const DOMException& e)   \
+    {                               \
+	makeDOMException(e);        \
+	goto fail;                  \
+    }                               \
+    catch (...)                     \
+    {                               \
+        SWIG_croak("Handling Unknown exception"); \
+        goto fail;                  \
+    }
+%}
+
+%exception {
+    try 
+    {
+        $action
+    } 
+    CATCH_DOM_EXCEPTION
+}
+
+
+// Introduced in DOM Level 1
+%include "dom/DOMException.i"
+%include "dom/DOMNode.i"
+%include "dom/DOMAttr.i"
+%include "dom/DOMElement.i"
+%include "dom/DOMEntity.i"
+%include "dom/DOMDocumentType.i"
+%include "dom/DOMCharacterData.i"
+%include "dom/DOMComment.i"
+%include "dom/DOMText.i"
+%include "dom/DOMCDATASection.i"
+%include "dom/DOMNodeList.i"
+%include "dom/DOMNamedNodeMap.i"
+%include "dom/DOMDocumentFragment.i"
+%include "dom/DOMEntityReference.i"
+%include "dom/DOMNotation.i"
+%include "dom/DOMProcessingInstruction.i"
+
+// type info
+%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"
+%include "dom/DOMNodeFilter.i"
+%include "dom/DOMRange.i"
+%include "dom/DOMRangeException.i"
+%include "dom/DOMTreeWalker.i"
+
+/*
+ * Introduced in DOM Level 3
+ */
+%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"
+
+%include "dom/DOMError.i"
+%include "dom/DOMErrorHandler.i"
+%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
+%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"
+
+%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");
+    }
+
+    XML_EXCEPTION_HANDLER = XMLExceptionHandler::getInstance();
+    if (! XML_EXCEPTION_HANDLER) {
+	croak("ERROR: XML::Xerces: INIT: Could not create XMLExceptionHandler");
+    }
+}
+
+#ifdef SWIGPERL
+
+/* 
+ * Callbacks - this needs to be at the very end
+ *   so that SWIG can wrap the superclass methods properly
+ */
+
+%include "Perl/dom-callback.i"
+
+/* 
+ * 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=442160&r1=442159&r2=442160
==============================================================================
--- xerces/c/trunk/swig/interfaces/defines.i (original)
+++ xerces/c/trunk/swig/interfaces/defines.i Mon Sep 11 03:08:07 2006
@@ -20,214 +20,32 @@
  */
 
 %{
-#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/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/framework/XMLValidator.hpp"
-#include "xercesc/validators/common/Grammar.hpp"
-#include "xercesc/validators/DTD/DTDAttDef.hpp"
-#include "xercesc/validators/DTD/DTDAttDefList.hpp"
-#include "xercesc/validators/DTD/DTDGrammar.hpp"
-#include "xercesc/validators/DTD/DTDValidator.hpp"
-#include "xercesc/validators/schema/SchemaGrammar.hpp"
-#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"
-
-// for resolving XMLExceptions
-#include "xercesc/util/ArrayIndexOutOfBoundsException.hpp"
-#include "xercesc/util/EmptyStackException.hpp"
-#include "xercesc/util/IllegalArgumentException.hpp"
-#include "xercesc/util/InvalidCastException.hpp"
-#include "xercesc/util/IOException.hpp"
-#include "xercesc/util/NoSuchElementException.hpp"
-#include "xercesc/util/NullPointerException.hpp"
-#include "xercesc/util/NumberFormatException.hpp"
-#include "xercesc/util/ParseException.hpp"
-#include "xercesc/util/RuntimeException.hpp"
-#include "xercesc/util/SchemaDateTimeException.hpp"
-#include "xercesc/util/TranscodingException.hpp"
-#include "xercesc/util/UnexpectedEOFException.hpp"
-#include "xercesc/util/UnsupportedEncodingException.hpp"
-#include "xercesc/util/UTFDataFormatException.hpp"
-#include "xercesc/util/XMLNetAccessor.hpp"
-#include "xercesc/internal/XSerializationException.hpp"
-#include "xercesc/validators/datatype/InvalidDatatypeFacetException.hpp"
-#include "xercesc/validators/datatype/InvalidDatatypeValueException.hpp"
-#include "xercesc/validators/schema/identity/XPathException.hpp"
-
-//
-// DOM stuff - wants to be moved to seperate module
-//
-#include "xercesc/dom/DOM.hpp"
-#include "xercesc/framework/Wrapper4InputSource.hpp"
-#include "xercesc/framework/Wrapper4DOMLSInput.hpp"
-#include "xercesc/parsers/AbstractDOMParser.hpp"
-#include "xercesc/parsers/XercesDOMParser.hpp"
-
-// need this for PerlNodeFilterCallbackHandler
-// #include "xercesc/dom/DOMNode.hpp"
 
 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 XMLCh* UTF8_ENCODING = NULL; 
-static XMLTranscoder* UTF8_TRANSCODER  = NULL;
+static Transcoder* UTF8_TRANSCODER  = NULL;
+
+static XMLExceptionHandler* XML_EXCEPTION_HANDLER  = NULL;
 
 static bool DEBUG_UTF8_OUT = 0;
 static bool DEBUG_UTF8_IN = 0;
 
 %}
 
-/*
- * Import the language specific includes
- */
-
-#ifdef SWIGPERL
-%include "Perl/defines.i"
-%include "Perl/transcode.i"
-%include "Perl/errors.i"
-#endif
-
-
 // These get wrapped by SWIG so that we can modify them from the scripting language
 bool DEBUG_UTF8_OUT;
 bool DEBUG_UTF8_IN;
 
+
 %{
-XMLException*
-copyXMLException(const XMLException& e)
-{
-    if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgArrayIndexOutOfBoundsException_Name)
-    {
-        return (XMLException*)((ArrayIndexOutOfBoundsException*)&e)->duplicate();
-    }
-    else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgEmptyStackException_Name)
-    {
-        return (XMLException*)((EmptyStackException*)&e)->duplicate();
-    }
-    else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgIllegalArgumentException_Name)
-    {
-        return (XMLException*)((IllegalArgumentException*)&e)->duplicate();
-    }
-    else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgInvalidCastException_Name)
-    {
-        return (XMLException*)((InvalidCastException*)&e)->duplicate();
-    }
-    else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgIOException_Name)
-    {
-        return (XMLException*)((IOException*)&e)->duplicate();
-    }
-    else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgNoSuchElementException_Name)
-    {
-        return (XMLException*)((NoSuchElementException*)&e)->duplicate();
-    }
-    else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgNullPointerException_Name)
-    {
-        return (XMLException*)((NullPointerException*)&e)->duplicate();
-    }
-    else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgNumberFormatException_Name)
-    {
-        return (XMLException*)((NumberFormatException*)&e)->duplicate();
-    }
-    else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgParseException_Name)
-    {
-        return (XMLException*)((ParseException*)&e)->duplicate();
-    }
-    else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgXMLPlatformUtilsException_Name)
-    {
-        return (XMLException*)((XMLPlatformUtilsException*)&e)->duplicate();
-    }
-    else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgRuntimeException_Name)
-    {
-        return (XMLException*)((RuntimeException*)&e)->duplicate();
-    }
-    else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgSchemaDateTimeException_Name)
-    {
-        return (XMLException*)((SchemaDateTimeException*)&e)->duplicate();
-    }
-    else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgTranscodingException_Name)
-    {
-        return (XMLException*)((TranscodingException*)&e)->duplicate();
-    }
-    else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgUnexpectedEOFException_Name)
-    {
-        return (XMLException*)((UnexpectedEOFException*)&e)->duplicate();
-    }
-    else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgUnsupportedEncodingException_Name)
-    {
-        return (XMLException*)((UnsupportedEncodingException*)&e)->duplicate();
-    }
-    else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgUTFDataFormatException_Name)
-    {
-        return (XMLException*)((UTFDataFormatException*)&e)->duplicate();
-    }
-    else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgNetAccessorException_Name)
-    {
-        return (XMLException*)((NetAccessorException*)&e)->duplicate();
-    }
-    else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgMalformedURLException_Name)
-    {
-        return (XMLException*)((MalformedURLException*)&e)->duplicate();
-    }
-    else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgXSerializationException_Name)
-    {
-        return (XMLException*)((XSerializationException*)&e)->duplicate();
-    }
-    else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgInvalidDatatypeFacetException_Name)
-    {
-        return (XMLException*)((InvalidDatatypeFacetException*)&e)->duplicate();
-    }
-    else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgInvalidDatatypeValueException_Name)
-    {
-        return (XMLException*)((InvalidDatatypeValueException*)&e)->duplicate();
-    }
-    else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgXPathException_Name)
-    {
-        return (XMLException*)((XPathException*)&e)->duplicate();
-    }
-    else
-    {
-        SWIG_Perl_SetErrorf("Unknown Exception type: %d", e.getType());
-    }
-}
 
 void
 makeXMLException(const XMLException& e){
     SV *error = ERRSV;
-    SWIG_MakePtr(error, (void *) copyXMLException(e), SWIGTYPE_p_XERCES_CPP_NAMESPACE__XMLException, SWIG_SHADOW|0);
+    SWIG_MakePtr(error, (void *) XML_EXCEPTION_HANDLER->copyXMLException(e), SWIGTYPE_p_XERCES_CPP_NAMESPACE__XMLException, SWIG_SHADOW|0);
 }
 
 void
@@ -242,10 +60,6 @@
     SWIG_MakePtr(error, (void *) new SAXNotSupportedException(e), SWIGTYPE_p_XERCES_CPP_NAMESPACE__SAXNotSupportedException, 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"

Added: xerces/c/trunk/swig/interfaces/dom-includes.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/dom-includes.i?view=auto&rev=442160
==============================================================================
--- xerces/c/trunk/swig/interfaces/dom-includes.i (added)
+++ xerces/c/trunk/swig/interfaces/dom-includes.i Mon Sep 11 03:08:07 2006
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2002,2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+%{
+#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"
+
+%}
+

Added: xerces/c/trunk/swig/interfaces/includes.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/includes.i?view=auto&rev=442160
==============================================================================
--- xerces/c/trunk/swig/interfaces/includes.i (added)
+++ xerces/c/trunk/swig/interfaces/includes.i Mon Sep 11 03:08:07 2006
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2002,2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * includes.i - all the #includes needed for Xerces.cpp
+ */
+
+%{
+#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/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/framework/XMLValidator.hpp"
+#include "xercesc/validators/common/Grammar.hpp"
+#include "xercesc/validators/DTD/DTDAttDef.hpp"
+#include "xercesc/validators/DTD/DTDAttDefList.hpp"
+#include "xercesc/validators/DTD/DTDGrammar.hpp"
+#include "xercesc/validators/DTD/DTDValidator.hpp"
+#include "xercesc/validators/schema/SchemaGrammar.hpp"
+#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"
+
+%}
+

Modified: xerces/c/trunk/swig/interfaces/parsers.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/parsers.i?view=diff&rev=442160&r1=442159&r2=442160
==============================================================================
--- xerces/c/trunk/swig/interfaces/parsers.i (original)
+++ xerces/c/trunk/swig/interfaces/parsers.i Mon Sep 11 03:08:07 2006
@@ -3,8 +3,8 @@
 %include "xercesc/framework/psvi/PSVIHandler.hpp"
 
 // these want to be removed to a separate DOM module
-%include "parsers/AbstractDOMParser.i"
-%include "parsers/XercesDOMParser.i"
+// %include "parsers/AbstractDOMParser.i"
+// %include "parsers/XercesDOMParser.i"
 
 %include "xercesc/sax/Parser.hpp"
 %include "xercesc/parsers/SAXParser.hpp"

Modified: xerces/c/trunk/swig/interfaces/typemaps-general.i
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/typemaps-general.i?view=diff&rev=442160&r1=442159&r2=442160
==============================================================================
--- xerces/c/trunk/swig/interfaces/typemaps-general.i (original)
+++ xerces/c/trunk/swig/interfaces/typemaps-general.i Mon Sep 11 03:08:07 2006
@@ -14,6 +14,9 @@
  * limitations under the License.
  */
 
+// this is new for Xerces-C-3.0
+%apply size_t { ssize_t };
+
 /*
  * Scripting languages are not going to change the default memory manager
  *   so we always default this argument
@@ -50,28 +53,6 @@
   }
 }
 }
-
-/*
- * 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 = Perl2XMLString($input);
-  }
-}
-%typemap(freearg) void * %{
-  delete[] $1;
-%}
 
 /*
  * Dynamic Casts

Propchange: xerces/c/trunk/swig/perl/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Sep 11 03:08:07 2006
@@ -43,3 +43,5 @@
 foo.pm
 log-sax.txt
 pm_to_blib
+Xerces-tmp.cpp
+Xerces-tmp.pm

Propchange: xerces/c/trunk/swig/perl/DOM/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Sep 11 03:08:07 2006
@@ -0,0 +1,6 @@
+DOM-tmp.pm
+DOM.bs
+Makefile.old
+Makefile
+Xerces_DOM-tmp.cpp
+pm_to_blib



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