1. Shlomi Fish
  2. perl-XML-LibXML

Commits

ph...@9ae0c189-cd1f-4510-a509-f4891f5cf20d  committed 29223b8

Modified Files:
MANIFEST
+ iterator class and its tests

Changes
+ version notes

Added Files:
example/catalog.xml
test catalog that rewrites an imaginary URI into a valid file

t/21catalog.t
catalog tests

  • Participants
  • Parent commits 7051277
  • Branches default

Comments (0)

Files changed (4)

File Changes

View file
  • Ignore whitespace
 1.49 to 1.53 to avoid such problems.
 
 1.53
+   Parser
    - catalog interface
-   - toFH() fixed
    - enabled SGML parsing
-   - fixed namespace setting in XPath functions:
+   - implemented libxml2 dom recovering
+   - parsing into GDOME nodes is now possible
+   - XML::LibXML::SAX is now faster
+   - made XML::LibXML::SAX parser running without errors in most (all?) cases 
+     (DTD handling is still not implemented).    
+
+   DOM interface
+   - Node Iterator class
+   - NodeList Iterator class
+   - introduced XML::GDOME import and export. (EXPERIMENTAL)
+   - more security checks
+
+   general blur
+   - removed code shared with XML::GDOME to a separate XML::LibXML::Common
+     module (check CPAN)
+   - removed some redundand code
+   - more documentation (and docu fixes) (thanks to Petr Pajas)
+
+   major fixes:
+   - possible buffer overflow with broken XML:
+     This may effect all older versions of XML::LibXML, please upgrade!
+
+   - a bug while replacing the document element.
+   - very stupid encoding bug. all UTF8 strings will now be marked as 
+     UTF8 correctly
+   - namespace functions to work with empty namespaces
+   - toFH()
+   - namespace setting in XPath functions:
      the namespaces of the document element will always be added now
-   - implemented libxml2 dom recovering
-   - introduced transparent XML::GDOME import. (EXPERIMENTAL)
+   - threaded perl 5.8.0 issues
    - calling external entity handlers work again
-   - fixed a bug while replacing the document element.
-   - fixed very stupid encoding bug. all UTF8 strings will now be marked as 
-     UTF8
-   - fixed namespace functions to work with empty namespaces
-   - made XML::LibXML::SAX parser running without errors in most (all?) cases 
-     (DTD handling is still not implemented). 
-   - XML::LibXML::SAX speedups
-   - more security checks
-   - removed some redundand code
-   - more documentation (fixes)
+   - XML::LibXML::SAX::Parser will not throw warnings on DTD nodes
 
 1.52
-   - fixed some typos (thanks to randy kobes and hildo biersma)
+   - fixed some typos (thanks to Randy Kobes and Hildo Biersma)
    - fixed namespace node handling
    - fixed empty Text Node bug
    - corrected the parser default values.
    - fixed parser bug with broken XML declarations
    - fixed memory management within documents that have subsets
    - fixed some threaded perl issues
-     (special thanks to andreas koenig for the patch)
+     (special thanks to Andreas Koenig for the patch)
    - applied Win32 tests 
-     (special thanks to randy kobes for the patch)
+     (special thanks to Randy Kobes for the patch)
    - fixed findnodes() and find() to return empty arrays in array context
      if the statement was legal but produced no result.
    - fixed namespace handling in xpath functions

File MANIFEST

View file
  • Ignore whitespace
 t/18docfree.t
 t/19encoding.t
 t/20extras.t
+t/22iterator.t
 lib/XML/LibXML/Attr.pod
 lib/XML/LibXML/Comment.pod
 lib/XML/LibXML/DOM.pod
 lib/XML/LibXML/DocumentFragment.pod
 lib/XML/LibXML/Namespace.pod
 lib/XML/LibXML/NodeList.pm
+lib/XML/LibXML/Iterator.pm
 lib/XML/LibXML/Literal.pm
 lib/XML/LibXML/Boolean.pm
 lib/XML/LibXML/Number.pm

File example/catalog.xml

View file
  • Ignore whitespace
+<?xml version="1.0"?>
+<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+<rewriteURI uriStartString="http://axkit.org/xml-libxml" rewritePrefix="file:///home/phish/src/cvs/XML-LibXML/example"/>
+</catalog>

File t/21catalog.t

View file
  • Ignore whitespace
+use Test;
+
+BEGIN { plan tests => 1; }
+
+use XML::LibXML;
+
+# XML::LibXML->load_catalog( "example/catalog.xml" );
+
+# the following document should not be able to get parsed 
+# if the catalog is not available
+
+my $doc = XML::LibXML->new( catalog => "example/catalog.xml" )->parse_string(<<EOF);
+<!DOCTYPE article
+  PUBLIC "-//Perl//XML LibXML V4.1.2//EN"
+  "http://axkit.org/xml-libxml/test.dtd">
+<article>
+<pubData>Something here</pubData>
+<pubArticleID>12345</pubArticleID>
+<pubDate>2001-04-01</pubDate>
+<pubName>XML.com</pubName>
+<section>Foo</section>
+<lead>Here's some leading text</lead>
+<rest>And here is the rest...</rest>
+</article>
+EOF
+
+ok($doc);