Anonymous avatar Anonymous committed 893c4b6

- add/fix copyright and license comments
- fixed documentation error in structured errors (int[12] vs num[12])

Comments (0)

Files changed (24)

 This is free software, you may use it and distribute it under the same terms as
 Perl itself.
 
-Copyright 2001-2003 AxKit.com Ltd, All rights reserved.
+Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr
+Pajas
 
 
 DISCLAIMER
 # $Id$
+#
+#
+# This is free software, you may use it and distribute it under the same terms as
+# Perl itself.
+#
+# Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
+#
+#
 
 package XML::LibXML;
 
-/* $Id$ */
+/* $Id$
+ *
+ * This is free software, you may use it and distribute it under the same terms as
+ * Perl itself.
+ *
+ * Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
+*/
 
 #ifdef __cplusplus
 extern "C" {
         xmlNodePtr retval = NULL;
         ProxyNodePtr proxy;
     CODE:
+        switch ( nNode->type ) {
+        case XML_DOCUMENT_FRAG_NODE:
+            croak("Adding document fragments with addChild not supported!");
+            XSRETURN_UNDEF;
+        case XML_DOCUMENT_NODE :
+        case XML_HTML_DOCUMENT_NODE :
+        case XML_DOCB_DOCUMENT_NODE :
+            croak("addChild: HIERARCHY_REQUEST_ERR\n");
+            XSRETURN_UNDEF;
+        case XML_NOTATION_NODE :
+        case XML_NAMESPACE_DECL :
+        case XML_DTD_NODE :
+        case XML_DOCUMENT_TYPE_NODE :
+        case XML_ENTITY_DECL :
+        case XML_ELEMENT_DECL :
+        case XML_ATTRIBUTE_DECL :
+            croak("addChild: unsupported node type!");
+            XSRETURN_UNDEF;
+        }
+
         xmlUnlinkNode(nNode);
         proxy = PmmPROXYNODE(nNode);
         retval = xmlAddChild( self, nNode );
 
         if ( retval == NULL ) {
-            croak( "ERROR!\n" );
+            croak( "Error: addChild failed (check node types)!\n" );
         }
 
         if ( retval != nNode ) {
 int
 num1( self )
         xmlErrorPtr self
+    ALIAS:
+        int1 = 1
     CODE:
         RETVAL = self->int1;
     OUTPUT:
 int
 num2( self )
         xmlErrorPtr self
+    ALIAS:
+        int2 = 1
     CODE:
         RETVAL = self->int2;
     OUTPUT:
 # Makefile.PL for XML::LibXML.
 # This file is required to generate a localized Makefile
 # -------------------------------------------------------------------------- #
+#
+#
+# This is free software, you may use it and distribute it under the same terms as
+# Perl itself.
+#
+# Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
+#
 
 
 BEGIN {
 my %INFOS = (
     'NAME'	=> 'XML::LibXML',
     'VERSION_FROM' => 'LibXML.pm', # finds $VERSION
-    'AUTHOR'    => 'Christian Glahn',
+    'AUTHOR'    => 'Petr Pajas',
     'ABSTRACT'  => 'Interface to Gnome libxml2 xml parsing and DOM library',
     'PREREQ_PM' => {
 		    'XML::SAX' => '0.11',
 It was downloaded from the Comprehensive Perl Archive Network (CPAN).
 Visit <http://www.cpan.org/> to find a CPAN site near you.
 
-Upstream Author: Christian Glahn <christian.glahn@uibk.ac.at>
+Upstream Author: Petr Pajas <pajas@ufal.mff.cuni.cz>
 
 Copyright:
 
-Copyright 2001-2002, AxKit.com Ltd. All rights reserved.
+Copyright 2001-2003, AxKit.com Ltd. 
+Copyright 2002-2006 Christian Glahn
+Copyright 2006-2009 Petr Pajas
 
 This is free software, you may use it and distribute it under the same
 terms as Perl itself.
 
         <para>This is free software, you may use it and distribute it under the same terms as Perl itself.</para>
 
-        <para>Copyright 2001-2003 AxKit.com Ltd, All rights reserved.</para>
+        <para>Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas</para>
 
         <sect1>
             <title>Disclaimer</title>
 	methods such as as $@-&#62;field() (where field is the field
 	name). XML::LibXML::Error objects have the following fields:
 	domain, code, level, file, line, nodename, message, str1, str2,
-	str3, int1, int2, and _prev (some of them may be undefined).
+	str3, num1, num2, and _prev (some of them may be undefined).
       </para>
       <variablelist>
 	<varlistentry>
 	  </listitem>
 	</varlistentry>
 	<varlistentry>
-	  <term>int1</term>
+	  <term>num1</term>
 	  <listitem>
 	    <funcsynopsis>
-	      <funcsynopsisinfo>$error_int1 = $@->int1();</funcsynopsisinfo>
+	      <funcsynopsisinfo>$error_num1 = $@->num1();</funcsynopsisinfo>
 	    </funcsynopsis>
 	    <para>Error specific. Extra numeric information.</para>
 	  </listitem>
 	</varlistentry>
 	<varlistentry>
-	  <term>int2</term>
+	  <term>num2</term>
 	  <listitem>
 	    <funcsynopsis>
-	      <funcsynopsisinfo>$error_int2 = $@->int2();</funcsynopsisinfo>
+	      <funcsynopsisinfo>$error_num2 = $@->num2();</funcsynopsisinfo>
 	    </funcsynopsis>
-	    <para>Error specific. Extra numeric information.</para>
+	    <para>In recent libxml2 versions, this
+	    value contains a column number of the error or 0 if N/A.</para>
 	  </listitem>
 	</varlistentry>
 	<varlistentry>
-/* $Id$ */
+/* $Id$
+ *
+ * This is free software, you may use it and distribute it under the same terms as
+ * Perl itself.
+ *
+ * Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
+*/
 
 #include "dom.h"
 

example/xmllibxmldocs.pl

         if ( defined $node_h ) {
             $infostr .= $node_h->string_value();
         }
-        $infostr .= ", All rights reserved.\n\n=cut\n"
+        $infostr .= ".\n\n=cut\n"
     }
 
     $self->{infoblock} = $infostr;

lib/XML/LibXML/Boolean.pm

 # $Id$
-# Copyright 2001-2002, AxKit.com Ltd. All rights reserved.
+#
+#
+# This is free software, you may use it and distribute it under the same terms as
+# Perl itself.
+#
+# Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
+#
+#
 
 package XML::LibXML::Boolean;
 use XML::LibXML::Number;

lib/XML/LibXML/Common.pm

 #-------------------------------------------------------------------------#
 # $Id: Common.pm,v 1.5 2003/02/27 18:32:59 phish108 Exp $
+#
+#
+# This is free software, you may use it and distribute it under the same terms as
+# Perl itself.
+#
+# Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
+#
+#
 #-------------------------------------------------------------------------#
 package XML::LibXML::Common;
 

lib/XML/LibXML/ErrNo.pm

 # $Id: ErrNo.pm,v 1.1.2.1 2004/04/20 20:09:48 pajas Exp $
+#
+#
+# This is free software, you may use it and distribute it under the same terms as
+# Perl itself.
+#
+# Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
+#
+#
+
 package XML::LibXML::ErrNo;
 
 use strict;

lib/XML/LibXML/Error.pm

+# $Id: Error.pm,v 1.1.2.1 2004/04/20 20:09:48 pajas Exp $
+#
+# This is free software, you may use it and distribute it under the same terms as
+# Perl itself.
+#
+# Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
+#
+#
 package XML::LibXML::Error;
 
 use strict;
   return undef unless ref($self);
   my $sub = $AUTOLOAD;
   $sub =~ s/.*:://;
-  if ($sub=~/^(?:code|_prev|level|file|line|domain|nodename|message|num[123]|num[12])$/) {
+  if ($sub=~/^(?:code|_prev|level|file|line|domain|nodename|message|str[123]|num[12])$/) {
     return $self->{$sub};
   } else {
     croak("Unknown error field $sub");
   }
 }
 
+# backward compatibility
+sub int1 { $_[0]->num1 }
+sub int2 { $_[0]->num2 }
+
 sub DESTROY {}
 
 sub domain {

lib/XML/LibXML/Literal.pm

 # $Id$
+#
+# This is free software, you may use it and distribute it under the same terms as
+# Perl itself.
+#
+# Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
+#
+#
 
 package XML::LibXML::Literal;
 use XML::LibXML::Boolean;

lib/XML/LibXML/NodeList.pm

 # $Id$
+#
+# This is free software, you may use it and distribute it under the same terms as
+# Perl itself.
+#
+# Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
+#
+#
 
 package XML::LibXML::NodeList;
 use strict;

lib/XML/LibXML/Number.pm

 # $Id$
+#
+# This is free software, you may use it and distribute it under the same terms as
+# Perl itself.
+#
+# Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
+#
+#
 
 package XML::LibXML::Number;
 use XML::LibXML::Boolean;

lib/XML/LibXML/Reader.pm

+# $Id: Reader.pm,v 1.1.2.1 2004/04/20 20:09:48 pajas Exp $
+#
+# This is free software, you may use it and distribute it under the same terms as
+# Perl itself.
+#
+# Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
+#
+#
 package XML::LibXML::Reader;
 
 use XML::LibXML;

lib/XML/LibXML/SAX.pm

 # $Id$
-# Copyright (c) 2001-2002, AxKit.com Ltd. All rights reserved.
+#
+# This is free software, you may use it and distribute it under the same terms as
+# Perl itself.
+#
+# Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
+#
+#
+
 package XML::LibXML::SAX;
 
 use strict;

lib/XML/LibXML/SAX/Builder.pm

 # $Id$
+#
+# This is free software, you may use it and distribute it under the same terms as
+# Perl itself.
+#
+# Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
+#
+#
 
 package XML::LibXML::SAX::Builder;
 

lib/XML/LibXML/SAX/Generator.pm

-# $Id$
+# $Id: Generator.pm 772 2009-01-23 21:42:09Z pajas 
+#
+# This is free software, you may use it and distribute it under the same terms as
+# Perl itself.
+#
+# Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
+#
+#
 
 package XML::LibXML::SAX::Generator;
 

lib/XML/LibXML/SAX/Parser.pm

 # $Id$
+#
+# This is free software, you may use it and distribute it under the same terms as
+# Perl itself.
+#
+# Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
+#
+#
 
 package XML::LibXML::SAX::Parser;
 

lib/XML/LibXML/XPathContext.pm

 # $Id: XPathContext.pm 422 2002-11-08 17:10:30Z phish $
+#
+# This is free software, you may use it and distribute it under the same terms as
+# Perl itself.
+#
+# Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
+#
+#
 
 package XML::LibXML::XPathContext;
 
  * perl-libxml-mm.c
  * $Id$
  *
+ * This is free software, you may use it and distribute it under the same terms as
+ * Perl itself.
+ *
+ * Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
+*/
+
+/*
+ *
  * Basic concept:
  * perl varies in the implementation of UTF8 handling. this header (together
  * with the c source) implements a few functions, that can be used from within

perl-libxml-sax.c

 /**
  * perl-libxml-sax.c
  * $Id$
- */
+ *
+ * This is free software, you may use it and distribute it under the same terms as
+ * Perl itself.
+ *
+ * Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
+*/
 
 #ifdef __cplusplus
 extern "C" {
+/* $Id$
+ *
+ * This is free software, you may use it and distribute it under the same terms as
+ * Perl itself.
+ *
+ * Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas
+*/
+
 #include <libxml/tree.h>
 #include <libxml/xpath.h>
 #include <libxml/xpathInternals.h>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.