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