1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XDocument.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __com_sun_star_xml_dom_XDocument_idl__
32 #define __com_sun_star_xml_dom_XDocument_idl__
34 #ifndef __com_sun_star_xml_dom_XNode_idl__
35 #include
<com
/sun
/star
/xml
/dom
/XNode.idl
>
37 #ifndef __com_sun_star_xml_dom_XAttr_idl__
38 #include
<com
/sun
/star
/xml
/dom
/XAttr.idl
>
40 #ifndef __com_sun_star_xml_dom_XCDATASection_idl__
41 #include
<com
/sun
/star
/xml
/dom
/XCDATASection.idl
>
43 #ifndef __com_sun_star_xml_dom_XComment_idl__
44 #include
<com
/sun
/star
/xml
/dom
/XComment.idl
>
46 #ifndef __com_sun_star_xml_dom_XDocumentFragemnt_idl__
47 #include
<com
/sun
/star
/xml
/dom
/XDocumentFragment.idl
>
49 #ifndef __com_sun_star_xml_dom_XEntityReference_idl__
50 #include
<com
/sun
/star
/xml
/dom
/XEntityReference.idl
>
52 #ifndef __com_sun_star_xml_dom_XProcessingInstruction_idl__
53 #include
<com
/sun
/star
/xml
/dom
/XProcessingInstruction.idl
>
55 #ifndef __com_sun_star_xml_dom_XDocumentType_idl__
56 #include
<com
/sun
/star
/xml
/dom
/XDocumentType.idl
>
58 #ifndef __com_sun_star_xml_dom_XDOMImplementation_idl__
59 #include
<com
/sun
/star
/xml
/dom
/XDOMImplementation.idl
>
62 module com
{ module sun
{ module star
{ module xml
{ module dom
{
64 interface XDocument
: XNode
67 Creates an Attr of the given name.
69 DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
71 XAttr createAttribute
([in] string name
) raises
(DOMException
);
74 Creates an attribute of the given qualified name and namespace URI.
76 DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal
77 character, per the XML 1.0 specification .
78 NAMESPACE_ERR: Raised if the qualifiedName is malformed per the Namespaces in XML
79 specification, if the qualifiedName has a prefix and the namespaceURI is null, if
80 the qualifiedName has a prefix that is "xml" and the namespaceURI is different from
81 " http://www.w3.org/XML/1998/namespace", or if the qualifiedName, or its prefix, is
82 "xmlns" and the namespaceURI is different from " http://www.w3.org/2000/xmlns/".
83 NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML"
84 feature, since namespaces were defined by XML.
86 XAttr createAttributeNS
([in] string namespaceURI
, [in] string qualifiedName
) raises
(DOMException
);
89 Creates a CDATASection node whose value is the specified string.
91 DOMException - NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
93 XCDATASection createCDATASection
([in] string data
) raises
(DOMException
);
96 Creates a Comment node given the specified string.
98 XComment createComment
([in] string data
);
101 Creates an empty DocumentFragment object.
103 XDocumentFragment createDocumentFragment
();
107 Creates an element of the type specified.
109 DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
111 XElement createElement
([in] string tagName
) raises
(DOMException
);
115 Creates an element of the given qualified name and namespace URI.
117 DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an
118 illegal character, per the XML 1.0 specification .
119 NAMESPACE_ERR: Raised if the qualifiedName is malformed per the Namespaces in
120 XML specification, if the qualifiedName has a prefix and the namespaceURI is
121 null, or if the qualifiedName has a prefix that is "xml" and the namespaceURI
122 is different from " http://www.w3.org/XML/1998/namespace" .
123 NOT_SUPPORTED_ERR: Always thrown if the current document does not support the
124 "XML" feature, since namespaces were defined by XML.
126 XElement createElementNS
([in] string namespaceURI
, [in] string qualifiedName
) raises
(DOMException
);
130 DOMException - NOT_SUPPORTED_ERR: Raised if the type of node being imported is not supported.
131 Creates an EntityReference object.
133 DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
134 NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
136 XEntityReference createEntityReference
([in] string name
) raises
(DOMException
);
139 Creates a ProcessingInstruction node given the specified name and
142 DOMException - INVALID_CHARACTER_ERR: Raised if the specified target contains an illegal character.
143 NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
145 XProcessingInstruction createProcessingInstruction
(
146 [in] string target
, [in] string data
) raises
(DOMException
);
149 Creates a Text node given the specified string.
151 XText createTextNode
([in] string data
);
154 The Document Type Declaration (see DocumentType) associated with this
157 XDocumentType getDoctype
();
160 This is a convenience attribute that allows direct access to the child
161 node that is the root element of the document.
163 XElement getDocumentElement
();
166 Returns the Element whose ID is given by elementId.
168 XElement getElementById
([in] string elementId
);
171 Returns a NodeList of all the Elements with a given tag name in the
172 order in which they are encountered in a preorder traversal of the
175 XNodeList getElementsByTagName
([in] string tagname
);
178 Returns a NodeList of all the Elements with a given local name and
179 namespace URI in the order in which they are encountered in a preorder
180 traversal of the Document tree.
182 XNodeList getElementsByTagNameNS
([in] string namespaceURI
, [in] string localName
);
185 The DOMImplementation object that handles this document.
187 XDOMImplementation getImplementation
();
190 Imports a node from another document to this document.
192 DOMException - NOT_SUPPORTED_ERR: Raised if the type of node being imported is not supported.
194 XNode importNode
([in] XNode importedNode
, [in] boolean deep
) raises
(DOMException
);