RKXMLParserXMLReader Class Reference
Inherits from | NSObject |
Conforms to | RKParser |
Declared in | RKXMLParserXMLReader.h RKXMLParserXMLReader.m |
Overview
Provides a basic XML implementation using an adapted version of the XMLReader class by “Insert-Witty-Name” available at: https://github.com/RestKit/XML-to-NSDictionary
RKXMLParserXMLReader will parse an XML document into an NSDictionary representation suitable for use with RestKit’s key-value coding based object mapping implementation.
XML attributes are represented as keys in a dictionary.
NOTE When an XML tag is parsed containing both XML attributes and
an enclosed text node, the value of the text node will be inserted in
the parsed dictionary at the @"text"
key.
Tasks
-
– objectFromString:error:
Returns an object representation of the source string encoded in the format provided by the parser (i.e. JSON, XML, etc).
-
– stringFromObject:error:
Returns a string representation encoded in the format provided by the parser (i.e. JSON, XML, etc) for the given object.
Instance Methods
objectFromString:error:
Returns an object representation of the source string encoded in the format provided by the parser (i.e. JSON, XML, etc).
- (id)objectFromString:(NSString *)string error:(NSError **)error
Parameters
- string
The string representation of the object to be parsed.
- error
A pointer to an NSError object.
Return Value
The parsed object or nil if an error occurred during parsing.
Declared In
RKParser.h
stringFromObject:error:
Returns a string representation encoded in the format provided by the parser (i.e. JSON, XML, etc) for the given object.
- (NSString *)stringFromObject:(id)object error:(NSError **)error
Parameters
- object
The object to be serialized.
- A
pointer to an NSError object.
Return Value
A string representation of the serialized object or nil if an error occurred.
Declared In
RKParser.h