LibreOffice: XDocument Interface Reference

LibreOffice LibreOffice 7.3 SDK API Reference

Loading...
Searching...
No Matches
Public Member Functions | List of all members
XDocument Interface Reference
Inheritance diagram for XDocument:

## Public Member Functions
XAttr | createAttribute ([in] string name) raises (DOMException)
| Creates an Attr of the given name.
XAttr | createAttributeNS ([in] string namespaceURI, [in] string qualifiedName) raises (DOMException)
| Creates an attribute of the given qualified name and namespace URI.
XCDATASection | createCDATASection ([in] string data) raises (DOMException)
| Creates a CDATASection node whose value is the specified string.
XComment | createComment ([in] string data)
| Creates a Comment node given the specified string.
XDocumentFragment | createDocumentFragment ()
| Creates an empty DocumentFragment object.
XElement | createElement ([in] string tagName) raises (DOMException)
| Creates an element of the type specified.
XElement | createElementNS ([in] string namespaceURI, [in] string qualifiedName) raises (DOMException)
| Creates an element of the given qualified name and namespace URI.
XEntityReference | createEntityReference ([in] string name) raises (DOMException)
| Throws: DOMException - NOT_SUPPORTED_ERR: Raised if the type of node being imported is not supported.
XProcessingInstruction | createProcessingInstruction ([in] string target, [in] string data) raises (DOMException)
| Creates a ProcessingInstruction node given the specified name and data strings.
XText | createTextNode ([in] string data)
| Creates a Text node given the specified string.
XDocumentType | getDoctype ()
| The Document Type Declaration (see DocumentType) associated with this document.
XElement | getDocumentElement ()
| This is a convenience attribute that allows direct access to the child node that is the root element of the document.
XElement | getElementById ([in] string elementId)
| Returns the Element whose ID is given by elementId.
XNodeList | getElementsByTagName ([in] string tagname)
| Returns a NodeList of all the Elements with a given tag name in the order in which they are encountered in a preorder traversal of the Document tree.
XNodeList | getElementsByTagNameNS ([in] string namespaceURI, [in] string localName)
| Returns a NodeList of all the Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of the Document tree.
XDOMImplementation | getImplementation ()
| The DOMImplementation object that handles this document.
XNode | importNode ([in] XNode importedNode, [in] boolean deep) raises (DOMException)
| Imports a node from another document to this document.
Public Member Functions inherited from XNode
XNode | appendChild ([in] XNode newChild) raises (DOMException)
| Adds the node newChild to the end of the list of children of this node.
XNode | cloneNode ([in] boolean deep)
| Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes.
XNamedNodeMap | getAttributes ()
| A NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.
XNodeList | getChildNodes ()
| A NodeList that contains all children of this node.
XNode | getFirstChild ()
| The first child of this node.
XNode | getLastChild ()
| The last child of this node.
string | getLocalName ()
| Returns the local part of the qualified name of this node.
string | getNamespaceURI ()
| The namespace URI of this node, or null if it is unspecified.
XNode | getNextSibling ()
| The node immediately following this node.
string | getNodeName ()
| The name of this node, depending on its type; see the table above.
NodeType | getNodeType ()
| A code representing the type of the underlying object, as defined above.
string | getNodeValue () raises (DOMException)
| The value of this node, depending on its type; see the table above.
XDocument | getOwnerDocument ()
| The Document object associated with this node.
XNode | getParentNode ()
| The parent of this node.
string | getPrefix ()
| The namespace prefix of this node, or null if it is unspecified.
XNode | getPreviousSibling ()
| The node immediately preceding this node.
boolean | hasAttributes ()
| Returns whether this node (if it is an element) has any attributes.
boolean | hasChildNodes ()
| Returns whether this node has any children.
XNode | insertBefore ([in] XNode newChild, [in] XNode refChild) raises (DOMException)
| Inserts the node newChild before the existing child node refChild.
boolean | isSupported ([in] string feature, [in] string ver)
| Tests whether the DOM implementation implements a specific feature and that feature is supported by this node.
void | normalize ()
| Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.
XNode | removeChild ([in] XNode oldChild) raises (DOMException)
| Removes the child node indicated by oldChild from the list of children, and returns it.
XNode | replaceChild ([in] XNode newChild, [in] XNode oldChild) raises (DOMException)
| Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node.
void | setNodeValue ([in] string nodeValue) raises (DOMException)
| The value of this node, depending on its type; see the table above.
void | setPrefix ([in] string prefix) raises (DOMException)
| The namespace prefix of this node, or null if it is unspecified.
Public Member Functions inherited from XInterface
any | queryInterface ([in] type aType)
| queries for a new interface to an existing UNO object.
void | acquire ()
| increases the reference counter by one.
void | release ()
| decreases the reference counter by one.

