Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / xml / dom / XElement.idl
blobed5da5a36980bd4cd4ea70432053cb613e5a6a1a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __com_sun_star_xml_dom_XElement_idl__
21 #define __com_sun_star_xml_dom_XElement_idl__
23 #include <com/sun/star/xml/dom/XNode.idl>
24 #include <com/sun/star/xml/dom/XAttr.idl>
26 module com { module sun { module star { module xml { module dom {
28 interface XElement: XNode
30 /**
31 Retrieves an attribute value by name.
33 string getAttribute([in] string name);
35 /**
36 Retrieves an attribute node by name.
38 XAttr getAttributeNode([in] string name);
40 /**
41 Retrieves an Attr node by local name and namespace URI.
43 XAttr getAttributeNodeNS([in] string namespaceURI,[in]
44 string localName);
46 /**
47 Retrieves an attribute value by local name and namespace URI.
49 string getAttributeNS([in] string namespaceURI, [in] string localName);
51 /**
52 Returns a NodeList of all descendant Elements with a given tag name,
53 in the order in which they are
54 encountered in a preorder traversal of this Element tree.
56 XNodeList getElementsByTagName([in] string name);
58 /**
59 Returns a NodeList of all the descendant Elements with a given local
60 name and namespace URI in the order in which they are encountered in
61 a preorder traversal of this Element tree.
63 XNodeList getElementsByTagNameNS([in] string namespaceURI,[in] string localName);
65 /**
66 The name of the element.
68 string getTagName();
70 /**
71 Returns true when an attribute with a given name is specified on this
72 element or has a default value, false otherwise.
74 boolean hasAttribute([in] string name);
76 /**
77 Returns true when an attribute with a given local name and namespace
78 URI is specified on this element or has a default value, false otherwise.
80 boolean hasAttributeNS([in] string namespaceURI,[in] string localName);
82 /**
83 Removes an attribute by name.
84 Throws:
85 DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
87 void removeAttribute([in] string name) raises (DOMException);
89 /**
90 Removes the specified attribute node.
91 Throws:
92 DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
93 NOT_FOUND_ERR: Raised if oldAttr is not an attribute of the element.
95 XAttr removeAttributeNode([in] XAttr oldAttr) raises (DOMException);
97 /**
98 Removes an attribute by local name and namespace URI.
99 Throws:
100 DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
102 void removeAttributeNS([in] string namespaceURI,[in] string localName) raises (DOMException);
105 Adds a new attribute.
106 Throws:
107 DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
108 NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
110 void setAttribute([in] string name,[in] string value) raises (DOMException);
113 Adds a new attribute node.
114 Throws:
115 DOMException - WRONG_DOCUMENT_ERR: Raised if newAttr was created from a different document than the one that created the element.
116 NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
117 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.
119 XAttr setAttributeNode([in] XAttr newAttr) raises (DOMException);
122 Adds a new attribute.
123 Throws:
124 DOMException - WRONG_DOCUMENT_ERR: Raised if newAttr was created from a different document than the one that created the element.
125 NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
126 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.
127 NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML" feature, since namespaces were defined by XML.
129 XAttr setAttributeNodeNS([in] XAttr newAttr) raises (DOMException);
132 Adds a new attribute.
133 Throws:
134 DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character, per the XML 1.0 specification .
135 NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
136 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/".
137 NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML" feature, since namespaces were defined by XML.
139 void setAttributeNS(
140 [in] string namespaceURI, [in] string qualifiedName, [in] string value) raises (DOMException);
142 }; }; }; }; };
144 #endif
146 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */