r75013 - in /branches/upstream/libxml-libxml-simple-perl/current: ChangeLog META.yml Makefile.PL README lib/XML/LibXML/Simple.pm lib/XML/LibXML/Simple.pod

ansgar at users.alioth.debian.org ansgar at users.alioth.debian.org
Thu Jun 2 10:59:14 UTC 2011


Author: ansgar
Date: Thu Jun  2 10:59:07 2011
New Revision: 75013

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=75013
Log:
[svn-upgrade] new version libxml-libxml-simple-perl (0.15)

Modified:
    branches/upstream/libxml-libxml-simple-perl/current/ChangeLog
    branches/upstream/libxml-libxml-simple-perl/current/META.yml
    branches/upstream/libxml-libxml-simple-perl/current/Makefile.PL
    branches/upstream/libxml-libxml-simple-perl/current/README
    branches/upstream/libxml-libxml-simple-perl/current/lib/XML/LibXML/Simple.pm
    branches/upstream/libxml-libxml-simple-perl/current/lib/XML/LibXML/Simple.pod

Modified: branches/upstream/libxml-libxml-simple-perl/current/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libxml-libxml-simple-perl/current/ChangeLog?rev=75013&op=diff
==============================================================================
--- branches/upstream/libxml-libxml-simple-perl/current/ChangeLog (original)
+++ branches/upstream/libxml-libxml-simple-perl/current/ChangeLog Thu Jun  2 10:59:07 2011
@@ -1,5 +1,10 @@
 
 === version history for XML::LibXML::Simple
+
+version 0.15: Thu Apr 28 10:22:34 CEST 2011
+	Fixes:
+	- parser object recreated each time, because it cannot be
+	  reused (any more?). [Didier Brun]
 
 version 0.14: Fri Jul 16 11:17:49 CEST 2010
 	Fixes:

Modified: branches/upstream/libxml-libxml-simple-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libxml-libxml-simple-perl/current/META.yml?rev=75013&op=diff
==============================================================================
--- branches/upstream/libxml-libxml-simple-perl/current/META.yml (original)
+++ branches/upstream/libxml-libxml-simple-perl/current/META.yml Thu Jun  2 10:59:07 2011
@@ -1,17 +1,25 @@
 --- #YAML:1.0
-name:                XML-LibXML-Simple
-version:             0.14
-abstract:            XML::LibXML based XML::Simple clone
-license:             perl
-author:              
+name:               XML-LibXML-Simple
+version:            0.15
+abstract:           XML::LibXML based XML::Simple clone
+author:
     - Mark Overmeer
-generated_by:        ExtUtils::MakeMaker version 6.42
-distribution_type:   module
-requires:     
-    File::Slurp:                   0
-    Test::More:                    0.54
-    Test::Pod:                     1.00
-    XML::LibXML:                   1.64
+license:            perl
+distribution_type:  module
+configure_requires:
+    ExtUtils::MakeMaker:  0
+build_requires:
+    ExtUtils::MakeMaker:  0
+requires:
+    File::Slurp:  0
+    Test::More:   0.54
+    Test::Pod:    1.00
+    XML::LibXML:  1.64
+no_index:
+    directory:
+        - t
+        - inc
+generated_by:       ExtUtils::MakeMaker version 6.56
 meta-spec:
-    url:     http://module-build.sourceforge.net/META-spec-v1.3.html
-    version: 1.3
+    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
+    version:  1.4

