xref: /aoo41x/main/offapi/com/sun/star/xml/dom/XElement.idl (revision cdf0e10c)
1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
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.
14 *
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).
20 *
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.
25 *
26 ************************************************************************/
27
28#ifndef __com_sun_star_xml_dom_XElement_idl__
29#define __com_sun_star_xml_dom_XElement_idl__
30
31#ifndef __com_sun_star_xml_dom_XNode_idl__
32#include <com/sun/star/xml/dom/XNode.idl>
33#endif
34#ifndef __com_sun_star_xml_dom_XAttr_idl__
35#include <com/sun/star/xml/dom/XAttr.idl>
36#endif
37
38module com { module sun { module star { module xml { module dom {
39
40interface XElement: XNode
41{
42    /**
43    Retrieves an attribute value by name.
44    */
45    string getAttribute([in] string name);
46
47    /**
48    Retrieves an attribute node by name.
49    */
50    XAttr getAttributeNode([in] string name);
51
52    /**
53    Retrieves an Attr node by local name and namespace URI.
54    */
55    XAttr getAttributeNodeNS([in] string namespaceURI,[in]
56    string localName);
57
58    /**
59    Retrieves an attribute value by local name and namespace URI.
60    */
61    string getAttributeNS([in] string namespaceURI, [in] string localName);
62
63    /**
64    Returns a NodeList of all descendant Elements with a given tag name,
65    in the order in which they are
66    encountered in a preorder traversal of this Element tree.
67    */
68    XNodeList getElementsByTagName([in] string name);
69
70    /**
71    Returns a NodeList of all the descendant Elements with a given local
72    name and namespace URI in the order in which they are encountered in
73    a preorder traversal of this Element tree.
74    */
75    XNodeList getElementsByTagNameNS([in] string namespaceURI,[in]  string localName);
76
77    /**
78    The name of the element.
79    */
80    string getTagName();
81
82    /**
83    Returns true when an attribute with a given name is specified on this
84    element or has a default value, false otherwise.
85    */
86    boolean hasAttribute([in] string name);
87
88    /**
89    Returns true when an attribute with a given local name and namespace
90    URI is specified on this element or has a default value, false otherwise.
91    */
92    boolean hasAttributeNS([in] string namespaceURI,[in]  string localName);
93
94    /**
95    Removes an attribute by name.
96    Throws:
97    DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
98    */
99    void removeAttribute([in] string name) raises (DOMException);
100
101    /**
102    Removes the specified attribute node.
103    Throws:
104    DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
105    NOT_FOUND_ERR: Raised if oldAttr is not an attribute of the element.
106    */
107    XAttr removeAttributeNode([in] XAttr oldAttr) raises (DOMException);
108
109    /**
110    Removes an attribute by local name and namespace URI.
111    Throws:
112    DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
113    */
114    void removeAttributeNS([in] string namespaceURI,[in]  string localName) raises (DOMException);
115
116    /**
117    Adds a new attribute.
118    Throws:
119    DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character.
120    NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
121    */
122    void setAttribute([in] string name,[in]  string value) raises (DOMException);
123
124    /**
125    Adds a new attribute node.
126    Throws:
127    DOMException - WRONG_DOCUMENT_ERR: Raised if newAttr was created from a different document than the one that created the element.
128    NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
129    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.
130    */
131    XAttr setAttributeNode([in] XAttr newAttr) raises (DOMException);
132
133    /**
134    Adds a new attribute.
135    Throws:
136    DOMException - WRONG_DOCUMENT_ERR: Raised if newAttr was created from a different document than the one that created the element.
137    NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
138    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.
139    NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML" feature, since namespaces were defined by XML.
140    */
141    XAttr setAttributeNodeNS([in] XAttr newAttr) raises (DOMException);
142
143    /**
144    Adds a new attribute.
145    Throws:
146    DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character, per the XML 1.0 specification .
147    NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
148    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/".
149    NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML" feature, since namespaces were defined by XML.
150    */
151    void setAttributeNS(
152    [in] string namespaceURI, [in] string qualifiedName, [in] string value) raises (DOMException);
153};
154}; }; }; }; };
155
156#endif
157