home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / share / doc / libxml-twig-perl / README < prev   
Encoding:
Text File  |  2006-06-01  |  2.9 KB  |  103 lines

  1. NAME
  2.  
  3.     XML::Twig - Tree interface to XML documents allowing processing chunk
  4.                 by chunk of huge documents.
  5.  
  6.                 
  7.  
  8. SUMMARY (see perldoc XML::Twig for full details)
  9.  
  10. XML::Twig is (yet another!) XML transformation module. 
  11.  
  12. Its strong points: can be used to process huge documents while still
  13. being in tree mode; not bound by DOM or SAX, so it is very perlish and
  14. offers a very comprehensive set of methods; simple to use; DWIMs as
  15. much as possible
  16.  
  17. What it doesn't offer: full SAX support (it can export SAX, but only
  18. reads XML), full XPath support (unless you use XML::Twig::XPath), nor
  19. DOM support.
  20.  
  21. Other drawbacks: it is a big module, and with over 500 methods available
  22. it can be a bit overwhelming. A good starting point is the tutorial at
  23. http://xmltwig.com/xmltwig/tutorial/index.html. In fact the whole
  24. XML::Twig page at http://xmltwig.com/xmltwig/ has plenty of information
  25. to get you started with XML::Twig
  26.  
  27. TOOLS
  28.  
  29. XML::Twig comes with a few tools built on top of it:
  30.  
  31.   xml_pp           XML pretty printer
  32.   xml_grep         XML grep - grep XML files using XML::Twig's subset of XPath
  33.   xml_split        split big XML files
  34.   xml_merge        merge back files created by xml_split
  35.   xml_spellcheck   spellcheck XML files skipping tags
  36.  
  37.  
  38. SYNOPSYS
  39.  
  40.   single-tree mode    
  41.     my $t= XML::Twig->new();
  42.     $t->parsefile( 'doc.xml');
  43.     $t->print;
  44.  
  45.   chunk mode 
  46.     # print the document, at most one full section is loaded in memory
  47.     my $t= XML::Twig->new( twig_handlers => { section => \&flush});
  48.     $t->parsefile( 'doc.xml');
  49.     $t->flush;
  50.     sub flush { (my $twig, $section)= @_; $twig->flush; }
  51.     
  52.   sub-tree mode 
  53.     # print all section title's in the document,
  54.     # all other elements are ignored (and not stored)
  55.     my $t= XML::Twig->new( 
  56.             twig_roots => { 'section/title' => sub { $_->print, "\n" } }
  57.                          );
  58.     $t->parsefile( 'doc.xml');
  59.     
  60. INSTALLATION
  61.  
  62.     perl Makefile.PL
  63.     make
  64.     make test
  65.     make install
  66.  
  67. DEPENDANCIES
  68.  
  69.     XML::Twig needs XML::Parser (and the expat library) installed
  70.    
  71.     Modules that can enhance XML::Twig are:
  72.  
  73.     Scalar::Util or WeakRef 
  74.       to avoid memory leaks
  75.     Encode or Text::Iconv or Unicode::Map8 and Unicode::Strings 
  76.       to do encoding conversions
  77.     Tie::IxHash 
  78.       to use the keep_atts_order option
  79.     XML::XPath 
  80.       to use XML::Twig::XPath
  81.     LWP 
  82.       to use parseurl
  83.     HTML::Entities
  84.       to use the html_encode filter
  85.  
  86. CHANGES
  87.  
  88.     $Id: README,v 1.11 2005/08/25 15:01:33 mrodrigu Exp $
  89.  
  90.     See the Changes file    
  91.  
  92. AUTHOR
  93.  
  94.     Michel Rodriguez (mirod@cpan.org)
  95.     The Twig page is at http://www.xmltwig.com/xmltwig
  96.     See the XML::Twig tutorial at http://www.xmltwig.com/xmltwig/tutorial/index.html
  97.  
  98. COPYRIGHT
  99.  
  100.        Copyright (c) 1999-2005, Michel Rodriguez. All Rights Reserved.
  101.        This library is free software; you can redistribute it and/or modify
  102.        it under the same terms as Perl itself.
  103.