XML Parsers

In computing terms, a parser is a program that takes input in the form of sequential instructions, tags, or some other defined sequence of tokens, and breaks them up into easily manageable parts. An XML parser is designed to read and, in a sense, interpret XML documents. As it executes, the parser recognizes and responds to each XML structure it encounters by taking some specified action based on the structure type. XML parsers typically convert an XML document into a tree structure that reflects the containment hierarchy of the XML data. This tree is then made available to your application, which is free to interpret and modify the data as appropriate.

There are two types of XML parsers, validating and nonvalidating. Validating parsers check a document's contents against a set of specific rules stating what elements are allowed in a document and in what order they must appear. These rules appear in an XML document as an optional XML structure called a document type definition, or DTD. Nonvalidating parsers are smaller and faster, but they don't check documents against the DTD; they only that the document is structurally well-formed.


© 2000 Apple Computer, Inc. (Last Updated 14 July 2000)