Up
Authors
- Generated by fedor
-
- Declared in:
- Foundation/NSXMLNode.h
- Conforms to:
- NSCopying
Availability: OpenStep
The most primitive unit in an XML document.
Instance Variables
Method summary
+ (id)
DTDNodeWithXMLString: (
NSString*)string;
Availability: OpenStep
Creates and returns a DTD node from the supplied
string. The node might describe element,
attribute, entity, or notation.
+ (id)
attributeWithName: (
NSString*)name
URI: (
NSString*)URI
stringValue: (
NSString*)stringValue;
Availability: OpenStep
Creates and returns an attribute node with the
specified (fully qualified) name,
namespace URI, and value.
+ (id)
attributeWithName: (
NSString*)name
stringValue: (
NSString*)stringValue;
Availability: OpenStep
Creates and returns an attribute node with the
specified name and value.
+ (id)
commentWithStringValue: (
NSString*)stringValue;
Availability: OpenStep
Creates and returns a comment node with the
supplied text.
+ (id)
document;
Availability: OpenStep
Creates and returns an empty document...
convenience method.
+ (id)
documentWithRootElement: (
NSXMLElement*)element;
Availability: OpenStep
Creates and returns a new document intialised with
the supplied root node.
+ (id)
elementWithName: (
NSString*)name;
Availability: OpenStep
Creates and returns a node node with the specified
name.
+ (id)
elementWithName: (
NSString*)name
URI: (
NSString*)URI;
Availability: OpenStep
Creates and returns a node with the supplied (fully
qualified name) an namespace
URI.
+ (id)
elementWithName: (
NSString*)name
children: (
NSArray*)children
attributes: (
NSArray*)attributes;
Availability: OpenStep
Creates and returns a node containing the supplied
child nodes and with the attribute nodes from the
supplied array.
+ (id)
elementWithName: (
NSString*)name
stringValue: (
NSString*)string;
Availability: OpenStep
Creates and returns a node with the pecified
name and with a single text node
(containing string) as its content.
+ (
NSString*)
localNameForName: (
NSString*)name;
Availability: OpenStep
Strips any leading namespace prefix from
name and returns the result.
+ (id)
namespaceWithName: (
NSString*)name
stringValue: (
NSString*)stringValue;
Availability: OpenStep
Creates and returns a node mapping the supplkied
namespace name to the string value
(URI).
+ (
NSXMLNode*)
predefinedNamespaceForPrefix: (
NSString*)name;
Availability: OpenStep
Returns the namespace node corresponding to a
predefined namespace names (one of xml, xs, or
xsi)
+ (
NSString*)
prefixForName: (
NSString*)name;
Availability: OpenStep
Returns the namespace prefix of name.
+ (id)
processingInstructionWithName: (
NSString*)name
stringValue: (
NSString*)stringValue;
Availability: OpenStep
Creates and return a processinc insruction node
with th specified name and textual value.
+ (id)
textWithStringValue: (
NSString*)stringValue;
Availability: OpenStep
Creates and returns a simple text node.
- (
NSString*)
URI;
Availability: OpenStep
Returns the URI of the receiver.
- (
NSString*)
XMLString;
Availability: OpenStep
Returns the text of the receiver as XML (ie in the
form it would have in an XML document).
- (
NSString*)
XMLStringWithOptions: (
NSUInteger)theOptions;
Availability: OpenStep
Returns the text of the receiver as XML (ie in the
form it would have in an XML document), with the
specified options controlling it.
- (
NSString*)
XPath;
Availability: OpenStep
Returns the XPath string to access the receiver
with the document.
- (
NSString*)
canonicalXMLStringPreservingComments: (BOOL)comments;
Availability: OpenStep
Returns the canonical form (see
http://www.w3.org/TR/xml-c14n)
of the receiveri as long as the
NSXMLNodePreserveWhitespace has
been set. If the option as not been set, return the
same without white space preserved.
- (
NSXMLNode*)
childAtIndex: (
NSUInteger)index;
Availability: OpenStep
Returns the child node if the receiver at the
specified index.
- (
NSUInteger)
childCount;
Availability: OpenStep
Returns the number of immediate child nodes of the
receiver.
This method is more efficient
than getting the array of children and counting it.
- (
NSArray*)
children;
Availability: OpenStep
Returns n array containing the immediate child
nodes of the receiver.
- (void)
detach;
Availability: OpenStep
Detaches the receiver from its parent node.
- (
NSUInteger)
index;
Availability: OpenStep
Return the index of the receiver within its parent
node.
- (id)
initWithKind: (
NSXMLNodeKind)theKind;
Availability: OpenStep
Initialises the receiver as a specific kind of
node.
Calls
-initWithKind:options:
using NSXMLNodeOptionsNone and returns the result.
- (id)
initWithKind: (
NSXMLNodeKind)theKind
options: (
NSUInteger)theOptions;
Availability: OpenStep
This is a designated initialiser for the class.
Initialises the receiver as the specified kind
of node and with the specified options.
- (
NSXMLNodeKind)
kind;
Availability: OpenStep
Returns the kind of node represented by the
receiver.
- (
NSUInteger)
level;
Availability: OpenStep
Return the level of the receiver within the tree of
nodes.
A document or a node which is not
inside another is at level 0.
- (
NSString*)
localName;
Availability: OpenStep
Returns the name of the receiver without any
namespace prefix.
- (
NSString*)
name;
Availability: OpenStep
Returns the name of the receiver.
- (
NSXMLNode*)
nextNode;
Availability: OpenStep
Returns the next node in the tree.
- (
NSXMLNode*)
nextSibling;
Availability: OpenStep
Returns the next sibling of the receiver
- (
NSArray*)
nodesForXPath: (
NSString*)anxpath
error: (
NSError**)error;
Availability: OpenStep
Returns the nodes resulting from applying xpath to
the receiver.
Before using xpath on a tree, you
must call the
-normalizeAdjacentTextNodesPreservingCDATA:
with
NO
as the argument, in order to avoid problems where the xpath syntax cannot cope with multiple text nodes.
- (id)
objectValue;
Availability: OpenStep
Returns the object value of the receiver (as set
using -setObjectValue:) or nil
if there
is none.
- (
NSArray*)
objectsForXQuery: (
NSString*)xquery
constants: (
NSDictionary*)constants
error: (
NSError**)error;
Availability: OpenStep
Returns the data resulting from calling the query
on the receiver.
Before using xpath on a tree,
you must call the
-normalizeAdjacentTextNodesPreservingCDATA:
with
NO
as the argument, in order to avoid problems where the xpath syntax cannot cope with multiple text nodes.
The value of
constants is a dictionary of
constants declared to be "external" in the query.
The resulting array amy contain array, data, date, number, string, and URL objects as well as nodes.
- (
NSArray*)
objectsForXQuery: (
NSString*)xquery
error: (
NSError**)error;
Availability: OpenStep
Returns the data resulting from calling the query
on the receiver.
The same as
objectsForXQuery:constants:error:
without the constants.
- (
NSXMLNode*)
parent;
Availability: OpenStep
Returns the parent node of the receiver or
nil
if the receiver is not within
another node.
- (
NSString*)
prefix;
Availability: OpenStep
Returns the namepsace prefix for the receiver or
nil
if there is no namespace prefix.
- (
NSXMLNode*)
previousNode;
Availability: OpenStep
Returns the previous node in the tree... stepping
through the tree backwards.
- (
NSXMLNode*)
previousSibling;
Availability: OpenStep
Description forthcoming.
- (
NSXMLDocument*)
rootDocument;
Availability: OpenStep
Returns the document containing the receiver, or
nil
if the receiver does not lie within
a document.
- (void)
setName: (
NSString*)name;
Availability: OpenStep
Sets the name of the receiver.
- (void)
setObjectValue: (id)value;
Availability: OpenStep
Sets the content of the receiver, removing any
existing children (including comments and
processing instructions).
For an element
node, this sets text contetn within the node.
- (void)
setStringValue: (
NSString*)string;
Availability: OpenStep
Sets the content of the receiver to be the supplied
string value... which involves removing
existing content, comments, and processing
instructions.
If the receiver is an
element node, this creates a text node containing
the string value as the sole child of the
receiver.
- (void)
setStringValue: (
NSString*)string
resolvingEntities: (BOOL)resolve;
Availability: OpenStep
Sets the string content of the receiver.
if the resolve flag is
YES
then any entities which can be
resolved are replaced by the resolved versions.
- (void)
setURI: (
NSString*)URI;
Availability: OpenStep
Sets the URI of the receiver.
- (
NSString*)
stringValue;
Availability: OpenStep
Returns the string value of the receiver. For kinds
of node which have direct string content, this simply
returns that content. For elements this recursively
traverses the children of the receiver appending
the text of each child to a single string result.
Instance Variables for NSXMLNode Class
@public GSInternal* _internal;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
Up