Python & XML. XML Processing with Python - Helion
ISBN: 978-14-919-4885-9
stron: 380, Format: ebook
Data wydania: 2001-12-18
Księgarnia: Helion
Cena książki: 118,15 zł (poprzednio: 137,38 zł)
Oszczędzasz: 14% (-19,23 zł)
If you are a Python programmer who wants to incorporate XML into your skill set, this is the book for you. Python has attracted a wide variety of developers, who use it either as glue to connect critical programming tasks together, or as a complete cross-platform application development language. Yet, because it is object-oriented and has powerful text manipulation abilities, Python is an ideal language for manipulating XML.Python & XML gives you a solid foundation for using these two languages together. Loaded with practical examples, this new volume highlights common application tasks, so that you can learn by doing. The book starts with the basics then quickly progresses to complex topics, like transforming XML with XSLT, querying XML with XPath, and working with XML dialects and validation. It also explores the more advanced issues: using Python with SOAP and distributed web services, and using Python to create scalable streams between distributed applications (like databases and web servers).The book provides effective practical applications, while referencing many of the tools involved in XML processing and Python, and highlights cross-platform issues along with tasks relevant to enterprise computing. You will find ample coverage of XML flow analysis and details on ways in which you can transport XML through your network.Whether you are using Python as an application language, or as an administrative or middleware scripting language, you are sure to benefit from this book. If you want to use Python to manipulate XML, this is your guide.
Osoby które kupowały "Python & XML. XML Processing with Python", wybierały także:
- GraphQL. Kurs video. Buduj nowoczesne API w Pythonie 169,00 zł, (50,70 zł -70%)
- Receptura na Python. Kurs Video. 54 praktyczne porady dla programist 199,00 zł, (59,70 zł -70%)
- Podstawy Pythona z Minecraftem. Kurs video. Piszemy pierwsze skrypty 149,00 zł, (44,70 zł -70%)
- Twórz gry w Pythonie. Kurs video. Poznaj bibliotekę PyGame 249,00 zł, (74,70 zł -70%)
- Data Science w Pythonie. Kurs video. Algorytmy uczenia maszynowego 199,00 zł, (59,70 zł -70%)
Spis treści
Python & XML. XML Processing with Python eBook -- spis treści
- Python & XML
- Dedication
- A Note Regarding Supplemental Files
- Preface
- Audience
- Organization
- Conventions Used in This Book
- Using Code Examples
- How to Contact Us
- Acknowledgments
- 1. Python and XML
- Key Advantages of XML
- Application Neutrality
- Hierarchical Structure
- Platform Neutrality
- International Language Support
- The XML Specifications
- XML 1.0 Recommendation
- Namespaces in XML
- XML as a Foundation
- The Power of Python and XML
- Python Tools for XML
- The SAX and DOM APIs
- More Ways to Extract Information
- What Can We Do with It?
- Key Advantages of XML
- 2. XML Fundamentals
- XML Structure in a Nutshell
- Document Types and Schemas
- Document Type Definitions
- Alternate Schema Languages
- XML Schema
- TREX
- RELAX-NG
- Schematron
- Types of Conformance
- Physical Structures
- Constructing XML Documents
- Characters in XML Documents
- The ASCII character set
- The ISO-8859-1 character set
- UTF-8 Encoding
- Text, Character Data, and Markup
- Names
- Whitespace in Character Data
- End-of-Line Handling
- Language Identification
- The Document Prolog
- Start, End, and Empty Element Tags
- Quotes around attribute values
- Comments
- Processing Instructions
- CDATA Sections
- Characters in XML Documents
- Document Type Definitions
- Entity Declarations
- Element Type Declarations
- Content models
- Attribute Declarations
- Attribute data types
- Attribute values and constraints
- Canonical XML
- The Canonical XML Data Model
- Document Order
- Canonical XML Structure
- Going Beyond the XML Specification
- XML Namespaces
- Extracting Information Using XPath
- Using XLink to Link XML Documents
- Communicating with XML Protocols
- Replacing HTML with XHTML
- Transforming XML with XSLT
- 3. The Simple API for XML
- The Birth of SAX
- Understanding SAX
- Using SAX in an Application
- SAX Handler Objects
- ContentHandler
- ErrorHandler
- DTDHandler
- EntityResolver
- Other handler objects
- SAX Reader Objects
- Reading an Article
- Writing a Simple Handler
- Creating the Main Program
- Adding Intelligence
- Using the Additional Information
- Searching File Information
- Creating the Index Generator
- Creating the IndexFile class
- Running index.py
- Searching the Index
- Creating the Index Generator
- Building an Image Index
- Creating Thumbnail Images
- Creating thumbnails on Windows
- Implementing the SAXThumbs Handler
- Viewing Your Thumbnails
- Creating Thumbnail Images
- Converting XML to HTML
- The Generated Document
- The Conversion Handler
- Driving the Conversion Handler
- Advanced Parser Factory Usage
- Native Parser Interfaces
- Using PyExpat Directly
- 4. The Document Object Model
- The DOM Specifications
- Levels of the Specification
- Feature Specifications
- Understanding the DOM
- Python DOM Offerings
- Streamlining with Minidom
- Using Pulldom
- 4DOM: A Full Implementation
- Retrieving Information
- Getting a Document Object
- Loading a document using 4DOM
- Loading a document using minidom
- Determining a Nodes Type
- Getting a Nodes Children
- Getting a Nodes Siblings
- Extracting Elements by Name
- Examining NodeList Members
- Looking at Attributes
- Getting a Document Object
- Changing Documents
- Creating New Nodes
- Adding and Moving Nodes
- Removing Nodes
- Changing a Documents Structure
- Building a Web Application
- Preparing the Web Server
- Ensuring the scripts execution
- Enabling write permission
- The Web Application Structure
- The Article class
- The Storage class
- Implementing Site Logic
- The ArticleManager class
- Controlling the Application
- Preparing the Web Server
- Going Beyond SAX and DOM
- The DOM Specifications
- 5. Querying XML with XPath
- XPath at a Glance
- Where Is XPath Used?
- Location Paths
- An Example Document
- A Path Hosting Script
- Getting Character Data
- Specifying an Index
- Testing Descendent Nodes
- Testing Attributes
- Selecting Elements
- Additional Operators
- XPath Arithmetic Operators
- XPath Functions
- Working with Numbers
- Working with Strings
- Working with Nodes
- Compiling XPath Expressions
- 6. Transforming XML with XSLT
- The XSLT Specification
- XSLT Processors
- Defining Stylesheets
- Simplified Stylesheets
- Standalone Stylesheets
- Embedded Stylesheets
- Using XSLT from the Command Line
- XSLT Elements
- The Stylesheet Element
- Creating a Template Element
- Applying Templates
- Getting the Value of a Node
- Iterating over Elements
- A More Complex Example
- File Template
- Class Template
- Method Template
- Embedding XSLT Transformations in Python
- Creating the Source XML
- Creating a Simple Stylesheet
- Creating a Stylesheet with Edit Functions
- Creating the CGI Script
- Selecting a Mode
- Choosing a Technique
- 7. XML Validation and Dialects
- Working with DTDs
- Validating with the Internal DTD Subset
- Validating with an External DTD Subset
- Validation at Runtime
- The BillSummary Example
- The Flat File
- The Web Form
- Starting the CGI
- Conversion and Validation
- Converting text to XML
- Validating the XML
- Creating a validation handler
- Completing the CGI
- Defining success and error functions
- Converting the flat file to XML
- Validating the converted XML
- Displaying the XML
- Running the Application in a Browser
- Dialects, Frameworks, and Workflow
- What Does ebXML Offer?
- ebXML Document Structure
- Business Process and Modeling
- Phases of ebXML
- Working with DTDs
- 8. Python Internet APIs
- Connecting Web Sites
- Continuing Improvement
- Python to the Rescue
- Working with URLs
- Encoding URLs
- Quoting URLs
- Unquoting URLs
- Opening URLs
- Using FTP
- Retrieving URLs
- Connecting with HTTP
- HTTP Conversations
- Request Types
- Getting a Document with Python
- Building a Query String with httplib
- Baking Cookies for the Server
- Performing a POST Operation
- Creating a POST catcher
- Ensuring proper URL encoding
- Performing a POST with httplib
- Illustrating a complete POST operation
- Using the Server Classes
- BaseHTTPServer Module Classes
- Server Core Concepts
- Instantiating a server class
- Serving a GET
- Serving a POST
- Building a Complete Server
- Running a GET request
- Running a POST request
- Connecting Web Sites
- 9. Python, Web Services, and SOAP
- Python Web Services Support
- The Emerging SOAP Standard
- SOAP Messages
- Exchanging SOAP Messages
- Encoding SOAP Messages
- Constructing SOAP Envelopes
- SOAP packet requirements
- SOAP encoding style
- Using SOAP Headers
- SOAP Body Elements
- Error Message and SOAP Fault
- Fault element
- Fault codes
- SOAP Encoding Techniques
- SOAP Encoding Rules
- Simple Types
- Compound Types
- SOAP over HTTP
- The SOAPAction header
- SOAP HTTP responses
- SOAP for RPC
- Python SOAP Options
- Working with SOAPy
- Working with MSSOAP
- MSSOAP Serialization Basics
- Adding URIs and namespaces
- Creating the SOAP envelope
- Making the call
- Example SOAP Server and Client
- Requirements for Using MSSOAP
- Getting Microsoft SOAP Toolkit 2.0
- Making the samples web-visible
- Getting Python COM support
- Fixing MSSOAP with makepy.py
- Server Setup
- A Python SOAP Client
- Defining reusable basics
- Requirements for Using MSSOAP
- What About XML-RPC?
- 10. Python and Distributed Systems Design
- Sample Application and Flow Analysis
- Decoupling Application Systems
- Routing Adds Flexibility
- Routing Adds Scalability
- Understanding the Scope
- Building the Database
- Creating a Profiles Database
- Creating a Customer Table
- Populating the Database
- Building the Profiles Access Class
- The Interfaces
- Getting Profiles
- Connecting with the database
- Building the XML document
- Returning a DOM instead of a string
- Inserting and Deleting Profiles
- Inserting a profile
- Deleting a profile
- Updating Profiles
- The Complete CustomerProfile Class
- Creating an XML Data Store
- A Large XML File
- Creating an XML Access Object
- The interfaces
- Using the XMLOffer class
- Creating the XMLOffer class
- Retrieval methods
- Modification methods
- The XML Switch
- XML Architecture
- Core XML Switch Classes
- The XMLMessage Class
- XMLMessage format
- XMLMessage class
- XML message code architecture
- XMLMessage code listing
- The XML Switch Service
- The XML Switch Client
- Using postMsg.html to send back XML
- Using the XSC client
- Using the XSC API
- The XMLSwitchHandler Server Class
- XMLSwitchHandler code architecture
- XMLSwitchHandler listing
- Running the XML Switch
- A Web Application
- Connecting to a Web Service
- The Components
- The Topology
- The Code Architecture
- The CGI Functionality
- Extracting profile information
- Updating profile information
- Displaying all offers
- The Complete sp.py Listing
- Running the Site as a User
- Sample Application and Flow Analysis
- A. Installing Python and XML Tools
- Installing Python
- Windows
- Linux and Unix
- Installing PyXML
- Installing 4Suite
- Installing Python
- B. XML Definitions
- XML Definitions
- C. Python SAX API
- Convenience Functions
- XMLReader
- ContentHandler
- DTDHandler
- EntityResolver
- InputSource
- ErrorHandler
- DeclHandler
- LexicalHandler
- Locator
- SAX Exceptions
- D. Python DOM API
- DOMException
- DOMException
- DOMImplementation
- DOMImplementation
- DocumentFragment
- DocumentFragment
- Document
- Document
- Node
- Node
- NodeList
- NodeList
- NamedNodeMap
- NamedNodeMap
- CharacterData
- CharacterData
- Attr
- Attr
- Element
- Element
- Text
- Text
- Comment
- Comment
- CDATASection
- CDATASection
- DocumentType
- DocumentType
- Notation
- Notation
- Entity
- Entity
- EntityReference
- EntityReference
- ProcessingInstruction
- ProcessingInstruction
- 4DOM Extensions
- DOMException
- E. Working with MSXML3.0
- Setting Up MSXML3.0
- Basic DOM Operations
- MSXML Nodes
- Using a NodeList
- MSXML3.0 Support for XSLT
- Source XML
- XSL Stylesheet
- Running an MSXML Transformation
- Handling Parsing Errors
- MSXML3.0 Reference
- MSXML3.0 Document Object
- MSXML3.0 Node Object
- MSXML3.0 NamedNodeMap Object
- MSXML3.0 NodeList Object
- MSXML3.0 ParseError Object
- F. Additional Python XML Tools
- Pyxie
- Python XML Tools
- XML Schema Validator
- Sab-pyth
- Redfoot
- XML Components for Zope
- Parsed XML
- Page Templates
- Online Resources
- Index
- Colophon
- Copyright