Deprecated CFXMLParser Functions

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

Deprecated in OS X v10.8

CFXMLParserAbort

Causes a parser to abort with the given error code and description. (Deprecated in OS X v10.8.)

void CFXMLParserAbort (
   CFXMLParserRef parser,
   CFXMLParserStatusCode errorCode,
   CFStringRef errorDescription
);
Parameters
parser

The parser to abort.

errorCode

The error code to return to the parser.

errorDescription

The error description string to return to the parser. This value may not be NULL.

Discussion

This function cannot be called asynchronously. In other words, it must be called from within a parser callback function.

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

CFXMLParserCopyErrorDescription

Returns the user-readable description of the current error condition. (Deprecated in OS X v10.8.)

CFStringRef CFXMLParserCopyErrorDescription (
   CFXMLParserRef parser
);
Parameters
parser

The XML parser to examine.

Return Value

A user-readable description of the current error condition, or NULL if no error occurred. Ownership follows the Create Rule.

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

CFXMLParserCreate

Creates a new XML parser for the specified XML data. (Deprecated in OS X v10.8.)

CFXMLParserRef CFXMLParserCreate (
   CFAllocatorRef allocator,
   CFDataRef xmlData,
   CFURLRef dataSource,
   CFOptionFlags parseOptions,
   CFIndex versionOfNodes,
   CFXMLParserCallBacks *callBacks,
   CFXMLParserContext *context
);
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 to parse. Do not pass NULL.

dataSource

The URL from which the XML data was 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.

callBacks

Callbacks called by the parser as the XML is processed. The callbacks are called as each XML tag is encountered, when an external entity needs to be resolved, and when an error occurs. See CFXMLParserCallBacks and the individual callbacks for more details. Do not pass NULL.

context

Determines what, if any, information pointer is passed to the callbacks as the parse progresses; context may be NULL.

Return Value

The newly created parser. Ownership follows the Create Rule.

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

CFXMLParserCreateWithDataFromURL

Creates a new XML parser for the specified XML data at the specified URL. (Deprecated in OS X v10.8.)

CFXMLParserRef CFXMLParserCreateWithDataFromURL (
   CFAllocatorRef allocator,
   CFURLRef dataSource,
   CFOptionFlags parseOptions,
   CFIndex versionOfNodes,
   CFXMLParserCallBacks *callBacks,
   CFXMLParserContext *context
);
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 to load the XML data. The URL is used to resolve any relative references found in XML Data. It must be a valid CFURL object; NULL is an unacceptable value.

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.

callBacks

Callbacks called by the parser as the XML is processed. The callbacks are called as each XML tag is encountered, when an external entity needs to be resolved, and when an error occurs. See CFXMLParserCallBacks and the individual callbacks for more details. Do not pass NULL.

context

Determines what, if any, information pointer is passed to the callbacks as the parse progresses; may be NULL.

Return Value

The newly created parser. Ownership follows the Create Rule.

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

CFXMLParserGetCallBacks

Returns the callbacks associated with an XML parser when it was created. (Deprecated in OS X v10.8.)

void CFXMLParserGetCallBacks (
   CFXMLParserRef parser,
   CFXMLParserCallBacks *callBacks
);
Parameters
parser

The XML parser to examine.

callBacks

On return, contains the callbacks for parser.

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

CFXMLParserGetContext

Returns the context for an XML parser. (Deprecated in OS X v10.8.)

void CFXMLParserGetContext (
   CFXMLParserRef parser,
   CFXMLParserContext *context
);
Parameters
parser

The XML parser to examine.

context

On return, a pointer to the context structure for parser.

Discussion

If you set a context for the parser, it will be passed to you as a parameter in each of the parser callback functions. The context data structure is application defined and associated with a parser using one of the CFXMLParserCreate... functions.

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

CFXMLParserGetDocument

Returns the top-most object returned by the create XML structure callback. (Deprecated in OS X v10.8.)

void *CFXMLParserGetDocument (
   CFXMLParserRef parser
);
Parameters
parser

The XML parser to examine.

Return Value

The top-most object returned by the createXMLStructure field in the CFXMLParserCallBacks structure. If the returned value is a Core Foundation object, ownership follows the Get Rule.

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

CFXMLParserGetLineNumber

Returns the line number of the current parse location. (Deprecated in OS X v10.8.)

CFIndex CFXMLParserGetLineNumber (
   CFXMLParserRef parser
);
Parameters
parser

The XML parser to examine.

Return Value

The line number of the current location.

Discussion

This function is typically used in conjunction with the CFXMLParserHandleErrorCallBack function so that error location information can be reported.

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

CFXMLParserGetLocation

Returns the character index of the current parse location. (Deprecated in OS X v10.8.)

CFIndex CFXMLParserGetLocation (
   CFXMLParserRef parser
);
Parameters
parser

The XML parser to examine.

Return Value

The character index of the current parse location.

Discussion

This function is typically used in conjunction with the CFXMLParserHandleErrorCallBack function so that error location information can be reported.

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

CFXMLParserGetSourceURL

Returns the URL for the XML data being parsed. (Deprecated in OS X v10.8.)

CFURLRef CFXMLParserGetSourceURL (
   CFXMLParserRef parser
);
Parameters
parser

The XML parser to examine.

Return Value

The URL for the XML document being parsed. Ownership follows the Get Rule.

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

CFXMLParserGetStatusCode

Returns a numeric code indicating the current status of the parser. (Deprecated in OS X v10.8.)

CFXMLParserStatusCode CFXMLParserGetStatusCode (
   CFXMLParserRef parser
);
Parameters
parser

The XML parser to examine.

Return Value

A status code indicating the current parser. See Parser Status Codes for a list of possible status codes.

Discussion

If an error has occurred, the code for the last error is returned. If no error has occurred, a status code is returned.

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

CFXMLParserGetTypeID

Returns the type identifier for the CFXMLParser opaque type. (Deprecated in OS X v10.8.)

CFTypeID CFXMLParserGetTypeID ();
Return Value

The type identifier for the CFXMLParser opaque type.

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

CFXMLParserParse

Begins a parse of the XML data that was associated with the parser when it was created. (Deprecated in OS X v10.8.)

Boolean CFXMLParserParse (
   CFXMLParserRef parser
);
Parameters
parser

The XML parser to start.

Return Value

true if the parse was successful, false otherwise.

Discussion

Upon success, use the CFXMLParserGetDocument function to get the product of the parse. Upon failure, use the CFXMLParserGetContext or CFXMLParserCopyErrorDescription functions to get information about the error. It is an error to call the CFXMLParserParse function while a parse is already underway.

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

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