Commits

Anonymous committed a9cc1a2

Log:

preparations for the 1.57 release

Modified Files:
LibXML.xs
New Interfaces for libxml2 macros.
+ LIBXML_DOTTED_VERSION
+ LIBXML_VERSION

Makefile.PL
+ improved for mass testing

Changes
o minor updates

t/25relaxng.t t/26schema.t
+ will skip when libxml2/XML::LibXML has no schema validation support

example/libxml.dkb
o minor documentation updates
o version update

Comments (0)

Files changed (6)

    - fixed default c14n XPath to include attributes and namespaces (Petr Pajas)
    - make libxml2's xmlXPathOrderDocElems available through a new 
      $doc->indexElements method
+   - added version information of libxml2
 
 1.56 
    - added line number interface (thanks to Peter Haworth)
     xmlInitializeCatalog(); /* use catalog data */
 #endif
 
+char *
+LIBXML_DOTTED_VERSION()
+    CODE:
+        RETVAL = LIBXML_DOTTED_VERSION;
+    OUTPUT:
+        RETVAL
+
+
+int
+LIBXML_VERSION()
+    CODE:
+        RETVAL = LIBXML_VERSION;
+    OUTPUT:
+        RETVAL
+
+
 void
 END()
     CODE:
     my ($key, $val) = split(/=/, $_, 2);
     $config{$key} = $val;
 }
+
+$extralibdir = $config{EXTRALIBDIR};
+delete $config{EXTRALIBDIR};
+
 # -------------------------------------------------------------------------- #
 
 # -------------------------------------------------------------------------- #
 
 unless ( $is_Win32 ) { # cannot get config in W32
     my @blacklist = (
-                     [2,4,20,0],
-                     [2,4,24,1],
                      [2,4,25,0],
                      [2,4,30,1],
                      [2,5,4,1],
-                     [2,5,5,0], # known as broken
-                     [2,5,10,1],
+                     [2,5,5,0], # tests pass, but known as broken
+                     [2,5,11,1],
+                     [2,6,0,0],
+                     [2,6,2,1],
+                     [2,6,3,0],
+                     [2,6,4,0], # schema error
+                     [2,6,5,0], # broken xincludes
+                     [2,6,7,1],
+
                     );
     my $xml2cfg = "xml2-config";
     my $libprefix = $ENV{XMLPREFIX} || $config{XMLPREFIX};
    }
    return $script;
 }
+
+sub MY::test {
+   package MY;
+   my $script = shift->SUPER::test(@_);
+   if ( $::extralibdir ) {
+      $script =~ s/(\$\(TEST_VERBOSE\),)/$1 \'$::extralibdir\',/m;
+   }
+   return $script;
+}
+
 # -------------------------------------------------------------------------- #
 
 # -------------------------------------------------------------------------- #

example/libxml.dkb

         <surname>Glahn</surname>
       </author>
     </authorgroup>
-    <edition>1.56</edition>
+    <edition>1.57</edition>
     <copyright>
-      <year>2001-2002</year>
-      <holder>AxKit.com Ltd; 2001-2003 Christian Glahn</holder>
+      <year>2001-2004</year>
+      <holder>AxKit.com Ltd; 2002-2004 Christian Glahn</holder>
     </copyright>
   </bookinfo>
   <chapter>
         <para>If you already run an older version of XML::LibXML and you wish
         to upgrade to a bug fixed version of libxml2. libxml2 2.4.25 and 2.5.x
         versions are not 100% binary compatible. So if you intend to upgrade
-        to such a version you will need to recompile XML::LibXML as well.</para>
+        to such a version you will need to rebuild XML::LibXML (and
+        XML::LibXML::Common) as well.</para>
         <para>Users of perl 5.005_03 and perl 5.6.1 with thread support will
         also like to avoid libxml2 version 2.4.25 and use later versions
         instead.</para>
         set the environment variable XMLPREFIX=$YOURLIBXMLPREFIX to make
         XML::LibXML recognize the correct libxml2 version in use.</para>
         <para>e.g.</para>