Modified: branches/upstream/libxml-libxml-simple-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libxml-libxml-simple-perl/current/Makefile.PL?rev=75013&op=diff
==============================================================================
--- branches/upstream/libxml-libxml-simple-perl/current/Makefile.PL (original)
+++ branches/upstream/libxml-libxml-simple-perl/current/Makefile.PL Thu Jun  2 10:59:07 2011
@@ -4,7 +4,7 @@
 
 WriteMakefile
  ( NAME	 	=> 'XML::LibXML::Simple'
- , VERSION	=> '0.14'
+ , VERSION	=> '0.15'
  , PREREQ_PM    =>
    { XML::LibXML     => 1.64
    , Test::More      => 0.54

Modified: branches/upstream/libxml-libxml-simple-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libxml-libxml-simple-perl/current/README?rev=75013&op=diff
==============================================================================
--- branches/upstream/libxml-libxml-simple-perl/current/README (original)
+++ branches/upstream/libxml-libxml-simple-perl/current/README Thu Jun  2 10:59:07 2011
@@ -1,5 +1,5 @@
-=== README for XML-LibXML-Simple version 0.13
-=   Generated on Fri Jul 16 11:17:58 2010 by OODoc 1.06
+=== README for XML-LibXML-Simple version 0.15
+=   Generated on Thu Apr 28 10:22:46 2011 by OODoc 2.00
 
 There are various ways to install this module:
 
@@ -9,16 +9,16 @@
  (2) if you use Windows, have a look at http://ppm.activestate.com/
 
  (3) if you have downloaded this module manually (as root/administrator)
-       gzip -d XML-LibXML-Simple-0.13.tar.gz
-       tar -xf XML-LibXML-Simple-0.13.tar
-       cd XML-LibXML-Simple-0.13
+       gzip -d XML-LibXML-Simple-0.15.tar.gz
+       tar -xf XML-LibXML-Simple-0.15.tar
+       cd XML-LibXML-Simple-0.15
        perl Makefile.PL
        make          # optional
        make test     # optional
        make install
 
 For usage, see the included manual-pages or
-    http://search.cpan.org/dist/XML-LibXML-Simple-0.13/
+    http://search.cpan.org/dist/XML-LibXML-Simple-0.15/
 
 Please report problems to
     http://rt.cpan.org/Dist/Display.html?Queue=XML-LibXML-Simple

Modified: branches/upstream/libxml-libxml-simple-perl/current/lib/XML/LibXML/Simple.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libxml-libxml-simple-perl/current/lib/XML/LibXML/Simple.pm?rev=75013&op=diff
==============================================================================
--- branches/upstream/libxml-libxml-simple-perl/current/lib/XML/LibXML/Simple.pm (original)
+++ branches/upstream/libxml-libxml-simple-perl/current/lib/XML/LibXML/Simple.pm Thu Jun  2 10:59:07 2011
@@ -1,10 +1,10 @@
-# Copyrights 2008-2010 by Mark Overmeer.
+# Copyrights 2008-2011 by Mark Overmeer.
 #  For other contributors see ChangeLog.
 # See the manual pages for details on the licensing terms.
-# Pod stripped from pm file by OODoc 1.06.
+# Pod stripped from pm file by OODoc 2.00.
 package XML::LibXML::Simple;
 use vars '$VERSION';
-$VERSION = '0.14';
+$VERSION = '0.15';
 
 use base 'Exporter';
 use strict;
@@ -61,14 +61,12 @@
 }
 *xml_in = \&XMLin;
 
-my $parser;
 sub _get_xml($$)
 {   my ($self, $source, $opts) = @_;
 
     $source    = $self->default_data_source($opts) unless defined $source;
     $source    = \*STDIN if $source eq '-';
-
-    $parser  ||= XML::LibXML->new;
+    my $parser = XML::LibXML->new;
 
     my $xml
       = UNIVERSAL::isa($source,'XML::LibXML::Document') ? $source

Modified: branches/upstream/libxml-libxml-simple-perl/current/lib/XML/LibXML/Simple.pod
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libxml-libxml-simple-perl/current/lib/XML/LibXML/Simple.pod?rev=75013&op=diff
==============================================================================
--- branches/upstream/libxml-libxml-simple-perl/current/lib/XML/LibXML/Simple.pod (original)
+++ branches/upstream/libxml-libxml-simple-perl/current/lib/XML/LibXML/Simple.pod Thu Jun  2 10:59:07 2011
@@ -28,9 +28,9 @@
 
 =head2 Constructors
 
-XML::LibXML::Simple-E<gt>B<new>(OPTIONS)
-
 =over 4
+
+=item XML::LibXML::Simple-E<gt>B<new>(OPTIONS)
 
 Instantiate an object, which can be used to call L<XMLin()|XML::LibXML::Simple/"Translators"> on.  You can
 provide OPTIONS to this constructor (to be reused for each call to XMLin)
@@ -43,9 +43,9 @@
 
 =head2 Translators
 
-$obj-E<gt>B<XMLin>(XML-DATA, OPTIONS)
-
 =over 4
+
+=item $obj-E<gt>B<XMLin>(XML-DATA, OPTIONS)
 
 For XML-DATA and descriptions of the OPTIONS see the L</DETAILS>
 section of this manual page.
@@ -550,6 +550,149 @@
 
 =back
 
+=head1 EXAMPLES
+
+When C<XMLin()> reads the following very simple piece of XML:
+
+    <opt username="testuser" password="frodo"></opt>
+
+it returns the following data structure:
+
+    {
+      'username' => 'testuser',
+      'password' => 'frodo'
+    }
+
+The identical result could have been produced with this alternative XML:
+
+    <opt username="testuser" password="frodo" />
+
+Or this (although see 'ForceArray' option for variations):
+
+    <opt>
+      <username>testuser</username>
+      <password>frodo</password>
+    </opt>
+
+Repeated nested elements are represented as anonymous arrays:
+
+    <opt>
+      <person firstname="Joe" lastname="Smith">
+        <email>joe at smith.com</email>
+        <email>jsmith at yahoo.com</email>
+      </person>
+      <person firstname="Bob" lastname="Smith">
+        <email>bob at smith.com</email>
+      </person>
+    </opt>
+
+    {
+      'person' => [
+                    {
+                      'email' => [
+                                   'joe at smith.com',
+                                   'jsmith at yahoo.com'
+                                 ],
+                      'firstname' => 'Joe',
+                      'lastname' => 'Smith'
+                    },
+                    {
+                      'email' => 'bob at smith.com',
+                      'firstname' => 'Bob',
+                      'lastname' => 'Smith'
+                    }
+                  ]
+    }
+
+Nested elements with a recognised key attribute are transformed (folded) from
+an array into a hash keyed on the value of that attribute (see the C<KeyAttr>
+option):
+
+    <opt>
+      <person key="jsmith" firstname="Joe" lastname="Smith" />
+      <person key="tsmith" firstname="Tom" lastname="Smith" />
+      <person key="jbloggs" firstname="Joe" lastname="Bloggs" />
+    </opt>
+
+    {
+      'person' => {
+                    'jbloggs' => {
+                                   'firstname' => 'Joe',
+                                   'lastname' => 'Bloggs'
+                                 },
+                    'tsmith' => {
+                                  'firstname' => 'Tom',
+                                  'lastname' => 'Smith'
+                                },
+                    'jsmith' => {
+                                  'firstname' => 'Joe',
+                                  'lastname' => 'Smith'
+                                }
+                  }
+    }
+
+The <anon> tag can be used to form anonymous arrays:
+
+    <opt>
+      <head><anon>Col 1</anon><anon>Col 2</anon><anon>Col 3</anon></head>
+      <data><anon>R1C1</anon><anon>R1C2</anon><anon>R1C3</anon></data>
+      <data><anon>R2C1</anon><anon>R2C2</anon><anon>R2C3</anon></data>
+      <data><anon>R3C1</anon><anon>R3C2</anon><anon>R3C3</anon></data>
+    </opt>
+
+    {
+      'head' => [
+                  [ 'Col 1', 'Col 2', 'Col 3' ]
+                ],
+      'data' => [
+                  [ 'R1C1', 'R1C2', 'R1C3' ],
+                  [ 'R2C1', 'R2C2', 'R2C3' ],
+                  [ 'R3C1', 'R3C2', 'R3C3' ]
+                ]
+    }
+
+Anonymous arrays can be nested to arbirtrary levels and as a special case, if
+the surrounding tags for an XML document contain only an anonymous array the
+arrayref will be returned directly rather than the usual hashref:
+
+    <opt>
+      <anon><anon>Col 1</anon><anon>Col 2</anon></anon>
+      <anon><anon>R1C1</anon><anon>R1C2</anon></anon>
+      <anon><anon>R2C1</anon><anon>R2C2</anon></anon>
+    </opt>
+
+    [
+      [ 'Col 1', 'Col 2' ],
+      [ 'R1C1', 'R1C2' ],
+      [ 'R2C1', 'R2C2' ]
+    ]
+
+Elements which only contain text content will simply be represented as a
+scalar.  Where an element has both attributes and text content, the element
+will be represented as a hashref with the text content in the 'content' key
+(see the C<ContentKey> option):
+
+  <opt>
+    <one>first</one>
+    <two attr="value">second</two>
+  </opt>
+
+  {
+    'one' => 'first',
+    'two' => { 'attr' => 'value', 'content' => 'second' }
+  }
+
+Mixed content (elements which contain both text content and nested elements)
+will be not be represented in a useful way - element order and significant
+whitespace will be lost.  If you need to work with mixed content, then
+XML::Simple is not the right tool for your job - check out the next section.
+
+=head1 SEE ALSO
+
+L<XML::Compile> for processing XML when a schema is available
+
+L<XML::Simple>, the SAX and original implementation
+
 =head1 COPYRIGHT
 
 The interface design and large parts of the documentation were taken




More information about the Pkg-perl-cvs-commits mailing list