1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
28 #ifndef __com_sun_star_xml_dom_XDocument_idl__
29 #define __com_sun_star_xml_dom_XDocument_idl__
31 #ifndef __com_sun_star_xml_dom_XNode_idl__
32 #include
<com
/sun
/star
/xml
/dom
/XNode.idl
>
34 #ifndef __com_sun_star_xml_dom_XAttr_idl__
35 #include
<com
/sun
/star
/xml
/dom
/XAttr.idl
>
37 #ifndef __com_sun_star_xml_dom_XCDATASection_idl__
38 #include
<com
/sun
/star
/xml
/dom
/XCDATASection.idl
>
40 #ifndef __com_sun_star_xml_dom_XComment_idl__
41 #include
<com
/sun
/star
/xml
/dom
/XComment.idl
>
43 #ifndef __com_sun_star_xml_dom_XDocumentFragemnt_idl__
44 #include
<com
/sun
/star
/xml
/dom
/XDocumentFragment.idl
>
46 #ifndef __com_sun_star_xml_dom_XEntityReference_idl__
47 #include
<com
/sun
/star
/xml
/dom
/XEntityReference.idl
>
49 #ifndef __com_sun_star_xml_dom_XProcessingInstruction_idl__
50 #include
<com
/sun
/star
/xml
/dom
/XProcessingInstruction.idl
>
52 #ifndef __com_sun_star_xml_dom_XDocumentType_idl__
53 #include
<com
/sun
/star
/xml
/dom
/XDocumentType.idl
>
55 #ifndef __com_sun_star_xml_dom_XDOMImplementation_idl__
56 #include
<com
/sun
/star
/xml
/dom
/XDOMImplementation.idl
>
59 module com
{ module sun
{ module star
{ module xml
{ module dom
{
61 interface XDocument
: XNode
64 Creates an Attr of the given name.
66 DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
68 XAttr createAttribute
([in] string name
) raises
(DOMException
);
71 Creates an attribute of the given qualified name and namespace URI.
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.
83 XAttr createAttributeNS
([in] string namespaceURI
, [in] string qualifiedName
) raises
(DOMException
);
86 Creates a CDATASection node whose value is the specified string.
88 DOMException - NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
90 XCDATASection createCDATASection
([in] string data
) raises
(DOMException
);
93 Creates a Comment node given the specified string.
95 XComment createComment
([in] string data
);
98 Creates an empty DocumentFragment object.
100 XDocumentFragment createDocumentFragment
();
104 Creates an element of the type specified.
106 DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
108 XElement createElement
([in] string tagName
) raises
(DOMException
);
112 Creates an element of the given qualified name and namespace URI.
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.
123 XElement createElementNS
([in] string namespaceURI
, [in] string qualifiedName
) raises
(DOMException
);
127 DOMException - NOT_SUPPORTED_ERR: Raised if the type of node being imported is not supported.
128 Creates an EntityReference object.
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.
133 XEntityReference createEntityReference
([in] string name
) raises
(DOMException
);
136 Creates a ProcessingInstruction node given the specified name and
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.
142 XProcessingInstruction createProcessingInstruction
(
143 [in] string target
, [in] string data
) raises
(DOMException
);
146 Creates a Text node given the specified string.
148 XText createTextNode
([in] string data
);
151 The Document Type Declaration (see DocumentType) associated with this
154 XDocumentType getDoctype
();
157 This is a convenience attribute that allows direct access to the child
158 node that is the root element of the document.
160 XElement getDocumentElement
();
163 Returns the Element whose ID is given by elementId.
165 XElement getElementById
([in] string elementId
);
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
172 XNodeList getElementsByTagName
([in] string tagname
);
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.
179 XNodeList getElementsByTagNameNS
([in] string namespaceURI
, [in] string localName
);
182 The DOMImplementation object that handles this document.
184 XDOMImplementation getImplementation
();
187 Imports a node from another document to this document.
189 DOMException - NOT_SUPPORTED_ERR: Raised if the type of node being imported is not supported.
191 XNode importNode
([in] XNode importedNode
, [in] boolean deep
) raises
(DOMException
);