-        <programlisting> XMLPREFIX=/usr/brand-new perl Makefile.PL</programlisting>
+        <programlisting> perl Makefile.PL XMLPREFIX=/usr/brand-new </programlisting>
         <para>will ask &#39;/usr/brand-new/bin/xml2-config&#39; about your
         real libxml2 configuration.</para>
         <para>Try to avoid to set INC and LIBS on the commandline. One will
             <para>version 2.5.5: tested; tests pass, but known as broken</para>
           </listitem>
           <listitem>
-            <para>up to version 2.5.10: tested; working</para>
+            <para>up to version 2.5.11: tested; working</para>
           </listitem>
         </itemizedlist>
         <para>It happens, that an older version of libxml2 passes all tests
       </variablelist>
     </sect1>
     <sect1>
+      <title>Version Information</title>
+      <para>Sometimes it is usefull to figure out, for which version
+      XML::LibXML was compiled for. In most cases this is for debugging or to
+      check if a given installation meets all functionality for the package.
+      The functiones XML::LibXML::LIBXML_DOTTED_VERSION and
+      XML::LibXML::LIBXML_VERSION provide this version information. Both
+      functions simply pass through the values of the similar named macros of
+      libxml2. </para>
+      <variablelist>
+        <varlistentry>
+          <term>XML::LibXML::LIBXML_DOTTED_VERSION</term>
+          <listitem>
+            <funcsynopsis>
+              <funcsynopsisinfo>$Version_String = XML::LibXML::LIBXML_DOTTED_VERSION;</funcsynopsisinfo>
+            </funcsynopsis>
+            <para>Returns the Versionstring of the libxml2 version XML::LibXML
+            was compiled for. This will be &#34;2.6.2&#34; for &#34;libxml2
+            2.6.2&#34;. </para>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term>XML::LibXML::LIBXML_VERSION</term>
+          <listitem>
+            <funcsynopsis>
+              <funcsynopsisinfo>$Version_ID = XML::LibXML::LIBXML_VERSION;</funcsynopsisinfo>
+            </funcsynopsis>
+            <para>Returns the version id of the libxml2 version XML::LibXML
+            was compiled for. This will be &#34;20602&#34; for &#34;libxml2
+            2.6.2&#34;. Don&#39;t mix this version id with
+            $XML::LibXML::VERSION. The latter contains the version of
+            XML::LibXML itself while the first contains the version of libxml2
+            XML::LibXML was compiled for.</para>
+          </listitem>
+        </varlistentry>
+      </variablelist>
+    </sect1>
+    <sect1>
       <title>Related Modules</title>
       <para>The modules described in this section are not part of the
       XML::LibXML package itself. As they support some additional features,
             number of a node. This gives more information where a validation
             error occoured. It could be also used to find out about the
             position of a node after parsing (see also
-            XML::LibXML::Node::line_number()) </para>
+            XML::LibXML::Node::line_number())</para>
             <para>By default line numbering is switched off (0).</para>
           </listitem>
         </varlistentry>
           <funcsynopsis>
             <funcsynopsisinfo>$dom-&#62;indexElements();</funcsynopsisinfo>
           </funcsynopsis>
-          <para>This function causes libxml2 to stamp
-            all elements in a document with their document position
-            index which considerably speeds up XPath queries for large
-            documents. It should only be used with
-            static documents that won't be further changed by
-            any DOM methods, because once a document is indexed,
-            XPath will always prefer the index to other methods of 
-	    determining the document order of nodes. 
-	    XPath could therefore return improperly ordered 
-	    node-lists when applied on a document
-            that has been changed after being indexed.
-            It is of course possible to use this method
-            to re-index a modified document before using it with XPath
-	    again.
-            This function is not a part of the DOM specification.
-	  </para>
-          <para>This function returns number of elements indexed,
-            -1 if error occurred, or -2 if this feature is
-            not available in the running libxml2.
-          </para>
+          <para>This function causes libxml2 to stamp all elements in a
+          document with their document position index which considerably
+          speeds up XPath queries for large documents. It should only be used
+          with static documents that won&#39;t be further changed by any DOM
+          methods, because once a document is indexed, XPath will always
+          prefer the index to other methods of determining the document order
+          of nodes. XPath could therefore return improperly ordered node-lists
+          when applied on a document that has been changed after being
+          indexed. It is of course possible to use this method to re-index a
+          modified document before using it with XPath again. This function is
+          not a part of the DOM specification.</para>
+          <para>This function returns number of elements indexed, -1 if error
+          occurred, or -2 if this feature is not available in the running
+          libxml2.</para>
         </listitem>
       </varlistentry>
     </variablelist>
           <para>This function returns the line number where the tag was found
           during parsing. If a node is added to the document the line number
           is 0. Problems may occour, if a node from one document is passed to
