xref: /aoo4110/main/offapi/com/sun/star/xml/dom/XElement.idl (revision b1cdbd2c)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24#ifndef __com_sun_star_xml_dom_XElement_idl__
25#define __com_sun_star_xml_dom_XElement_idl__
26
27#ifndef __com_sun_star_xml_dom_XNode_idl__
28#include <com/sun/star/xml/dom/XNode.idl>
29#endif
30#ifndef __com_sun_star_xml_dom_XAttr_idl__
31#include <com/sun/star/xml/dom/XAttr.idl>
32#endif
33
34module com { module sun { module star { module xml { module dom {
35
36interface XElement: XNode
37{
38    /**
39    Retrieves an attribute value by name.
40    */
41    string getAttribute([in] string name);
42
43    /**
44    Retrieves an attribute node by name.
45    */
46    XAttr getAttributeNode([in] string name);
47
48    /**
49    Retrieves an Attr node by local name and namespace URI.
50    */
51    XAttr getAttributeNodeNS([in] string namespaceURI,[in]
52    string localName);
53
54    /**
55    Retrieves an attribute value by local name and namespace URI.
56    */
57    string getAttributeNS([in] string namespaceURI, [in] string localName);
58
59    /**
60    Returns a NodeList of all descendant Elements with a given tag name,
61    in the order in which they are
62    encountered in a preorder traversal of this Element tree.
63    */
64    XNodeList getElementsByTagName([in] string name);
65
66    /**
67    Returns a NodeList of all the descendant Elements with a given local
68    name and namespace URI in the order in which they are encountered in
69    a preorder traversal of this Element tree.
70    */
71    XNodeList getElementsByTagNameNS([in] string namespaceURI,[in]  string localName);
72
73    /**
74    The name of the element.
75    */
76    string getTagName();
77
78    /**
79    Returns true when an attribute with a given name is specified on this
80    element or has a default value, false otherwise.
81    */
82    boolean hasAttribute([in] string name);
83
84    /**
85    Returns true when an attribute with a given local name and namespace
86    URI is specified on this element or has a default value, false otherwise.
87    */
88    boolean hasAttributeNS([in] string namespaceURI,[in]  string localName);
89
90    /**
91    Removes an attribute by name.
92    Throws:
93    DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
94    */
95    void removeAttribute([in] string name) raises (DOMException);
96
97    /**
98    Removes the specified attribute node.
99    Throws:
100    DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
101    NOT_FOUND_ERR: Raised if oldAttr is not an attribute of the element.
102    */
103    XAttr removeAttributeNode([in] XAttr oldAttr) raises (DOMException);
104
105    /**
106    Removes an attribute by local name and namespace URI.
107    Throws:
108    DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
109    */
110    void removeAttributeNS([in] string namespaceURI,[in]  string localName) raises (DOMException);
111
112    /**
113    Adds a new attribute.
114    Throws:
115    DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
116    NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
117    */
118    void setAttribute([in] string name,[in]  string value) raises (DOMException);
119
120    /**
121    Adds a new attribute node.
122    Throws:
123    DOMException - WRONG_DOCUMENT_ERR: Raised if newAttr was created from a different document than the one that created the element.
124    NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
125    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.
126    */
127    XAttr setAttributeNode([in] XAttr newAttr) raises (DOMException);
128
129    /**
130    Adds a new attribute.
131    Throws:
132    DOMException - WRONG_DOCUMENT_ERR: Raised if newAttr was created from a different document than the one that created the element.
133    NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
134    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.
135    NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML" feature, since namespaces were defined by XML.
136    */
137    XAttr setAttributeNodeNS([in] XAttr newAttr) raises (DOMException);
138
139    /**
140    Adds a new attribute.
141    Throws:
142    DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character, per the XML 1.0 specification .
143    NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
144    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/".
145    NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML" feature, since namespaces were defined by XML.
146    */
147    void setAttributeNS(
148    [in] string namespaceURI, [in] string qualifiedName, [in] string value) raises (DOMException);
149};
150}; }; }; }; };
151
152#endif
153