Deprecated CFXMLTree Functions

A function identified as deprecated has been superseded and may become unsupported in the future.

Deprecated in OS X v10.8

CFXMLTreeCreateFromData

Parses the given XML data and returns the resulting CFXMLTree object. (Deprecated in OS X v10.8.)

CFXMLTreeRef CFXMLTreeCreateFromData (
   CFAllocatorRef allocator,
   CFDataRef xmlData,
   CFURLRef dataSource,
   CFOptionFlags parseOptions,
   CFIndex versionOfNodes
);
Parameters
allocator

The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.

xmlData

The XML data you wish to parse.

dataSource

The URL from which the XML data was obtained. The URL is used to resolve any relative references found in xmlData. Pass NULL if a valid URL is unavailable.

parseOptions

Flags which control how the XML data will be parsed. See Parsing Options for the list of available options.

versionOfNodes

Determines which version of CFXMLNode objects are produced by the parser.

Return Value

A new CFXMLTree object containing the data from the specified XML document. Ownership follows the Create Rule.

Discussion

This function represents the high-level interface to the XML parser. This single function creates a parser for the specified XML data using the specified options. The parser creates and returns a CFXMLTree object that you can examine and modify with the CFTree functions or obtain the node using the CFXMLTreeGetNode function and examine its attributes using CFXMLNode functions.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
CFXMLParser.h

CFXMLTreeCreateFromDataWithError

Parses the given XML data and returns the resulting CFXMLTree object and any error information. (Deprecated in OS X v10.8.)

CFXMLTreeRef CFXMLTreeCreateFromDataWithError (
   CFAllocatorRef allocator,
   CFDataRef xmlData,
   CFURLRef dataSource,
   CFOptionFlags parseOptions,
   CFIndex versionOfNodes
   CFDictionaryRef *errorDict
);
Parameters
allocator

The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.

xmlData

The XML data you wish to parse.

dataSource

The URL from which the XML data was obtained. The URL is used to resolve any relative references found in xmlData. Pass NULL if a valid URL is unavailable.

parseOptions

Flags which control how the XML data will be parsed. See Parsing Options for the list of available options.

versionOfNodes

Determines which version of CFXMLNode objects are produced by the parser. The current version is 1.

errorDict

Upon return, if an error occurs contains a CFDictionary object that describes the error. If no errors occur, this parameter is not changed. Pass NULL if you don’t want error information. See “Error Dictionary Keys” for a description of the key-value pairs in this dictionary. Ownership follows the Create Rule.

Return Value

A new CFXMLTree object containing the data from the specified XML document. Ownership follows the Create Rule.

Discussion

Use this function instead of CFXMLTreeCreateFromData if you need access to XML parsing errors.

Availability
  • Available in OS X v10.3 and later.
  • Deprecated in OS X v10.8.
Declared In
CFXMLParser.h

CFXMLTreeCreateWithDataFromURL

Creates a new CFXMLTree object by loading the data to be parsed directly from a data source. (Deprecated in OS X v10.8.)

CFXMLTreeRef CFXMLTreeCreateWithDataFromURL (
   CFAllocatorRef allocator,
   CFURLRef dataSource,
   CFOptionFlags parseOptions,
   CFIndex versionOfNodes
);
Parameters
allocator

The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.

dataSource

The URL from which the XML data is obtained. The URL is used to resolve any relative references found in XML Data. Pass NULL if a valid URL is unavailable.

parseOptions

Flags which control how the XML data will be parsed. See Parsing Options for the list of available options.

versionOfNodes

Determines which version of CFXMLNode objects are produced by the parser.

Return Value

A new CFXMLTree object containing the data from the specified XML data source. Ownership follows the Create Rule.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
CFXMLParser.h

CFXMLTreeCreateWithNode

Creates a childless, parentless CFXMLTree object node for a CFXMLNode object. (Deprecated in OS X v10.8.)

CFXMLTreeRef CFXMLTreeCreateWithNode (
   CFAllocatorRef allocator,
   CFXMLNodeRef node
);
Parameters
allocator

The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.

node

The CFXMLNode object to use when creating the new CFXMLTree object.

Return Value

A CFXMLTree object. Ownership follows the Create Rule.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
CFXMLNode.h

CFXMLTreeCreateXMLData

Generates an XML document from a CFXMLTree object which is ready to be written to permanent storage. (Deprecated in OS X v10.8.)

CFDataRef CFXMLTreeCreateXMLData (
   CFAllocatorRef allocator,
   CFXMLTreeRef xmlTree
);
Parameters
allocator

The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.

xmlTree

The CFXMLTree object you wish to convert to an XML document.

Return Value

The XML data. Ownership follows the Create Rule.

Discussion

This function will not regenerate entity references replaced at the parse time (except those required for syntactic correctness). If you need this you must manually walk the tree and re-insert any entity references that should appear in the final output file.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
CFXMLParser.h

CFXMLTreeGetNode

Returns the node of a CFXMLTree object. (Deprecated in OS X v10.8.)

CFXMLNodeRef CFXMLTreeGetNode (
   CFXMLTreeRef xmlTree
);
Parameters
xmlTree

The CFXMLTree object whose node you wish to obtain.

Return Value

The node of xmlTree. Ownership follows the Get Rule.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.8.
Declared In
CFXMLNode.h

Did this document help you? Yes It's good, but... Not helpful...