r42451 - in /branches/upstream/libxml-treebuilder-perl: ./ current/ current/lib/ current/lib/XML/ current/t/

dottedmag-guest at users.alioth.debian.org dottedmag-guest at users.alioth.debian.org
Sat Aug 22 11:55:34 UTC 2009


Author: dottedmag-guest
Date: Sat Aug 22 11:55:28 2009
New Revision: 42451

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=42451
Log:
[svn-inject] Installing original source of libxml-treebuilder-perl

Added:
    branches/upstream/libxml-treebuilder-perl/
    branches/upstream/libxml-treebuilder-perl/current/
    branches/upstream/libxml-treebuilder-perl/current/Changes
    branches/upstream/libxml-treebuilder-perl/current/MANIFEST
    branches/upstream/libxml-treebuilder-perl/current/MANIFEST.SKIP
    branches/upstream/libxml-treebuilder-perl/current/META.yml
    branches/upstream/libxml-treebuilder-perl/current/Makefile.PL
    branches/upstream/libxml-treebuilder-perl/current/README
    branches/upstream/libxml-treebuilder-perl/current/lib/
    branches/upstream/libxml-treebuilder-perl/current/lib/XML/
    branches/upstream/libxml-treebuilder-perl/current/lib/XML/Element.pm
    branches/upstream/libxml-treebuilder-perl/current/lib/XML/TreeBuilder.pm
    branches/upstream/libxml-treebuilder-perl/current/t/
    branches/upstream/libxml-treebuilder-perl/current/t/00about.t
    branches/upstream/libxml-treebuilder-perl/current/t/10main.t   (with props)

Added: branches/upstream/libxml-treebuilder-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libxml-treebuilder-perl/current/Changes?rev=42451&op=file
==============================================================================
--- branches/upstream/libxml-treebuilder-perl/current/Changes (added)
+++ branches/upstream/libxml-treebuilder-perl/current/Changes Sat Aug 22 11:55:28 2009
@@ -1,0 +1,18 @@
+# Time-stamp: "2004-06-10 20:28:41 ADT"
+
+
+2004-06-10   Sean M. Burke <sburke at cpan.org>
+
+   Release 3.09 -- maintenance release.
+
+   Just making the dist and the docs a bit tidier -- no actual code changes.
+   Also modernized the tests just a bit.
+
+
+2000-11-03   Sean M. Burke <sburke at cpan.org>
+
+   Release 3.08
+
+   First release version.
+
+

Added: branches/upstream/libxml-treebuilder-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libxml-treebuilder-perl/current/MANIFEST?rev=42451&op=file
==============================================================================
--- branches/upstream/libxml-treebuilder-perl/current/MANIFEST (added)
+++ branches/upstream/libxml-treebuilder-perl/current/MANIFEST Sat Aug 22 11:55:28 2009
@@ -1,0 +1,10 @@
+Changes
+lib/XML/Element.pm
+lib/XML/TreeBuilder.pm
+Makefile.PL
+MANIFEST
+MANIFEST.SKIP
+README
+t/00about.t
+t/10main.t
+META.yml                                 Module meta-data (added by MakeMaker)

Added: branches/upstream/libxml-treebuilder-perl/current/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libxml-treebuilder-perl/current/MANIFEST.SKIP?rev=42451&op=file
==============================================================================
--- branches/upstream/libxml-treebuilder-perl/current/MANIFEST.SKIP (added)
+++ branches/upstream/libxml-treebuilder-perl/current/MANIFEST.SKIP Sat Aug 22 11:55:28 2009
@@ -1,0 +1,8 @@
+^MANIFEST\.bak$
+^XML-TreeBuilder-\d
+Makefile(\.old)?$
+\.rej$
+CVS
+blib
+~
+

Added: branches/upstream/libxml-treebuilder-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libxml-treebuilder-perl/current/META.yml?rev=42451&op=file
==============================================================================
--- branches/upstream/libxml-treebuilder-perl/current/META.yml (added)
+++ branches/upstream/libxml-treebuilder-perl/current/META.yml Sat Aug 22 11:55:28 2009
@@ -1,0 +1,13 @@
+# http://module-build.sourceforge.net/META-spec.html
+#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
+name:         XML-TreeBuilder
+version:      3.09
+version_from: lib/XML/TreeBuilder.pm
+installdirs:  site
+requires:
+    HTML::Element:                 3.08
+    HTML::Tagset:                  3.02
+    XML::Parser:                   0
+
+distribution_type: module
+generated_by: ExtUtils::MakeMaker version 6.17

