xref: /aoo42x/main/offapi/com/sun/star/xml/dom/XDocument.idl (revision d1766043)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24#ifndef __com_sun_star_xml_dom_XDocument_idl__
25#define __com_sun_star_xml_dom_XDocument_idl__
26
27#ifndef __com_sun_star_xml_dom_XNode_idl__
28#include <com/sun/star/xml/dom/XNode.idl>
29#endif
30#ifndef __com_sun_star_xml_dom_XAttr_idl__
31#include <com/sun/star/xml/dom/XAttr.idl>
32#endif
33#ifndef __com_sun_star_xml_dom_XCDATASection_idl__
34#include <com/sun/star/xml/dom/XCDATASection.idl>
35#endif
36#ifndef __com_sun_star_xml_dom_XComment_idl__
37#include <com/sun/star/xml/dom/XComment.idl>
38#endif
39#ifndef __com_sun_star_xml_dom_XDocumentFragemnt_idl__
40#include <com/sun/star/xml/dom/XDocumentFragment.idl>
41#endif
42#ifndef __com_sun_star_xml_dom_XEntityReference_idl__
43#include <com/sun/star/xml/dom/XEntityReference.idl>
44#endif
45#ifndef __com_sun_star_xml_dom_XProcessingInstruction_idl__
46#include <com/sun/star/xml/dom/XProcessingInstruction.idl>
47#endif
48#ifndef __com_sun_star_xml_dom_XDocumentType_idl__
49#include <com/sun/star/xml/dom/XDocumentType.idl>
50#endif
51#ifndef __com_sun_star_xml_dom_XDOMImplementation_idl__
52#include <com/sun/star/xml/dom/XDOMImplementation.idl>
53#endif
54
55module com { module sun { module star { module xml { module dom {
56
57interface XDocument: XNode
58{
59    /**
60    Creates an Attr of the given name.
61    Throws:
62    DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
63    */
64    XAttr createAttribute([in] string name) raises (DOMException);
65
66    /**
67    Creates an attribute of the given qualified name and namespace URI.
68    Throws:
69    DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal
70                      character, per the XML 1.0 specification .
71                   NAMESPACE_ERR: Raised if the qualifiedName is malformed per the Namespaces in XML
72                      specification, if the qualifiedName has a prefix and the namespaceURI is null, if
73                      the qualifiedName has a prefix that is "xml" and the namespaceURI is different from
74                      " http://www.w3.org/XML/1998/namespace", or if the qualifiedName, or its prefix, is
75                      "xmlns" and the namespaceURI is different from " http://www.w3.org/2000/xmlns/".
76                   NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML"
77                      feature, since namespaces were defined by XML.
78    */
79    XAttr createAttributeNS([in] string namespaceURI, [in] string qualifiedName) raises (DOMException);
80
81    /**
82    Creates a CDATASection node whose value is the specified string.
83    Throws:
84    DOMException - NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
85    */
86    XCDATASection createCDATASection([in] string data) raises (DOMException);
87
88    /**
89    Creates a Comment node given the specified string.
90    */
91    XComment createComment([in] string data);
92
93    /**
94    Creates an empty DocumentFragment object.
95    */
96    XDocumentFragment createDocumentFragment();
97
98
99    /**
100    Creates an element of the type specified.
101    Throws:
102    DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
103    */
104    XElement createElement([in] string tagName) raises (DOMException);
105
106
107    /**
108    Creates an element of the given qualified name and namespace URI.
109    Throws:
110    DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an
111                      illegal character, per the XML 1.0 specification .
112                   NAMESPACE_ERR: Raised if the qualifiedName is malformed per the Namespaces in
113                      XML specification, if the qualifiedName has a prefix and the namespaceURI is
114                      null, or if the qualifiedName has a prefix that is "xml" and the namespaceURI
115                      is different from " http://www.w3.org/XML/1998/namespace" .
116                   NOT_SUPPORTED_ERR: Always thrown if the current document does not support the
117                      "XML" feature, since namespaces were defined by XML.
118    */
119    XElement createElementNS([in] string namespaceURI, [in] string qualifiedName) raises (DOMException);
120
121    /**
122   Throws:
123    DOMException - NOT_SUPPORTED_ERR: Raised if the type of node being imported is not supported.
124    Creates an EntityReference object.
125    Throws:
126    DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
127    NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
128    */
129    XEntityReference createEntityReference([in] string name) raises (DOMException);
130
131    /**
132    Creates a ProcessingInstruction node given the specified name and
133    data strings.
134    Throws:
135    DOMException - INVALID_CHARACTER_ERR: Raised if the specified target contains an illegal character.
136    NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
137    */
138    XProcessingInstruction createProcessingInstruction(
139    [in] string target, [in] string data) raises (DOMException);
140
141    /**
142    Creates a Text node given the specified string.
143    */
144    XText createTextNode([in] string data);
145
146    /**
147    The Document Type Declaration (see DocumentType) associated with this
148    document.
149    */
150    XDocumentType getDoctype();
151
152    /**
153    This is a convenience attribute that allows direct access to the child
154    node that is the root element of the document.
155    */
156    XElement getDocumentElement();
157
158    /**
159    Returns the Element whose ID is given by elementId.
160    */
161    XElement getElementById([in] string elementId);
162
163    /**
164    Returns a NodeList of all the Elements with a given tag name in the
165    order in which they are encountered in a preorder traversal of the
166    Document tree.
167    */
168    XNodeList getElementsByTagName([in] string tagname);
169
170    /**
171    Returns a NodeList of all the Elements with a given local name and
172    namespace URI in the order in which they are encountered in a preorder
173    traversal of the Document tree.
174    */
175    XNodeList getElementsByTagNameNS([in] string namespaceURI, [in] string localName);
176
177    /**
178    The DOMImplementation object that handles this document.
179    */
180    XDOMImplementation getImplementation();
181
182    /**
183    Imports a node from another document to this document.
184    Throws:
185    DOMException - NOT_SUPPORTED_ERR: Raised if the type of node being imported is not supported.
186    */
187    XNode importNode([in] XNode importedNode, [in] boolean deep) raises (DOMException);
188};
189};};};};};
190
191#endif
192