Class: NSXMLParser
Overview
Instances of this class parse XML documents (including DTD declarations) in an event-driven manner. An NSXMLParser notifies its delegate about the items (elements, attributes, CDATA blocks, comments, and so on) that it encounters as it processes an XML document. It does not itself do anything with those parsed items except report them. It also reports parsing errors. For convenience, an NSXMLParser object in the following descriptions is sometimes referred to as a parser object.
Instance Method Summary (collapse)
-
- abortParsing
Stops the parser object.
-
- columnNumber
Returns the column number of the XML document being processed by the receiver.
-
- delegate
Returns the receiver’s delegate.
-
- initWithContentsOfURL:
Initializes the receiver with the XML content referenced by the given URL.
-
- initWithData:
Initializes the receiver with the XML contents encapsulated in a given data object.
-
- initWithStream:
Initializes the receiver with the XML contents from the specified stream and parses it..
-
- lineNumber
Returns the line number of the XML document being processed by the receiver.
-
- parse
Starts the event-driven parsing operation.
-
- parserError
Returns an NSError object from which you can obtain information about a parsing error.
-
- publicID
Returns the public identifier of the external entity referenced in the XML document.
-
- setDelegate:
Sets the receiver’s delegate.
-
- setShouldProcessNamespaces:
Specifies whether the receiver reports the namespace and the qualified name of an element in related delegation methods .
-
- setShouldReportNamespacePrefixes:
Specifies whether the receiver reports the scope of namespace declarations using related delegation methods.
-
- setShouldResolveExternalEntities:
Specifies whether the receiver reports declarations of external entities using the delegate method parser:foundExternalEntityDeclarationWithName:publicID:systemID:.
-
- shouldProcessNamespaces
Indicates whether the receiver reports the namespace and the qualified name of an element in related delegation methods.
-
- shouldReportNamespacePrefixes
Indicates whether the receiver reports the prefixes indicating the scope of namespace declarations using related delegation methods.
-
- shouldResolveExternalEntities
Indicates whether the receiver reports declarations of external entities using the delegate method parser:foundExternalEntityDeclarationWithName:publicID:systemID:.
-
- systemID
Returns the system identifier of the external entity referenced in the XML document.
Methods inherited from NSObject
#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version
Constructor Details
This class inherits a constructor from NSObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class NSObject
Instance Method Details
- (Object) abortParsing
Stops the parser object. If you invoke this method, the delegate, if it implements parser:parseErrorOccurred:, is informed of the cancelled parsing operation.
- (Integer) columnNumber
Returns the column number of the XML document being processed by the receiver. The column refers to the nesting level of the XML elements in the document. You may invoke this method once a parsing operation has begun or after an error occurs.
- (Object) delegate
Returns the receiver’s delegate.
- (Object) initWithContentsOfURL(url)
Initializes the receiver with the XML content referenced by the given URL.
- (Object) initWithData(data)
Initializes the receiver with the XML contents encapsulated in a given data object. This method is the designated initializer.
- (Object) initWithStream(stream)
Initializes the receiver with the XML contents from the specified stream and parses it..
- (Integer) lineNumber
Returns the line number of the XML document being processed by the receiver. You may invoke this method once a parsing operation has begun or after an error occurs.
- (Boolean) parse
Starts the event-driven parsing operation.
- (NSError) parserError
Returns an NSError object from which you can obtain information about a parsing error. You may invoke this method after a parsing operation abnormally terminates to determine the cause of error.
- (String) publicID
Returns the public identifier of the external entity referenced in the XML document. You may invoke this method once a parsing operation has begun or after an error occurs.
- (Object) setDelegate(delegate)
Sets the receiver’s delegate.
- (Object) setShouldProcessNamespaces(shouldProcessNamespaces)
Specifies whether the receiver reports the namespace and the qualified name of an element in related delegation methods . The invoked delegation methods are parser:didStartElement:namespaceURI:qualifiedName:attributes: and parser:didEndElement:namespaceURI:qualifiedName:.
- (Object) setShouldReportNamespacePrefixes(shouldReportNamespacePrefixes)
Specifies whether the receiver reports the scope of namespace declarations using related delegation methods. The invoked delegation methods are parser:didStartMappingPrefix:toURI: and parser:didEndMappingPrefix:.
- (Object) setShouldResolveExternalEntities(shouldResolveExternalEntities)
Specifies whether the receiver reports declarations of external entities using the delegate method parser:foundExternalEntityDeclarationWithName:publicID:systemID:. If you pass in YES, you may cause other I/O operations, either network-based or disk-based, to load the external DTD.
- (Boolean) shouldProcessNamespaces
Indicates whether the receiver reports the namespace and the qualified name of an element in related delegation methods. The invoked delegation methods are parser:didStartElement:namespaceURI:qualifiedName:attributes: and parser:didEndElement:namespaceURI:qualifiedName:.
- (Boolean) shouldReportNamespacePrefixes
Indicates whether the receiver reports the prefixes indicating the scope of namespace declarations using related delegation methods. The invoked delegation methods are parser:didStartMappingPrefix:toURI: and parser:didEndMappingPrefix:.
- (Boolean) shouldResolveExternalEntities
Indicates whether the receiver reports declarations of external entities using the delegate method parser:foundExternalEntityDeclarationWithName:publicID:systemID:.
- (String) systemID
Returns the system identifier of the external entity referenced in the XML document. You may invoke this method once a parsing operation has begun or after an error occurs.