-          another one. </para>
+          another one.</para>
           <para>Note: line_number() is special to XML::LibXML and not part of
-          the DOM specification. </para>
+          the DOM specification.</para>
           <para>If the line_numbers flag of the parser was not activated
           before parsing, line_number() will always return 0.</para>
         </listitem>
           </funcsynopsis>
           <para>The method inserts <function>$newNode</function> before
           <function>$refNode</function>. If <function>$refNode</function> is
-          undefined, the $newNode will be set as the last child of the
-          parent node. This function differs from the DOM L2 specification, in
-          the case, if the new node is not part of the document, the node will
-          be imported first.</para>
+          undefined, the $newNode will be set as the last child of the parent
+          node. This function differs from the DOM L2 specification, in the
+          case, if the new node is not part of the document, the node will be
+          imported first.</para>
         </listitem>
       </varlistentry>
     </variablelist>
     <titleabbrev>XML::LibXML::RelaxNG</titleabbrev>
     <para>The XML::LibXML::RelaxNG class is a tiny frontend to libxml2&#39;s
     RelaxNG implementation. Currently it supports only schema parsing and
-    document validation. </para>
+    document validation.</para>
     <variablelist>
       <varlistentry>
         <term>new</term>
           <para>The constructor of XML::LibXML::RelaxNG may get called with
           either one of three parameters. The parameter tells the class from
           which source it should generate a validation schema. It is
-          important, that each schema only have a single source. </para>
+          important, that each schema only have a single source.</para>
           <para>The location parameter allows to parse a schema from the
-          filesystem or a URL. </para>
+          filesystem or a URL.</para>
           <para>The string parameter will parse the schema from the given XML
           string.</para>
           <para>The DOM parameter allows to parse the schema from a preparsed
-          XML::LibXML::Document. </para>
+          XML::LibXML::Document.</para>
           <para>Note that the constructor will die() if the schema does not
           meed the constraints of the RelaxNG specification.</para>
         </listitem>
     </variablelist>
   </chapter>
   <chapter>
-    <title> XML Schema Validation</title>
+    <title>XML Schema Validation</title>
     <titleabbrev>XML::LibXML::Schema</titleabbrev>
     <para>The XML::LibXML::Schema class is a tiny frontend to libxml2&#39;s
     XML Schema implementation. Currently it supports only schema parsing and
       </varlistentry>
     </variablelist>
   </chapter>
-</book>
+</book>
 use Test;
 use strict;
 
-BEGIN { plan tests => 8 };
+BEGIN { 
+    use XML::LibXML;
 
-use XML::LibXML;
+    if ( XML::LibXML::LIBXML_VERSION >= 20510 ) {
+        plan tests => 8;
+    }
+    else {
+        plan tests => 0;
+        print( "# Skip No RNG Support compiled\n" );
+    }
+};
+
+if ( XML::LibXML::LIBXML_VERSION >= 20510 ) {
 
 my $xmlparser = XML::LibXML->new();
 
     ok ( $@ );
 }
 
+} # Version >= 20510 test 
 
 use Test;
 use strict;
+BEGIN { 
+    use XML::LibXML;
 
-BEGIN { plan tests => 6 };
+    if ( XML::LibXML::LIBXML_VERSION >= 20510 ) {
+        plan tests => 6; 
+    }
+    else {
+        plan tests => 0;
+        print( "# Skip : No Schema Support compiled\n" );
+    }
+};
 
-use XML::LibXML;
+if ( XML::LibXML::LIBXML_VERSION >= 20510 ) {
+
 
 my $xmlparser = XML::LibXML->new();
 
     ok ( $@ );
 }
 
+}