High-Level Parser API

The high-level parser API provides a very simple method for reading XML data. One call to the function CFXMLTreeCreateFromData reads an entire XML document--specified by a pointer to XML data in memory, or by a URL string--and returns the XML data to you in the form of a CFXMLTree. A CFXMLTree is simply a CFTree that contains a pointer to a CFXMLNode in each node's context. See the chapter Core Foundation Collection Services for more information about CFTree and its API.

Once the CFXMLTree has been created, you can use the CFTree API to examine the tree and extract information from a given node. XML Services also provides convenience functions that make it even easier to access the content of a CFXMLTree. For example, CFXMLTreeGetNode takes a reference to one of the tree's nodes and returns a pointer to that node's CFXMLNode.

The section Using the High-Level Parser Interface shows you how to parse an XML document using the high-level parser API.


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