Added: branches/upstream/libxml-treebuilder-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libxml-treebuilder-perl/current/Makefile.PL?rev=42451&op=file
==============================================================================
--- branches/upstream/libxml-treebuilder-perl/current/Makefile.PL (added)
+++ branches/upstream/libxml-treebuilder-perl/current/Makefile.PL Sat Aug 22 11:55:28 2009
@@ -1,0 +1,33 @@
+# This -*- perl -*- script writes the Makefile for XML::TreeBuilder
+#
+# Time-stamp: "2004-06-10 19:57:41 ADT"
+#
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+#
+
+require 5.004;
+use strict;
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+    'NAME'	    => 'XML-TreeBuilder',
+    'VERSION_FROM'  => 'lib/XML/TreeBuilder.pm',
+    'ABSTRACT_FROM' => 'lib/XML/TreeBuilder.pm',
+
+    'PREREQ_PM'    => {	
+	                 'HTML::Element' => 3.08,   # at LEAST!
+	                 'HTML::Tagset' => 3.02,
+                         'XML::Parser' => 0,
+		      },
+    dist           => { COMPRESS => 'gzip -6f', SUFFIX => 'gz', },
+);
+
+package MY;
+
+sub libscan
+{ # Determine things that should *not* be installed
+    my($self, $path) = @_;
+    return '' if $path =~ m/~/;
+    $path;
+}

Added: branches/upstream/libxml-treebuilder-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libxml-treebuilder-perl/current/README?rev=42451&op=file
==============================================================================
--- branches/upstream/libxml-treebuilder-perl/current/README (added)
+++ branches/upstream/libxml-treebuilder-perl/current/README Sat Aug 22 11:55:28 2009
@@ -1,0 +1,51 @@
+# Time-stamp: "2004-06-10 20:01:55 ADT"
+
+XML::TreeBuilder
+----------------
+
+This module uses XML::Parser to make XML document trees constructed of
+XML::Element objects (and XML::Element is a subclass of HTML::Element
+adapted for XML).  XML::TreeBuilder is meant particularly for people
+who are used to the HTML::TreeBuilder / HTML::Element interface to
+document trees, and who don't want to learn some other document
+interface like XML::Twig or XML::DOM.
+
+
+PREREQUISITES
+
+In order to install and use this package you will need Perl version
+5.004 or better.  You will also need to have the XML-Parser and
+HTML-Tree distributions installed.  All of these should be available
+from CPAN.
+
+
+
+INSTALLATION
+
+Just follow the usual procedure:
+
+   perl Makefile.PL
+   make
+   make test
+   make install
+
+If you want to install a private copy of this module-suite in your home
+directory, then you should try to produce the initial Makefile with
+something like this command:
+
+  perl Makefile.PL PREFIX=~/perl
+
+See perldoc perlmodinstall for more information on installing modules.
+
+
+SUPPORT
+
+Questions, bug reports, useful code bits, and suggestions for this
+module should just be sent to me at sburke at cpan.org
+
+
+AVAILABILITY
+
+The latest version of this module is available from the Comprehensive
+Perl Archive Network (CPAN).  Visit <http://www.perl.com/CPAN/> to
+find a CPAN site near you.

