# NSXMLElement class documentation

rfm@gnu.org
Generated at 2025-02-13 06:02:40 +0000
2008 Free Software Foundation, Inc.
Software documentation for the NSXMLElement class
Foundation/NSXMLElement.h
Represents an XML element.
addAttribute:
attribute
Adds the supplied attribute to the receiver (ignoring if it has a duplicate name).
addChild:
child
Adds a child after existing children.
addNamespace:
aNamespace
Adds a namespace unless the name is a duplicate.
attributeForLocalName:
localName
URI:
URI
Returns the attribute matching localName and URI.
attributeForName:
name
Returns the named attribute.
attributes
Returns the receiver's attributes.
elementsForLocalName:
localName
URI:
URI
Searches for and returns all child elements which match localName and the specified URI.
elementsForName:
name
Searches for and returns all child elements which match name.
initWithName:
name
Initialises the receiver with the given name.
initWithName:
name
URI:
URI
Initialises the receiver with the given name and namespace URI.
initWithName:
name
stringValue:
string
Initialises the receiver as a text node with the given name and content.
initWithXMLString:
string
error:
error
Initialises the receiver by parsing the XML string supplied.
insertChild:
child
atIndex:
index
Inerts a child node.
insertChildren:
children
atIndex:
index
Inserts a number of children.
namespaceForPrefix:
name
Returns the namespace for the specified prefix in the receiver.
namespaces
Returns the namespaces of the receiver.
normalizeAdjacentTextNodesPreservingCDATA:
preserve
Merges adjacent text nodes. If a node's value is the empty string, and preserve is `NO`, it is removed.
This should be called with a value of `NO` before using XQuery or XPath.
removeAttributeForName:
name
Removes the named attribute.
removeChildAtIndex:
index
Removes a child node.
removeNamespaceForPrefix:
name
Removes a named namespace.
replaceChildAtIndex:
index
withNode:
theNode
Replaces the child at the specified index.
resolveNamespaceForName:
name
Returns the namespace found by searching the chain of namespaces.
resolvePrefixForNamespaceURI:
namespaceURI
Returns the URI by searching the chain of namespaces.
setAttributes:
attributes
Sets the attributes of the receiver, ignoring all but the first of any duplicates.
setAttributesAsDictionary:
attributes
Sets attributes from the supplied dictionary.
DEPRECATED... use -setAttributesWithDictionary: instead.
setAttributesWithDictionary:
attributes
Sets attributes from the supplied dictionary.
setChildren:
children
Replaces all existing child nodes with those from the array.
setNamespaces:
namespaces
Sets the namespaces for the receiver, ignoring all but the first of any duplicates.