xref: /trunk/main/offapi/com/sun/star/xml/dom/XDocument.idl (revision cdf0e10c)
1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27
28#ifndef __com_sun_star_xml_dom_XDocument_idl__
29#define __com_sun_star_xml_dom_XDocument_idl__
30
31#ifndef __com_sun_star_xml_dom_XNode_idl__
32#include <com/sun/star/xml/dom/XNode.idl>
33#endif
34#ifndef __com_sun_star_xml_dom_XAttr_idl__
35#include <com/sun/star/xml/dom/XAttr.idl>
36#endif
37#ifndef __com_sun_star_xml_dom_XCDATASection_idl__
38#include <com/sun/star/xml/dom/XCDATASection.idl>
39#endif
40#ifndef __com_sun_star_xml_dom_XComment_idl__
41#include <com/sun/star/xml/dom/XComment.idl>
42#endif
43#ifndef __com_sun_star_xml_dom_XDocumentFragemnt_idl__
44#include <com/sun/star/xml/dom/XDocumentFragment.idl>
45#endif
46#ifndef __com_sun_star_xml_dom_XEntityReference_idl__
47#include <com/sun/star/xml/dom/XEntityReference.idl>
48#endif
49#ifndef __com_sun_star_xml_dom_XProcessingInstruction_idl__
50#include <com/sun/star/xml/dom/XProcessingInstruction.idl>
51#endif
52#ifndef __com_sun_star_xml_dom_XDocumentType_idl__
53#include <com/sun/star/xml/dom/XDocumentType.idl>
54#endif
55#ifndef __com_sun_star_xml_dom_XDOMImplementation_idl__
56#include <com/sun/star/xml/dom/XDOMImplementation.idl>
57#endif
58
59module com { module sun { module star { module xml { module dom {
60
61interface XDocument: XNode
62{
63    /**
64    Creates an Attr of the given name.
65    Throws:
66    DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
67    */
68    XAttr createAttribute([in] string name) raises (DOMException);
69
70    /**
71    Creates an attribute of the given qualified name and namespace URI.
72    Throws:
73    DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal
74                      character, per the XML 1.0 specification .
75                   NAMESPACE_ERR: Raised if the qualifiedName is malformed per the Namespaces in XML
76                      specification, if the qualifiedName has a prefix and the namespaceURI is null, if
77                      the qualifiedName has a prefix that is "xml" and the namespaceURI is different from
78                      " http://www.w3.org/XML/1998/namespace", or if the qualifiedName, or its prefix, is
79                      "xmlns" and the namespaceURI is different from " http://www.w3.org/2000/xmlns/".
80                   NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML"
81                      feature, since namespaces were defined by XML.
82    */
83    XAttr createAttributeNS([in] string namespaceURI, [in] string qualifiedName) raises (DOMException);
84
85    /**
86    Creates a CDATASection node whose value is the specified string.
87    Throws:
88    DOMException - NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
89    */
90    XCDATASection createCDATASection([in] string data) raises (DOMException);
91
92    /**
93    Creates a Comment node given the specified string.
94    */
95    XComment createComment([in] string data);
96
97    /**
98    Creates an empty DocumentFragment object.
99    */
100    XDocumentFragment createDocumentFragment();
101
102
103    /**
104    Creates an element of the type specified.
105    Throws:
106    DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
107    */
108    XElement createElement([in] string tagName) raises (DOMException);
109
110
111    /**
112    Creates an element of the given qualified name and namespace URI.
113    Throws:
114    DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an
115                      illegal character, per the XML 1.0 specification .
116                   NAMESPACE_ERR: Raised if the qualifiedName is malformed per the Namespaces in
117                      XML specification, if the qualifiedName has a prefix and the namespaceURI is
118                      null, or if the qualifiedName has a prefix that is "xml" and the namespaceURI
119                      is different from " http://www.w3.org/XML/1998/namespace" .
120                   NOT_SUPPORTED_ERR: Always thrown if the current document does not support the
121                      "XML" feature, since namespaces were defined by XML.
122    */
123    XElement createElementNS([in] string namespaceURI, [in] string qualifiedName) raises (DOMException);
124
125    /**
126   Throws:
127    DOMException - NOT_SUPPORTED_ERR: Raised if the type of node being imported is not supported.
128    Creates an EntityReference object.
129    Throws:
130    DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
131    NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
132    */
133    XEntityReference createEntityReference([in] string name) raises (DOMException);
134
135    /**
136    Creates a ProcessingInstruction node given the specified name and
137    data strings.
138    Throws:
139    DOMException - INVALID_CHARACTER_ERR: Raised if the specified target contains an illegal character.
140    NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
141    */
142    XProcessingInstruction createProcessingInstruction(
143    [in] string target, [in] string data) raises (DOMException);
144
145    /**
146    Creates a Text node given the specified string.
147    */
148    XText createTextNode([in] string data);
149
150    /**
151    The Document Type Declaration (see DocumentType) associated with this
152    document.
153    */
154    XDocumentType getDoctype();
155
156    /**
157    This is a convenience attribute that allows direct access to the child
158    node that is the root element of the document.
159    */
160    XElement getDocumentElement();
161
162    /**
163    Returns the Element whose ID is given by elementId.
164    */
165    XElement getElementById([in] string elementId);
166
167    /**
168    Returns a NodeList of all the Elements with a given tag name in the
169    order in which they are encountered in a preorder traversal of the
170    Document tree.
171    */
172    XNodeList getElementsByTagName([in] string tagname);
173
174    /**
175    Returns a NodeList of all the Elements with a given local name and
176    namespace URI in the order in which they are encountered in a preorder
177    traversal of the Document tree.
178    */
179    XNodeList getElementsByTagNameNS([in] string namespaceURI, [in] string localName);
180
181    /**
182    The DOMImplementation object that handles this document.
183    */
184    XDOMImplementation getImplementation();
185
186    /**
187    Imports a node from another document to this document.
188    Throws:
189    DOMException - NOT_SUPPORTED_ERR: Raised if the type of node being imported is not supported.
190    */
191    XNode importNode([in] XNode importedNode, [in] boolean deep) raises (DOMException);
192};
193};};};};};
194
195#endif
196