Added: branches/upstream/libxml-treebuilder-perl/current/lib/XML/Element.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libxml-treebuilder-perl/current/lib/XML/Element.pm?rev=42451&op=file
==============================================================================
--- branches/upstream/libxml-treebuilder-perl/current/lib/XML/Element.pm (added)
+++ branches/upstream/libxml-treebuilder-perl/current/lib/XML/Element.pm Sat Aug 22 11:55:28 2009
@@ -1,0 +1,121 @@
+
+require 5;
+package XML::Element;
+#Time-stamp: "2004-06-10 20:00:02 ADT"
+use HTML::Tagset ();
+use HTML::Element 3.08 ();
+$VERSION = '3.09';
+ at ISA = ('HTML::Element');
+
+# Init:
+%emptyElement = ();
+foreach my $e (%HTML::Tagset::emptyElement) {
+  $emptyElement{$e} = 1
+    if substr($e,0,1) eq '~' and $HTML::Tagset::emptyElement{$e};
+}
+
+#--------------------------------------------------------------------------
+#Some basic overrides:
+
+sub _empty_element_map { \%emptyElement }
+
+*_fold_case = \&HTML::Element::_fold_case_NOT;
+*starttag   = \&HTML::Element::starttag_XML;
+*endtag     = \&HTML::Element::endtag_XML;
+
+# TODO: override id with something that looks for xml:id too/instead?
+
+#--------------------------------------------------------------------------
+
+#TODO: test and document this:
+# with no tagname set, assumes ALL all-whitespace nodes are ignorable!
+
+use strict;
+
+sub delete_ignorable_whitespace {
+  my $under_hash = $_[1];
+  my(@to_do) = ($_[0]);
+  
+  if($under_hash and ref($under_hash) eq 'ARRAY') {
+    $under_hash = { map {; $_ => 1 } @$under_hash };
+  }
+  
+  my $all = !$under_hash;
+  my($i,$this,$children);
+  while(@to_do) {
+    $this = shift @to_do;
+    $children = $this->content || next;
+    if(
+      ($all or $under_hash->{$this->tag})
+      and @$children
+    ) {
+      for($i = $#$children; $i >= 0; --$i) {
+        # work backwards thru the list
+        next if ref $children->[$i];
+        if($children->[$i] =~ m<^\s*$>s) { # all WS
+          splice @$children, $i, 1; # delete it.
+        }
+      }
+    }
+    unshift @to_do, grep ref($_), @$children; # recurse
+  }
+  
+  return;
+}
+
+#--------------------------------------------------------------------------
+
+1;
+
+__END__
+
+=head1 NAME
+
+XML::Element - XML elements with the same interface as HTML::Element
+
+=head1 SYNOPSIS
+
+  [See HTML::Element]
+
+=head1 DESCRIPTION
+
+This is just a subclass of HTML::Element.  It works basically the same
+as HTML::Element, except that tagnames and attribute names aren't
+forced to lowercase, as they are in HTML::Element.
+
+L<HTML::Element> describes everything you can do with this class.
+
+=head1 CAVEATS
+
+Has currently no handling of namespaces.
+
+=head1 SEE ALSO
+
+L<XML::TreeBuilder> for a class that actually builds XML::Element
+structures.
+
+L<HTML::Element> for all documentation.
+
+L<XML::DOM> and L<XML::Twig> for other XML document tree interfaces.
+
+L<XML::Generator> for more fun.
+
+
+=head1 COPYRIGHT AND DISCLAIMERS
+
+Copyright (c) 2000,2004 Sean M. Burke.  All rights reserved.
+
+This library is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+This program is distributed in the hope that it will be useful, but
+without any warranty; without even the implied warranty of
+merchantability or fitness for a particular purpose.
+
+
+=head1 AUTHOR
+
+Sean M. Burke, E<lt>sburke at cpan.orgE<gt>
+
+=cut
+

