XML Processing with Python.pdf

(2059 KB) Pobierz
Python & XML
Christopher A. Jones
Fred L. Drake, Jr.
Publisher: O'Reilly
First Edition January 2002
ISBN: 0-596-00128-2, 384 pages
Python is an ideal language for manipulating XML, and this new
volume gives you a solid foundation for using these two languages
together. Complete with practical examples that highlight common
application tasks, the book starts with the basics then quickly
progresses to complex topics like transforming XML with XSLT
and querying XML with XPath. It also explores more advanced
subjects, such as SOAP and distributed web services.
Copyright © 2002 O'Reilly & Associates, Inc. All rights reserved.
Printed in the United States of America.
Published by O'Reilly & Associates, Inc., 1005 Gravenstein
Highway North, Sebastopol, CA 95472.
O'Reilly & Associates books may be purchased for educational,
business, or sales promotional use. Online editions are also
available for most titles (http://safari.oreilly.com). For more
information contact our corporate/institutional sales department:
800-998-9938 or
corporate@oreilly.com.
Nutshell Handbook, the Nutshell Handbook logo, and the
O'Reilly logo are registered trademarks of O'Reilly & Associates,
Inc. Many of the designations used by manufacturers and sellers
to distinguish their products are claimed as trademarks. Where
those designations appear in this book, and O'Reilly &
Associates, Inc. was aware of a trademark claim, the
designations have been printed in caps or initial caps. The
association between the image of elephant shrews and Python
and XML is a trademark of O'Reilly & Associates, Inc.
While every precaution has been taken in the preparation of this
book, the publisher assumes no responsibility for errors or
omissions, or for damages resulting from the use of the
information contained herein.
IT-SC book
1
Dedication
Preface
Audience
Organization
Conventions Used in This Book
How to Contact Us
Acknowledgments
1. Python and XML
1.1 Key Advantages of XML
1.2 The XML Specifications
1.3 The Power of Python and XML
1.4 What Can We Do with It?
2. XML Fundamentals
2.1 XML Structure in a Nutshell
2.2 Document Types and Schemas
2.3 Types of Conformance
2.4 Physical Structures
2.5 Constructing XML Documents
2.6 Document Type Definitions
2.7 Canonical XML
2.8 Going Beyond the XML Specification
3. The Simple API for XML
3.1 The Birth of SAX
3.2 Understanding SAX
3.3 Reading an Article
3.4 Searching File Information
3.5 Building an Image Index
3.6 Converting XML to HTML
3.7 Advanced Parser Factory Usage
3.8 Native Parser Interfaces
4. The Document Object Model
4.1 The DOM Specifications
4.2 Understanding the DOM
4.3 Python DOM Offerings
4.4 Retrieving Information
4.5 Changing Documents
4.6 Building a Web Application
4.7 Going Beyond SAX and DOM
5. Querying XML with XPath
5.1 XPath at a Glance
5.2 Where Is XPath Used?
5.3 Location Paths
5.4 XPath Arithmetic Operators
5.5 XPath Functions
5.6 Compiling XPath Expressions
2
IT-SC book
Zgłoś jeśli naruszono regulamin