Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


:: com :: sun :: star :: xml :: dom ::

interface XElement
Base Interfaces
XElementXNode

XNode
(referenced interface's summary:)
The primary dom datatype

Methods' Summary
getAttribute Retrieves an attribute value by name.  
getAttributeNode Retrieves an attribute node by name.  
getAttributeNodeNS Retrieves an Attr node by local name and namespace URI.  
getAttributeNS Retrieves an attribute value by local name and namespace URI.  
getElementsByTagName Returns a NodeList of all descendant Elements with a given tag name, in the order in which they are encountered in a preorder traversal of this Element tree.  
getElementsByTagNameNS Returns a NodeList of all the descendant Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of this Element tree.  
getTagName The name of the element.  
hasAttribute Returns true when an attribute with a given name is specified on this element or has a default value, false otherwise.  
hasAttributeNS Returns true when an attribute with a given local name and namespace URI is specified on this element or has a default value, false otherwise.  
removeAttribute Removes an attribute by name. Throws: DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.  
removeAttributeNode Removes the specified attribute node. Throws: DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. NOT_FOUND_ERR: Raised if oldAttr is not an attribute of the element.  
removeAttributeNS Removes an attribute by local name and namespace URI. Throws: DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.  
setAttribute Adds a new attribute. Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character. NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.  
setAttributeNode Adds a new attribute node. Throws: DOMException - WRONG_DOCUMENT_ERR: Raised if newAttr was created from a different document than the one that created the element. NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 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.  
setAttributeNodeNS Adds a new attribute. Throws: DOMException - WRONG_DOCUMENT_ERR: Raised if newAttr was created from a different document than the one that created the element. NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 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. NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML" feature, since namespaces were defined by XML.  
setAttributeNS Adds a new attribute. Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character, per the XML 1.0 specification . NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 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/". NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML" feature, since namespaces were defined by XML.  
Methods' Details
getAttribute
string
getAttribute( [in] string  name );

Description
Retrieves an attribute value by name.
getAttributeNode
XAttr
getAttributeNode( [in] string  name );

Description
Retrieves an attribute node by name.
getAttributeNodeNS
XAttr
getAttributeNodeNS( [in] string  namespaceURI,
[in] string  localName );

Description
Retrieves an Attr node by local name and namespace URI.
getAttributeNS
string
getAttributeNS( [in] string  namespaceURI,
[in] string  localName );

Description
Retrieves an attribute value by local name and namespace URI.
getElementsByTagName
XNodeList
getElementsByTagName( [in] string  name );

Description
Returns a NodeList of all descendant Elements with a given tag name, in the order in which they are encountered in a preorder traversal of this Element tree.
getElementsByTagNameNS
XNodeList
getElementsByTagNameNS( [in] string  namespaceURI,
[in] string  localName );

Description
Returns a NodeList of all the descendant Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of this Element tree.
getTagName
string
getTagName();

Description
The name of the element.
hasAttribute
boolean
hasAttribute( [in] string  name );

Description
Returns true when an attribute with a given name is specified on this element or has a default value, false otherwise.
hasAttributeNS
boolean
hasAttributeNS( [in] string  namespaceURI,
[in] string  localName );

Description
Returns true when an attribute with a given local name and namespace URI is specified on this element or has a default value, false otherwise.
removeAttribute
void
removeAttribute( [in] string  name )
raises( DOMException );

Description
Removes an attribute by name. Throws: DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
removeAttributeNode
XAttr
removeAttributeNode( [in] XAttr  oldAttr )
raises( DOMException );

Description
Removes the specified attribute node. Throws: DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. NOT_FOUND_ERR: Raised if oldAttr is not an attribute of the element.
removeAttributeNS
void
removeAttributeNS( [in] string  namespaceURI,
[in] string  localName )
raises( DOMException );

Description
Removes an attribute by local name and namespace URI. Throws: DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
setAttribute
void
setAttribute( [in] string  name,
[in] string  value )
raises( DOMException );

Description
Adds a new attribute. Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character. NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
setAttributeNode
XAttr
setAttributeNode( [in] XAttr  newAttr )
raises( DOMException );

Description
Adds a new attribute node. Throws: DOMException - WRONG_DOCUMENT_ERR: Raised if newAttr was created from a different document than the one that created the element. NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 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.
setAttributeNodeNS
XAttr
setAttributeNodeNS( [in] XAttr  newAttr )
raises( DOMException );

Description
Adds a new attribute. Throws: DOMException - WRONG_DOCUMENT_ERR: Raised if newAttr was created from a different document than the one that created the element. NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 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. NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML" feature, since namespaces were defined by XML.
setAttributeNS
void
setAttributeNS( [in] string  namespaceURI,
[in] string  qualifiedName,
[in] string  value )
raises( DOMException );

Description
Adds a new attribute. Throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character, per the XML 1.0 specification . NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 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/". NOT_SUPPORTED_ERR: Always thrown if the current document does not support the "XML" feature, since namespaces were defined by XML.
Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.