Added: branches/upstream/libxml-treebuilder-perl/current/lib/XML/TreeBuilder.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libxml-treebuilder-perl/current/lib/XML/TreeBuilder.pm?rev=42451&op=file
==============================================================================
--- branches/upstream/libxml-treebuilder-perl/current/lib/XML/TreeBuilder.pm (added)
+++ branches/upstream/libxml-treebuilder-perl/current/lib/XML/TreeBuilder.pm Sat Aug 22 11:55:28 2009
@@ -1,0 +1,265 @@
+
+require 5;
+package XML::TreeBuilder;
+#Time-stamp: "2004-06-10 19:59:14 ADT"
+use strict;
+use XML::Element ();
+use XML::Parser ();
+use vars qw(@ISA $VERSION);
+
+$VERSION = '3.09';
+ at ISA = ('XML::Element');
+
+#==========================================================================
+sub new {
+  my $class = ref($_[0]) || $_[0];
+  # that's the only parameter it knows
+  
+  my $self = XML::Element->new('NIL');
+  bless $self, $class; # and rebless
+  $self->{'_element_class'} = 'XML::Element';
+  $self->{'_store_comments'}     = 0;
+  $self->{'_store_pis'}          = 0;
+  $self->{'_store_declarations'} = 0;
+  
+  my @stack;
+  # Compare the simplicity of this to the sheer nastiness of HTML::TreeBuilder!
+  
+  $self->{'_xml_parser'} = XML::Parser->new( 'Handlers' => {
+    'Start' => sub {
+      shift;
+      if(@stack) {
+         push @stack, $self->{'_element_class'}->new(@_);
+         $stack[-2]->push_content( $stack[-1] );
+       } else {
+         $self->tag(shift);
+         while(@_) { $self->attr(splice(@_,0,2)) };
+         push @stack, $self;
+       }
+    },
+    
+    'End'  => sub { pop @stack; return },
+    
+    'Char' => sub { $stack[-1]->push_content($_[1]) },
+    
+    'Comment' => sub {
+       return unless $self->{'_store_comments'};
+       (
+        @stack ? $stack[-1] : $self
+       )->push_content(
+         $self->{'_element_class'}->new('~comment', 'text' => $_[1])
+       );
+       return;
+    },
+    
+    'Proc' => sub {
+       return unless $self->{'_store_pis'};
+       (
+        @stack ? $stack[-1] : $self
+       )->push_content(
+         $self->{'_element_class'}->new('~pi', 'text' => "$_[1] $_[2]")
+       );
+       return;
+    },
+    
+    # And now, declarations:
+    
+    'Attlist' => sub {
+       return unless $self->{'_store_declarations'};
+       shift;
+       (
+        @stack ? $stack[-1] : $self
+       )->push_content(
+         $self->{'_element_class'}->new('~declaration',
+          'text' => join ' ', 'ATTLIST', @_
+         )
+       );
+       return;
+    },
+    
+    'Element' => sub {
+       return unless $self->{'_store_declarations'};
+       shift;
+       (
+        @stack ? $stack[-1] : $self
+       )->push_content(
+         $self->{'_element_class'}->new('~declaration',
+          'text' => join ' ', 'ELEMENT', @_
+         )
+       );
+       return;
+    },
+    
+    'Doctype' => sub {
+       return unless $self->{'_store_declarations'};
+       shift;
+       (
+        @stack ? $stack[-1] : $self
+       )->push_content(
+         $self->{'_element_class'}->new('~declaration',
+          'text' => join ' ', 'DOCTYPE', @_
+         )
+       );
+       return;
+    },
+    
+  });
+  
+  return $self;
+}
+#==========================================================================
+sub _elem # universal accessor...
+{
+  my($self, $elem, $val) = @_;
+  my $old = $self->{$elem};
+  $self->{$elem} = $val if defined $val;
+  return $old;
+}
+
+sub store_comments { shift->_elem('_store_comments', @_); }
+sub store_declarations { shift->_elem('_store_declarations', @_); }
+sub store_pis      { shift->_elem('_store_pis', @_); }
+
+#==========================================================================
+
+sub parse {
+  shift->{'_xml_parser'}->parse(@_);
+}
+
+sub parse_file { shift->parsefile(@_) } # alias
+
+sub parsefile {
+  shift->{'_xml_parser'}->parsefile(@_);
+}
+
+sub eof {
+  delete shift->{'_xml_parser'}; # sure, why not?
+}
+
+#==========================================================================
+1;
+
+__END__
+
+
+=head1 NAME
+
+XML::TreeBuilder - Parser that builds a tree of XML::Element objects
+
+=head1 SYNOPSIS
+
+  foreach my $file_name (@ARGV) {
+    my $tree = XML::TreeBuilder->new; # empty tree
+    $tree->parse_file($file_name);
+    print "Hey, here's a dump of the parse tree of $file_name:\n";
+    $tree->dump; # a method we inherit from XML::Element
+    print "And here it is, bizarrely rerendered as XML:\n",
+      $tree->as_XML, "\n";
+    
+    # Now that we're done with it, we must destroy it.
+    $tree = $tree->delete;
+  }
+
+=head1 DESCRIPTION
+
+This module uses XML::Parser to make XML document trees constructed of
+XML::Element objects (and XML::Element is a subclass of HTML::Element
+adapted for XML).  XML::TreeBuilder is meant particularly for people
+who are used to the HTML::TreeBuilder / HTML::Element interface to
+document trees, and who don't want to learn some other document
+interface like XML::Twig or XML::DOM.
+
+The way to use this class is to:
+
+1. start a new (empty) XML::TreeBuilder object.
+
+2. set any of the "store" options you want.
+
+3. then parse the document from a source by calling
+C<$x-E<gt>parsefile(...)>
+or
+C<$x-E<gt>parse(...)> (See L<XML::Parser> docs for the options
+that these two methods take)
+
+4. do whatever you need to do with the syntax tree, presumably
+involving traversing it looking for some bit of information in it,
+
+5. and finally, when you're done with the tree, call $tree->delete to
+erase the contents of the tree from memory.  This kind of thing
+usually isn't necessary with most Perl objects, but it's necessary for
+TreeBuilder objects.  See L<HTML::Element> for a more verbose
+explanation of why this is the case.
+
+=head1 METHODS AND ATTRIBUTES
+
+XML::TreeBuilder is a subclass of XML::Element, which in turn is a subclass
+of HTML:Element.  You should read and understand the documentation for
+those two modules.
+
+An XML::TreeBuilder object is just a special XML::Element object that
+allows you to call these additional methods:
+
+=over
+
+=item $root = XML::TreeBuilder->new()
+
+Construct a new XML::TreeBuilder object.
+
+=item $root->parse(...options...)
+
+Uses XML::Parser's C<parse> method to parse XML from the source(s?)
+specified by the options.  See L<XML::Parse>
+
+=item $root->parsefile(...options...)
+
+Uses XML::Parser's C<parsefile> method to parse XML from the source(s?)
+specified by the options.  See L<XML::Parse>
+
+=item $root->parse_file(...options...)
+
+Simply an alias for C<parsefile>.
+
+=item $root->store_comments(value)
+
+This determines whether TreeBuilder will normally store comments found
+while parsing content into C<$root>.  Currently, this is off by default.
+
+=item $root->store_declarations(value)
+
+This determines whether TreeBuilder will normally store markup
+declarations found while parsing content into C<$root>.  Currently,
+this is off by default.
+
+=item $root->store_pis(value)
+
+This determines whether TreeBuilder will normally store processing
+instructions found while parsing content into C<$root>.
+Currently, this is off (false) by default.
+
+=back
+
+=head1 SEE ALSO
+
+L<XML::Parser>, L<XML::Element>, L<HTML::TreeBuilder>, L<HTML::DOMbo>.
+
+And for alternate XML document interfaces, L<XML::DOM> and L<XML::Twig>.
+
+
+=head1 COPYRIGHT AND DISCLAIMERS
+
+Copyright (c) 2000,2004 Sean M. Burke.  All rights reserved.
+
+This library is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+This program is distributed in the hope that it will be useful, but
+without any warranty; without even the implied warranty of
+merchantability or fitness for a particular purpose.
+
+
+=head1 AUTHOR
+
+Sean M. Burke, E<lt>sburke at cpan.orgE<gt>
+
+=cut
+

