# NSXMLDocument class documentation

rfm@gnu.org
Generated at 2025-12-02 21:52:00 +0000
2008 Free Software Foundation, Inc.
Software documentation for the NSXMLDocument class
Foundation/NSXMLDocument.h
An XMLDocument encapsulates an entire document. This must contain a single element node.
replacementClassForClass:
cls
Description forthcoming.
DTD
Returns the DTD set for the receiver.
MIMEType
Returns the document MIME type..
XMLData
Outputs XML data using -XMLDataWithOptions: with NSXMLNodeOptionsNone.
XMLDataWithOptions:
theOptions
Outputs the reciever encoded using the specified options.
addChild:
child
Adds child after existing children.
characterEncoding
Returns the IANA character encoding, or `nil` if none is set.
documentContentKind
Returns the kind of document.
initWithContentsOfURL:
url
options:
mask
error:
error
Initialise using the data downloaded from the spplied url.
initWithData:
data
options:
mask
error:
error
Returns a document created from data.
Parse errors are returned in error .
initWithRootElement:
element
Returns a document with a single child, the root element.
initWithXMLString:
string
options:
mask
error:
error
Initialises the receiver by creating a document from XML (or HTML if the HTMLTidy option is set). Parse errors are returned in the error argument.
insertChild:
child
atIndex:
index
Inserts child at index.
insertChildren:
children
atIndex:
index
Inserts a number of children at the index.
isStandalone
Returns `NO` if the receiver depends upon an external DTD, otherwise returns `YES`.
objectByApplyingXSLT:
xslt
arguments:
arguments
error:
error
Returns a new document created by applying xslt (with a set of key/value pairs) to the receiver.
objectByApplyingXSLTAtURL:
xsltURL
arguments:
arguments
error:
error
Downloads XSLT from xsltURL, and then returns a new document created by applying it (with a set of key/value pairs) to the receiver.
objectByApplyingXSLTString:
xslt
arguments:
arguments
error:
error
Returns a new document created by applying xslt (with a set of key/value pairs) to the receiver.
removeChildAtIndex:
index
Removes the child at the index.
replaceChildAtIndex:
index
withNode:
theNode
Replacs the child at the specified index .
rootElement
Returns the root object of the receiver.
setCharacterEncoding:
encoding
Sets the character encoding to an IANA characterset type.
setChildren:
children
Replaces all existing child nodes with the ones in the array.
setDTD:
documentTypeDeclaration
Sets the DTD of the receiver. If this is set then the DTD will be output when the document is.
setDocumentContentKind:
theContentKind
Sets the kind of document.
setMIMEType:
theMIMEType
Sets the document MIME type (usually text/xml).
setRootElement:
root
Sets the root object of the receiver, removing any children which were previously set.
setStandalone:
standalone
Sets whether the receiver is a document which requires an external DTD.
If this is set then the standalone declaration will appear if the document is output.
setVersion:
version
Sets the XML version
Permitted values ar '1.0' or '1,1'
validateAndReturnError:
error
Description forthcoming.
version
Returns the XML version or `nil` if none is set.