Contents

Introduction to Event-Driven XML Programming Guide for Cocoa

Explains how to process XML documents using the Cocoa streaming parser.

Organization of This Document

This programming topic includes the following articles:

Parser Capabilities and Architecture gives an overview of how the Cocoa streaming parser (NSXMLParser) processes an XML document and what kinds of tasks it is best suited for.

XML Parsing Basics describes the essential steps for using NSXMLParser: creating and initializing the instance, responding to delegation messages, and handling parsing errors.

Handling XML Elements and Attributes offers suggestions and examples for handling XML attributes and elements, the most common kinds of XML constructs.

Handling Parsing Errors describes how to handle errors that the NSXMLParser object finds in the XML.

Using Multiple Delegates discusses the technique of using multiple delegates of the NSXMLParser instance to simplify and streamline XML processing.

Constructing XML Tree Structures gives some suggestions for creating DOM-style trees using NSXMLParser.

Validation Tips and Techniques offers suggestions for using NSXMLParser when validating an XML document against its DTD or other schema.

XML Glossary lists definitions of XML and DTD terms that are part of the NSXMLParser programmatic interface.

See Also

There are many websites that are rich sources of information on XML, DTD, XML tools, open-source parsers, and related specifications and technologies. A few of them are listed below, but a search of the Internet (with, for example, “XML tutorial” in the search field) will find many excellent sources of information:

World Wide Web Consortium — http://www.w3.org/

The Annotated XML Specification — http://www.xml.com/axml/testaxml.htm

O’Reilly XML.com — http://www.xml.com/

The XML parser and toolkit of Gnome (libxml) — http://xmlsoft.org/

Next

Copyright © 2004, 2010 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2010-03-24