r76036 - in /trunk/libxml-libxml-simple-perl: ChangeLog META.yml Makefile.PL README debian/changelog lib/XML/LibXML/Simple.pm lib/XML/LibXML/Simple.pod
carnil at users.alioth.debian.org
carnil at users.alioth.debian.org
Sat Jun 18 21:10:59 UTC 2011
Author: carnil
Date: Sat Jun 18 21:10:50 2011
New Revision: 76036
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=76036
Log:
* Team upload.
* New upstream release
Modified:
trunk/libxml-libxml-simple-perl/ChangeLog
trunk/libxml-libxml-simple-perl/META.yml
trunk/libxml-libxml-simple-perl/Makefile.PL
trunk/libxml-libxml-simple-perl/README
trunk/libxml-libxml-simple-perl/debian/changelog
trunk/libxml-libxml-simple-perl/lib/XML/LibXML/Simple.pm
trunk/libxml-libxml-simple-perl/lib/XML/LibXML/Simple.pod
Modified: trunk/libxml-libxml-simple-perl/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-libxml-simple-perl/ChangeLog?rev=76036&op=diff
==============================================================================
--- trunk/libxml-libxml-simple-perl/ChangeLog (original)
+++ trunk/libxml-libxml-simple-perl/ChangeLog Sat Jun 18 21:10:50 2011
@@ -1,5 +1,13 @@
=== version history for XML::LibXML::Simple
+
+version 0.90: Wed Jun 15 10:20:48 CEST 2011
+ Fixes:
+ - initialize XML::LibXML::Parser into safe mode.
+ rt.cpan.org#68803 [Yann Kerherve]
+
+ Improvements:
+ - new Parser and ParserOpts parameters
version 0.15: Thu Apr 28 10:22:34 CEST 2011
Fixes:
Modified: trunk/libxml-libxml-simple-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-libxml-simple-perl/META.yml?rev=76036&op=diff
==============================================================================
--- trunk/libxml-libxml-simple-perl/META.yml (original)
+++ trunk/libxml-libxml-simple-perl/META.yml Sat Jun 18 21:10:50 2011
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: XML-LibXML-Simple
-version: 0.15
+version: 0.90
abstract: XML::LibXML based XML::Simple clone
author:
- Mark Overmeer
Modified: trunk/libxml-libxml-simple-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-libxml-simple-perl/Makefile.PL?rev=76036&op=diff
==============================================================================
--- trunk/libxml-libxml-simple-perl/Makefile.PL (original)
+++ trunk/libxml-libxml-simple-perl/Makefile.PL Sat Jun 18 21:10:50 2011
@@ -4,7 +4,7 @@
WriteMakefile
( NAME => 'XML::LibXML::Simple'
- , VERSION => '0.15'
+ , VERSION => '0.90'
, PREREQ_PM =>
{ XML::LibXML => 1.64
, Test::More => 0.54
Modified: trunk/libxml-libxml-simple-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-libxml-simple-perl/README?rev=76036&op=diff
==============================================================================
--- trunk/libxml-libxml-simple-perl/README (original)
+++ trunk/libxml-libxml-simple-perl/README Sat Jun 18 21:10:50 2011
@@ -1,5 +1,5 @@
-=== README for XML-LibXML-Simple version 0.15
-= Generated on Thu Apr 28 10:22:46 2011 by OODoc 2.00
+=== README for XML-LibXML-Simple version 0.90
+= Generated on Wed Jun 15 10:21:43 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.15.tar.gz
- tar -xf XML-LibXML-Simple-0.15.tar
- cd XML-LibXML-Simple-0.15
+ gzip -d XML-LibXML-Simple-0.90.tar.gz
+ tar -xf XML-LibXML-Simple-0.90.tar
+ cd XML-LibXML-Simple-0.90
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.15/
+ http://search.cpan.org/dist/XML-LibXML-Simple-0.90/
Please report problems to
http://rt.cpan.org/Dist/Display.html?Queue=XML-LibXML-Simple
Modified: trunk/libxml-libxml-simple-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-libxml-simple-perl/debian/changelog?rev=76036&op=diff
==============================================================================
--- trunk/libxml-libxml-simple-perl/debian/changelog (original)
+++ trunk/libxml-libxml-simple-perl/debian/changelog Sat Jun 18 21:10:50 2011
@@ -1,3 +1,10 @@
+libxml-libxml-simple-perl (0.90-1) UNRELEASED; urgency=low
+
+ * Team upload.
+ * New upstream release
+
+ -- Salvatore Bonaccorso <carnil at debian.org> Sat, 18 Jun 2011 23:09:44 +0200
+
libxml-libxml-simple-perl (0.15-1) unstable; urgency=low
* Team upload.
Modified: trunk/libxml-libxml-simple-perl/lib/XML/LibXML/Simple.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-libxml-simple-perl/lib/XML/LibXML/Simple.pm?rev=76036&op=diff
==============================================================================
--- trunk/libxml-libxml-simple-perl/lib/XML/LibXML/Simple.pm (original)
+++ trunk/libxml-libxml-simple-perl/lib/XML/LibXML/Simple.pm Sat Jun 18 21:10:50 2011
@@ -4,7 +4,7 @@
# Pod stripped from pm file by OODoc 2.00.
package XML::LibXML::Simple;
use vars '$VERSION';
-$VERSION = '0.15';
+$VERSION = '0.90';
use base 'Exporter';
use strict;
@@ -25,7 +25,7 @@
my %known_opts = map { ($_ => 1) }
qw(keyattr keeproot forcecontent contentkey noattr searchpath
forcearray grouptags nsexpand normalisespace normalizespace
- valueattr nsstrip);
+ valueattr nsstrip parser parseropts);
my @DefKeyAttr = qw(name key id);
my $DefContentKey = qq(content);
@@ -34,7 +34,12 @@
sub new(@)
{ my $class = shift;
my $self = bless {}, $class;
- $self->{opts} = $self->_take_opts(@_);
+ my $opts = $self->{opts} = $self->_take_opts(@_);
+
+ # parser object cannot be reused
+ !defined $opts->{parser}
+ or error __x"parser option for XMLin only";
+
$self;
}
@@ -64,9 +69,14 @@
sub _get_xml($$)
{ my ($self, $source, $opts) = @_;
- $source = $self->default_data_source($opts) unless defined $source;
- $source = \*STDIN if $source eq '-';
- my $parser = XML::LibXML->new;
+ $source = $self->default_data_source($opts)
+ unless defined $source;
+
+ $source = \*STDIN
+ if $source eq '-';
+
+ my $parser = $opts->{parser}
+ || $self->_create_parser($opts->{parseropts});
my $xml
= UNIVERSAL::isa($source,'XML::LibXML::Document') ? $source
@@ -83,6 +93,22 @@
$xml;
}
+sub _create_parser(@)
+{ my $self = shift;
+ my @popt = @_ != 1 ? @_ : ref $_[0] eq 'HASH' ? %{$_[0]} : @{$_[0]};
+
+ XML::LibXML->new
+ ( line_numbers => 1
+ , no_network => 1
+ , expand_xinclude => 0
+ , expand_entities => 1
+ , load_ext_dtd => 0
+ , ext_ent_handler =>
+ sub { alert __x"parsing external entities disabled"; '' }
+ , @popt
+ );
+}
+
sub _take_opts(@)
{ my $self = shift;
@@ -169,6 +195,8 @@
!$opt{grouptags} || ref $opt{grouptags} eq 'HASH'
or croak "Illegal value for 'GroupTags' option -expected a hashref";
+
+ $opt{parseropts} ||= {};
\%opt;
}
@@ -218,9 +246,9 @@
$d->{$k};
}
-# Takes the parse tree that XML::Parser produced from the supplied XML and
-# recurses through it 'collapsing' unnecessary levels of indirection (nested
-# arrays etc) to produce a data structure that is easier to work with.
+# Takes the parse tree that XML::LibXML::Parser produced from the supplied
+# XML and recurse through it 'collapsing' unnecessary levels of indirection
+# (nested arrays etc) to produce a data structure that is easier to work with.
sub _expand_name($)
{ my $node = shift;
Modified: trunk/libxml-libxml-simple-perl/lib/XML/LibXML/Simple.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-libxml-simple-perl/lib/XML/LibXML/Simple.pod?rev=76036&op=diff
==============================================================================
--- trunk/libxml-libxml-simple-perl/lib/XML/LibXML/Simple.pod (original)
+++ trunk/libxml-libxml-simple-perl/lib/XML/LibXML/Simple.pod Sat Jun 18 21:10:50 2011
@@ -67,24 +67,23 @@
=over 4
-=item .
-
-Only L<XMLin()|XML::LibXML::Simple/"Translators"> is supported: if you want to write XML the use a schema
-(for instance with XML::Compile). Do not attempt to create XML by
-hand! If you still think you need it, then have a look at XMLout() as
-implemented by XML::Simple or any of a zillion template systems.
-
-=item .
+=item only L<XMLin()|XML::LibXML::Simple/"Translators"> is supported
+
+If you want to write XML then use a schema (for instance with
+XML::Compile). Do not attempt to create XML by hand! If you still
+think you need it, then have a look at XMLout() as implemented by
+XML::Simple or any of a zillion template systems.
+
+=item no "variables" option
IMO, you should use a templating system if you want variables filled-in
in the input: it is not a task for this module.
-=item .
-
-Also, empty elements are not removed: being empty has a meaning which
-should not be ignored.
-
-=item .
+=item empty elements are not removed
+
+Being empty has a meaning which should not be ignored.
+
+=item ForceArray options
There are a few small differences in the result of the C<forcearray> option,
because XML::Simple seems to behave inconsequently.
@@ -465,6 +464,23 @@
Note: you can spell this option with a 'z' if that is more natural for you.
+=item Parser => OBJECT
+
+You may pass your own XML::LibXML object, in stead of having one
+created for you. This is useful when you need specific configuration
+on that object (See XML::LibXML::Parser) or have implemented your
+own extension to that object.
+
+The internally created parser object is configured in safe mode.
+Read the XML::LibXML::Parser manual about security issues with
+certain parameter settings. The default is unsafe!
+
+=item ParserOpts => HASH|ARRAY
+
+Pass parameters to the creation of a new internal parser object. You
+can overrule the options which will create a safe parser. It may be more
+readible to use the C<Parser> parameter.
+
=item SearchPath => [ list ] I<# handy>
If you pass C<XMLin()> a filename, but the filename include no directory
@@ -479,7 +495,7 @@
will contain only the directory in which the script itself is located.
Otherwise the default SearchPath will be empty.
-=item ValueAttr => [ names ] I<# in - handy>
+=item ValueAttr => [ names ] I<# handy>
Use this option to deal elements which always have a single attribute and no
content. Eg:
More information about the Pkg-perl-cvs-commits
mailing list