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