Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / xml / dom / XDocument.idl
blob9d2292ec3e50ad943554b9e762b65f6b70897d81
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __com_sun_star_xml_dom_XDocument_idl__
21 #define __com_sun_star_xml_dom_XDocument_idl__
23 #include <com/sun/star/xml/dom/XNode.idl>
24 #include <com/sun/star/xml/dom/XAttr.idl>
25 #include <com/sun/star/xml/dom/XCDATASection.idl>
26 #include <com/sun/star/xml/dom/XComment.idl>
27 #include <com/sun/star/xml/dom/XDocumentFragment.idl>
28 #include <com/sun/star/xml/dom/XEntityReference.idl>
29 #include <com/sun/star/xml/dom/XProcessingInstruction.idl>
30 #include <com/sun/star/xml/dom/XDocumentType.idl>
31 #include <com/sun/star/xml/dom/XDOMImplementation.idl>
33 module com { module sun { module star { module xml { module dom {
35 interface XDocument: XNode
37 /**
38 Creates an Attr of the given name.
39 Throws:
40 DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
42 XAttr createAttribute([in] string name) raises (DOMException);
44 /**
45 Creates an attribute of the given qualified name and namespace URI.
46 Throws:
47 DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal
48 character, per the XML 1.0 specification .
49 NAMESPACE_ERR: Raised if the qualifiedName is malformed per the Namespaces in XML
50 specification, if the qualifiedName has a prefix and the namespaceURI is null, if
51 the qualifiedName has a prefix that is "xml" and the namespaceURI is different from
52 " http://www.w3.org/XML/1998/namespace", or if the qualifiedName, or its prefix, is
53 "xmlns" and the namespaceURI is different from " http://www.w3.org/2000/xmlns/".
54 NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML"
55 feature, since namespaces were defined by XML.
57 XAttr createAttributeNS([in] string namespaceURI, [in] string qualifiedName) raises (DOMException);
59 /**
60 Creates a CDATASection node whose value is the specified string.
61 Throws:
62 DOMException - NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
64 XCDATASection createCDATASection([in] string data) raises (DOMException);
66 /**
67 Creates a Comment node given the specified string.
69 XComment createComment([in] string data);
71 /**
72 Creates an empty DocumentFragment object.
74 XDocumentFragment createDocumentFragment();
77 /**
78 Creates an element of the type specified.
79 Throws:
80 DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
82 XElement createElement([in] string tagName) raises (DOMException);
85 /**
86 Creates an element of the given qualified name and namespace URI.
87 Throws:
88 DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an
89 illegal character, per the XML 1.0 specification .
90 NAMESPACE_ERR: Raised if the qualifiedName is malformed per the Namespaces in
91 XML specification, if the qualifiedName has a prefix and the namespaceURI is
92 null, or if the qualifiedName has a prefix that is "xml" and the namespaceURI
93 is different from " http://www.w3.org/XML/1998/namespace" .
94 NOT_SUPPORTED_ERR: Always thrown if the current document does not support the
95 "XML" feature, since namespaces were defined by XML.
97 XElement createElementNS([in] string namespaceURI, [in] string qualifiedName) raises (DOMException);
99 /**
100 Throws:
101 DOMException - NOT_SUPPORTED_ERR: Raised if the type of node being imported is not supported.
102 Creates an EntityReference object.
103 Throws:
104 DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
105 NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
107 XEntityReference createEntityReference([in] string name) raises (DOMException);
110 Creates a ProcessingInstruction node given the specified name and
111 data strings.
112 Throws:
113 DOMException - INVALID_CHARACTER_ERR: Raised if the specified target contains an illegal character.
114 NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
116 XProcessingInstruction createProcessingInstruction(
117 [in] string target, [in] string data) raises (DOMException);
120 Creates a Text node given the specified string.
122 XText createTextNode([in] string data);
125 The Document Type Declaration (see DocumentType) associated with this
126 document.
128 XDocumentType getDoctype();
131 This is a convenience attribute that allows direct access to the child
132 node that is the root element of the document.
134 XElement getDocumentElement();
137 Returns the Element whose ID is given by elementId.
139 XElement getElementById([in] string elementId);
142 Returns a NodeList of all the Elements with a given tag name in the
143 order in which they are encountered in a preorder traversal of the
144 Document tree.
146 XNodeList getElementsByTagName([in] string tagname);
149 Returns a NodeList of all the Elements with a given local name and
150 namespace URI in the order in which they are encountered in a preorder
151 traversal of the Document tree.
153 XNodeList getElementsByTagNameNS([in] string namespaceURI, [in] string localName);
156 The DOMImplementation object that handles this document.
158 XDOMImplementation getImplementation();
161 Imports a node from another document to this document.
162 Throws:
163 DOMException - NOT_SUPPORTED_ERR: Raised if the type of node being imported is not supported.
165 XNode importNode([in] XNode importedNode, [in] boolean deep) raises (DOMException);
167 };};};};};
169 #endif
171 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */