Synopses & Reviews
XML is a text-based markup language that has taken the programming world by storm. More powerful than HTML yet less demanding than SGML, XML has proven itself to be flexible and resilient. XML is the perfect tool for formatting documents with even the smallest bit of complexity, from Web pages to legal contracts to books. However, XML has also proven itself to be indispensable for organizing and conveying other sorts of data as well, thus its central role in web services like SOAP and XML-RPC.
As the Perl programming language was tailor-made for manipulating text, few people have disputed the fact that Perl and XML are perfectly suited for one another. The only question has been what's the best way to do it. That's where this book comes in.
Perl & XML is aimed at Perl programmers who need to work with XML documents and data. The book covers all the major modules for XML processing in Perl, including XML::Simple, XML::Parser, XML::LibXML, XML::XPath, XML::Writer, XML::Pyx, XML::Parser::PerlSAX, XML::SAX, XML::SimpleObject, XML::TreeBuilder, XML::Grove, XML::DOM, XML::RSS, XML::Generator::DBI, and SOAP::Lite. But this book is more than just a listing of modules; it gives a complete, comprehensive tour of the landscape of Perl and XML, making sense of the myriad of modules, terminology, and techniques.
This book covers:
-
parsing XML documents and writing them out again
-
working with event streams and SAX
-
tree processing and the Document Object Model
-
advanced tree processing with XPath and XSLT
Most valuably, the last two chapters of
Perl & XML give complete examples of XML applications, pulling together all the tools at your disposal. All together, Perl & XML is the single book that gives you a solid grounding in XML processing with Perl.
Synopsis
"Perl & XML is aimed at Perl programmers who need to work with XML documents and data. The book covers all the major modules for XML processing in Perl. But this book is more than just a listing of modules; it gives a complete, comprehensive tour of the landscape of Perl and XML, making sense of the myriad of modules, terminology, and techniques.This book covers: parsing XML documents and writing them out againworking with event streams and SAXtree processing and the Document Object Modeladvanced tree processing with XPath and XSLTMost valuably, the last two chapters of "Perl & XML give complete examples of XML applications, pulling together all the tools at your disposal. All together, Perl and XML is the single book that gives you a solid grounding in XML processing with Perl.
Synopsis
This guide provides the reader with a thorough description of how to use the Perl programming language to process XML data. It begins with a brief tutorial, and then focuses on the fundamentals of processing XML using Perl.
About the Author
Erik T. Ray has worked for O'Reilly Media, Inc. as a software developer and XML specialist since 1995. He helped to establish a complete publishing solution using DocBook-XML and Perl to produce books in print, on CD-ROM, and for the new Safari web library of books. As the author of the O'Reilly best seller Learning XML and numerous articles to technical journals, Erik is known for his clear and entertaining writing style. When not hammering out code, he enjoys playing card games, reading about hemorrhagic fevers, practicing Buddhist meditation, and collecting toys. He lives in Saugus, MA with his wife Jeannine and 7 parrots.
Table of Contents
Preface; Assumptions; How This Book Is Organized; Resources; Font Conventions; How to Contact Us; Acknowledgments; Chapter 1: Perl and XML; 1.1 Why Use Perl with XML?; 1.2 XML Is Simple with XML::Simple; 1.3 XML Processors; 1.4 A Myriad of Modules; 1.5 Keep in Mind...; 1.6 XML Gotchas; Chapter 2: An XML Recap; 2.1 A Brief History of XML; 2.2 Markup, Elements, and Structure; 2.3 Namespaces; 2.4 Spacing; 2.5 Entities; 2.6 Unicode, Character Sets, and Encodings; 2.7 The XML Declaration; 2.8 Processing Instructions and Other Markup; 2.9 Free-Form XML and Well-Formed Documents; 2.10 Declaring Elements and Attributes; 2.11 Schemas; 2.12 Transformations; Chapter 3: XML Basics: Reading and Writing; 3.1 XML Parsers; 3.2 XML::Parser; 3.3 Stream-Based Versus Tree-Based Processing; 3.4 Putting Parsers to Work; 3.5 XML::LibXML; 3.6 XML::XPath; 3.7 Document Validation; 3.8 XML::Writer; 3.9 Character Sets and Encodings; Chapter 4: Event Streams; 4.1 Working with Streams; 4.2 Events and Handlers; 4.3 The Parser as Commodity; 4.4 Stream Applications; 4.5 XML::PYX; 4.6 XML::Parser; Chapter 5: SAX; 5.1 SAX Event Handlers; 5.2 DTD Handlers; 5.3 External Entity Resolution; 5.4 Drivers for Non-XML Sources; 5.5 A Handler Base Class; 5.6 XML::Handler::YAWriter as a Base Handler Class; 5.7 XML::SAX: The Second Generation; Chapter 6: Tree Processing; 6.1 XML Trees; 6.2 XML::Simple; 6.3 XML::Parser's Tree Mode; 6.4 XML::SimpleObject; 6.5 XML::TreeBuilder; 6.6 XML::Grove; Chapter 7: DOM; 7.1 DOM and Perl; 7.2 DOM Class Interface Reference; 7.3 XML::DOM; 7.4 XML::LibXML; Chapter 8: Beyond Trees: XPath, XSLT, and More; 8.1 Tree Climbers; 8.2 XPath; 8.3 XSLT; 8.4 Optimized Tree Processing; Chapter 9: RSS, SOAP, and Other XML Applications; 9.1 XML Modules; 9.2 XML::RSS; 9.3 XML Programming Tools; 9.4 SOAP::Lite; Chapter 10: Coding Strategies; 10.1 Perl and XML Namespaces; 10.2 Subclassing; 10.3 Converting XML to HTML with XSLT; 10.4 A Comics Index; Colophon;