Added: branches/upstream/libxml-treebuilder-perl/current/t/00about.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libxml-treebuilder-perl/current/t/00about.t?rev=42451&op=file
==============================================================================
--- branches/upstream/libxml-treebuilder-perl/current/t/00about.t (added)
+++ branches/upstream/libxml-treebuilder-perl/current/t/00about.t Sat Aug 22 11:55:28 2009
@@ -1,0 +1,105 @@
+
+require 5;
+# Time-stamp: "2004-06-10 20:02:08 ADT"
+
+# Summary of, well, things.
+
+use strict;
+use Test;
+my @modules;
+BEGIN {
+  @modules = qw(
+
+XML::TreeBuilder
+
+  );
+  plan tests => 2 + @modules;
+};
+
+ok 1;
+
+#chdir "t" if -e "t";
+foreach my $m (@modules) {
+  print "# Loading $m ...\n";
+  eval "require $m;";
+  unless($@) { ok 1; next }
+  my $e = $@;
+  $e =~ s/\s+$//s;
+  $e =~ s/[\n\r]+/\n# > /;
+  print "# Error while trying to load $m --\n# > $e\n";
+  ok 0;
+}
+
+{
+  my @out;
+  push @out,
+    "\n\nPerl v",
+    defined($^V) ? sprintf('%vd', $^V) : $],
+    " under $^O ",
+    (defined(&Win32::BuildNumber) and defined &Win32::BuildNumber())
+      ? ("(Win32::BuildNumber ", &Win32::BuildNumber(), ")") : (),
+    (defined $MacPerl::Version)
+      ? ("(MacPerl version $MacPerl::Version)") : (),
+    "\n"
+  ;
+
+  # Ugly code to walk the symbol tables:
+  my %v;
+  my @stack = ('');  # start out in %::
+  my $this;
+  my $count = 0;
+  my $pref;
+  while(@stack) {
+    $this = shift @stack;
+    die "Too many packages?" if ++$count > 1000;
+    next if exists $v{$this};
+    next if $this eq 'main'; # %main:: is %::
+
+    #print "Peeking at $this => ${$this . '::VERSION'}\n";
+    no strict 'refs';
+    if( defined ${$this . '::VERSION'} ) {
+      $v{$this} = ${$this . '::VERSION'}
+    } elsif(
+       defined *{$this . '::ISA'} or defined &{$this . '::import'}
+       or ($this ne '' and grep defined *{$_}{'CODE'}, values %{$this . "::"})
+       # If it has an ISA, an import, or any subs...
+    ) {
+      # It's a class/module with no version.
+      $v{$this} = undef;
+    } else {
+      # It's probably an unpopulated package.
+      ## $v{$this} = '...';
+    }
+    
+    $pref = length($this) ? "$this\::" : '';
+    push @stack, map m/^(.+)::$/ ? "$pref$1" : (),
+        do { no strict 'refs'; keys %{$this . '::'} };
+    #print "Stack: @stack\n";
+  }
+  push @out, " Modules in memory:\n";
+  delete @v{'', '[none]'};
+  foreach my $p (sort {lc($a) cmp lc($b)} keys %v) {
+    my $indent = ' ' x (2 + ($p =~ tr/:/:/));
+    push @out,  '  ', $indent, $p, defined($v{$p}) ? " v$v{$p};\n" : ";\n";
+  }
+  push @out, sprintf "[at %s (local) / %s (GMT)]\n",
+    scalar(gmtime), scalar(localtime);
+  my $x = join '', @out;
+  $x =~ s/^/#/mg;
+  print $x;
+}
+
+print "# Running",
+  (chr(65) eq 'A') ? " in an ASCII world.\n" : " in a non-ASCII world.\n",
+  "#\n",
+;
+
+print "# \@INC:\n", map("#   [$_]\n", @INC), "#\n#\n";
+
+print "# \%INC:\n";
+foreach my $x (sort {lc($a) cmp lc($b)} keys %INC) {
+  print "#   [$x] = [", $INC{$x} || '', "]\n";
+}
+
+ok 1;
+