## Member Function Documentation

## ◆ createAttribute()

XAttr createAttribute | ( | [in] string | name | ) |
raises | ( | DOMException
| ) |  |

Creates an Attr of the given name.

Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.

## ◆ createAttributeNS()

XAttr createAttributeNS | ( | [in] string | namespaceURI,
|  | [in] string | qualifiedName
| ) |  |
raises | ( | DOMException
| ) |  |

Creates an attribute of the given qualified name and namespace URI.

Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character, per the XML 1.0 specification . NAMESPACE_ERR: Raised if the qualifiedName is malformed per the Namespaces in XML specification, if the qualifiedName has a prefix and the namespaceURI is null, if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from " http://www.w3.org/XML/1998/namespace", or if the qualifiedName, or its prefix, is "xmlns" and the namespaceURI is different from " http://www.w3.org/2000/xmlns/". NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML" feature, since namespaces were defined by XML.

## ◆ createCDATASection()

XCDATASection createCDATASection | ( | [in] string | data | ) |
raises | ( | DOMException
| ) |  |

Creates a CDATASection node whose value is the specified string.

Throws: DOMException - NOT_SUPPORTED_ERR: Raised if this document is an HTML document.

## ◆ createComment()

XComment createComment | ( | [in] string | data | ) |

Creates a Comment node given the specified string.

## ◆ createDocumentFragment()

XDocumentFragment createDocumentFragment | ( |  | ) |

Creates an empty DocumentFragment object.

## ◆ createElement()

XElement createElement | ( | [in] string | tagName | ) |
raises | ( | DOMException
| ) |  |

Creates an element of the type specified.

Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.

## ◆ createElementNS()

XElement createElementNS | ( | [in] string | namespaceURI,
|  | [in] string | qualifiedName
| ) |  |
raises | ( | DOMException
| ) |  |

Creates an element of the given qualified name and namespace URI.

Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character, per the XML 1.0 specification . NAMESPACE_ERR: Raised if the qualifiedName is malformed per the Namespaces in XML specification, if the qualifiedName has a prefix and the namespaceURI is null, or if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from " http://www.w3.org/XML/1998/namespace" . NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML" feature, since namespaces were defined by XML.

## ◆ createEntityReference()

XEntityReference createEntityReference | ( | [in] string | name | ) |
raises | ( | DOMException
| ) |  |

Throws: DOMException - NOT_SUPPORTED_ERR: Raised if the type of node being imported is not supported.

Creates an EntityReference object. Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character. NOT_SUPPORTED_ERR: Raised if this document is an HTML document.

## ◆ createProcessingInstruction()

XProcessingInstruction createProcessingInstruction | ( | [in] string | target,
|  | [in] string | data
| ) |  |
raises | ( | DOMException
| ) |  |

Creates a ProcessingInstruction node given the specified name and data strings.

Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified target contains an illegal character. NOT_SUPPORTED_ERR: Raised if this document is an HTML document.

## ◆ createTextNode()

XText createTextNode | ( | [in] string | data | ) |

Creates a Text node given the specified string.

## ◆ getDoctype()

XDocumentType getDoctype | ( |  | ) |

The Document Type Declaration (see DocumentType) associated with this document.

## ◆ getDocumentElement()

XElement getDocumentElement | ( |  | ) |

This is a convenience attribute that allows direct access to the child node that is the root element of the document.

## ◆ getElementById()

XElement getElementById | ( | [in] string | elementId | ) |

Returns the Element whose ID is given by elementId.

## ◆ getElementsByTagName()

XNodeList getElementsByTagName | ( | [in] string | tagname | ) |

Returns a NodeList of all the Elements with a given tag name in the order in which they are encountered in a preorder traversal of the Document tree.

## ◆ getElementsByTagNameNS()

XNodeList getElementsByTagNameNS | ( | [in] string | namespaceURI,
|  | [in] string | localName
| ) |  |

Returns a NodeList of all the Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of the Document tree.

## ◆ getImplementation()

XDOMImplementation getImplementation | ( |  | ) |

The DOMImplementation object that handles this document.

## ◆ importNode()

XNode importNode | ( | [in] XNode | importedNode,
|  | [in] boolean | deep
| ) |  |
raises | ( | DOMException
| ) |  |

Imports a node from another document to this document.

Throws: DOMException - NOT_SUPPORTED_ERR: Raised if the type of node being imported is not supported.

The documentation for this interface was generated from the following file:

- com/sun/star/xml/dom/XDocument.idl