merge the formfield patch from ooo-build
[ooovba.git] / offapi / com / sun / star / xml / dom / XElement.idl
blobaa85c99af1090235a68534581af93cb556413251
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XElement.idl,v $
10 * $Revision: 1.4 $
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_XElement_idl__
32 #define __com_sun_star_xml_dom_XElement_idl__
34 #ifndef __com_sun_star_xml_dom_XNode_idl__
35 #include <com/sun/star/xml/dom/XNode.idl>
36 #endif
37 #ifndef __com_sun_star_xml_dom_XAttr_idl__
38 #include <com/sun/star/xml/dom/XAttr.idl>
39 #endif
41 module com { module sun { module star { module xml { module dom {
43 interface XElement: XNode
45 /**
46 Retrieves an attribute value by name.
48 string getAttribute([in] string name);
50 /**
51 Retrieves an attribute node by name.
53 XAttr getAttributeNode([in] string name);
55 /**
56 Retrieves an Attr node by local name and namespace URI.
58 XAttr getAttributeNodeNS([in] string namespaceURI,[in]
59 string localName);
61 /**
62 Retrieves an attribute value by local name and namespace URI.
64 string getAttributeNS([in] string namespaceURI, [in] string localName);
66 /**
67 Returns a NodeList of all descendant Elements with a given tag name,
68 in the order in which they are
69 encountered in a preorder traversal of this Element tree.
71 XNodeList getElementsByTagName([in] string name);
73 /**
74 Returns a NodeList of all the descendant Elements with a given local
75 name and namespace URI in the order in which they are encountered in
76 a preorder traversal of this Element tree.
78 XNodeList getElementsByTagNameNS([in] string namespaceURI,[in] string localName);
80 /**
81 The name of the element.
83 string getTagName();
85 /**
86 Returns true when an attribute with a given name is specified on this
87 element or has a default value, false otherwise.
89 boolean hasAttribute([in] string name);
91 /**
92 Returns true when an attribute with a given local name and namespace
93 URI is specified on this element or has a default value, false otherwise.
95 boolean hasAttributeNS([in] string namespaceURI,[in] string localName);
97 /**
98 Removes an attribute by name.
99 Throws:
100 DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
102 void removeAttribute([in] string name) raises (DOMException);
105 Removes the specified attribute node.
106 Throws:
107 DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
108 NOT_FOUND_ERR: Raised if oldAttr is not an attribute of the element.
110 XAttr removeAttributeNode([in] XAttr oldAttr) raises (DOMException);
113 Removes an attribute by local name and namespace URI.
114 Throws:
115 DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
117 void removeAttributeNS([in] string namespaceURI,[in] string localName) raises (DOMException);
120 Adds a new attribute.
121 Throws:
122 DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
123 NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
125 void setAttribute([in] string name,[in] string value) raises (DOMException);
128 Adds a new attribute node.
129 Throws:
130 DOMException - WRONG_DOCUMENT_ERR: Raised if newAttr was created from a different document than the one that created the element.
131 NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
132 INUSE_ATTRIBUTE_ERR: Raised if newAttr is already an attribute of another Element object. The DOM user must explicitly clone Attr nodes to re-use them in other elements.
134 XAttr setAttributeNode([in] XAttr newAttr) raises (DOMException);
137 Adds a new attribute.
138 Throws:
139 DOMException - WRONG_DOCUMENT_ERR: Raised if newAttr was created from a different document than the one that created the element.
140 NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
141 INUSE_ATTRIBUTE_ERR: Raised if newAttr is already an attribute of another Element object. The DOM user must explicitly clone Attr nodes to re-use them in other elements.
142 NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML" feature, since namespaces were defined by XML.
144 XAttr setAttributeNodeNS([in] XAttr newAttr) raises (DOMException);
147 Adds a new attribute.
148 Throws:
149 DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character, per the XML 1.0 specification .
150 NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
151 NAMESPACE_ERR: Raised if the qualifiedName is malformed per the Namespaces in XML specification, if the qualifiedName has a prefix and the namespaceURI is null, if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from " http://www.w3.org/XML/1998/namespace", or if the qualifiedName, or its prefix, is "xmlns" and the namespaceURI is different from " http://www.w3.org/2000/xmlns/".
152 NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML" feature, since namespaces were defined by XML.
154 void setAttributeNS(
155 [in] string namespaceURI, [in] string qualifiedName, [in] string value) raises (DOMException);
157 }; }; }; }; };
159 #endif