Added: branches/upstream/libxml-treebuilder-perl/current/t/10main.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libxml-treebuilder-perl/current/t/10main.t?rev=42451&op=file
==============================================================================
--- branches/upstream/libxml-treebuilder-perl/current/t/10main.t (added)
+++ branches/upstream/libxml-treebuilder-perl/current/t/10main.t Sat Aug 22 11:55:28 2009
@@ -1,0 +1,51 @@
+
+# Time-stamp: "2004-06-10 20:22:53 ADT" 
+
+use Test;
+BEGIN { plan tests => 3 }
+
+use XML::TreeBuilder;
+
+print "# Hi, I'm ", __FILE__ , " running  XML::TreeBuilder v$XML::TreeBuilder::VERSION\n";
+ok 1;
+
+use strict;
+my $x = XML::TreeBuilder->new;
+$x->store_comments(1);
+$x->store_pis(1);
+$x->store_declarations(1);
+$x->parse(
+  qq{<!-- myorp --><Gee><foo Id="me" xml:foo="lal">Hello World</foo>} .
+  qq{<lor/><!-- foo --></Gee><!-- glarg -->}
+);
+
+my $y = XML::Element->new_from_lol(
+ ['Gee',
+   ['~comment', {'text' => ' myorp '}],
+   ['foo', {'Id'=> 'me', 'xml:foo' => 'lal'}, 'Hello World'],
+   ['lor'],
+   ['~comment', {'text' => ' foo '}],
+   ['~comment', {'text' => ' glarg '}],
+ ]
+);
+
+
+ok $x->same_as($y);
+
+unless( $ENV{'HARNESS_ACTIVE'} ) {
+  $x->dump;
+  $y->dump;
+}
+
+
+
+#print "\n", $x->as_Lisp_form, "\n";
+#print "\n", $x->as_XML, "\n\n";
+#print "\n", $y->as_XML, "\n\n";
+$x->delete;
+$y->delete;
+
+ok 1;
+print "# Bye from ", __FILE__, "\n";
+
+__END__

Propchange: branches/upstream/libxml-treebuilder-perl/current/t/10main.t
------------------------------------------------------------------------------
    svn:executable = 




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