2005/5/9

     
 

class XMLElement

artefaktur
Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

acdk::xml::dom::XMLElement Class Reference

#include <XMLElement.h>

Inheritance diagram for acdk::xml::dom::XMLElement:

acdk::xml::dom::XMLNode org::w3c::dom::Element acdk::lang::Object org::w3c::dom::Node acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch List of all members.

Detailed Description

API: org.w3c.dom<br>.

Author:
Roger Rene Kommer
Version:
Revision
1.10
Date:
Date
2005/02/05 10:45:36


Public Member Functions

 XMLElement (IN(RString) name)
RString toString ()
 return a string representation of this object Object::toString() return getName() by default

RDocument getOwnerDocument ()
 The Document object associated with this node.

 OUT (RDocument) getOwnerDocumentRef()
void setOwnerDocument (IN(RDocument) doc)
virtual RString getTagName ()
 The name of the element.

RNamedNodeMap getAttributes ()
 A NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.

virtual RString getAttribute (IN(RString) name)
 Retrieves an attribute value by name.

virtual void setAttribute (IN(RString) name, IN(RString) value) throw ( RDOMException )
 Adds a new attribute.

virtual void removeAttribute (IN(RString) name) throw ( RDOMException )
 Removes an attribute by name.

virtual RAttr getAttributeNode (IN(RString) name)
 Retrieves an attribute node by name.

virtual RAttr setAttributeNode (IN(RAttr) newAttr) throw ( RDOMException )
 Adds a new attribute node.

virtual RAttr removeAttributeNode (IN(RAttr) oldAttr) throw ( RDOMException )
 Removes the specified attribute node.

virtual RNodeList getElementsByTagName (IN(RString) name)
 Returns a NodeList of all descendant Elements with a given tag name, in document order.

virtual void normalize ()
RXMLAttrArray getAttribues ()
virtual int attributeCount ()
 dom4j like extension

virtual RAttr attribute (int idx)
 dom4j like extension

RString toXML ()
 dom4j like extension


Protected Member Functions

RXMLAttr _getAttr (IN(RString) name)
 returns Nil if not found


Protected Attributes

RXMLAttrArray _attributes
RDocument _document


Constructor & Destructor Documentation

acdk::xml::dom::XMLElement::XMLElement IN(RString name  )  [inline]
 


Member Function Documentation

RXMLAttr acdk::xml::dom::XMLElement::_getAttr IN(RString name  )  [protected]
 

returns Nil if not found

virtual RAttr acdk::xml::dom::XMLElement::attribute int  idx  )  [virtual]
 

dom4j like extension

Implements org::w3c::dom::Element.

virtual int acdk::xml::dom::XMLElement::attributeCount  )  [virtual]
 

dom4j like extension

Implements org::w3c::dom::Element.

RXMLAttrArray acdk::xml::dom::XMLElement::getAttribues  )  [inline]
 

virtual RString acdk::xml::dom::XMLElement::getAttribute IN(RString name  )  [virtual]
 

Retrieves an attribute value by name.

Parameters:
name The name of the attribute to retrieve.
Returns:
The Attr value as a string, or the empty string if that attribute does not have a specified or default value.

Implements org::w3c::dom::Element.

virtual RAttr acdk::xml::dom::XMLElement::getAttributeNode IN(RString name  )  [virtual]
 

Retrieves an attribute node by name.


To retrieve an attribute node by qualified name and namespace URI, use the getAttributeNodeNS method.

Parameters:
name The name (nodeName) of the attribute to retrieve.
Returns:
The Attr node with the specified name ( nodeName) or null if there is no such attribute.

Implements org::w3c::dom::Element.

RNamedNodeMap acdk::xml::dom::XMLElement::getAttributes  )  [virtual]
 

A NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.

Reimplemented from acdk::xml::dom::XMLNode.

virtual RNodeList acdk::xml::dom::XMLElement::getElementsByTagName IN(RString name  )  [virtual]
 

Returns a NodeList of all descendant Elements with a given tag name, in document order.

Parameters:
name The name of the tag to match on. The special value * matches all tags.
Returns:
A list of matching Element nodes.

Implements org::w3c::dom::Element.

RDocument acdk::xml::dom::XMLElement::getOwnerDocument  )  [inline, virtual]
 

The Document object associated with this node.

This is also the Document object used to create new nodes. When this node is a Document or a DocumentType which is not used with any Document yet, this is null.

Version:
DOM Level 2

Reimplemented from acdk::xml::dom::XMLNode.

virtual RString acdk::xml::dom::XMLElement::getTagName  )  [inline, virtual]
 

The name of the element.

If Node.localName is different from null, this attribute is a qualified name. For example, in:

<elementExample id=demo> ... </elementExample> ,
tagName has the value elementExample. Note that this is case-preserving in XML, as are all of the operations of the DOM. The HTML DOM returns the tagName of an HTML element in the canonical uppercase form, regardless of the case in the source HTML document.

Implements org::w3c::dom::Element.

virtual void acdk::xml::dom::XMLElement::normalize  )  [virtual]
 

Implements org::w3c::dom::Element.

acdk::xml::dom::XMLElement::OUT RDocument   )  [inline]
 

virtual void acdk::xml::dom::XMLElement::removeAttribute IN(RString name  )  throw ( RDOMException ) [virtual]
 

Removes an attribute by name.

If a default value for the removed attribute is defined in the DTD, a new attribute immediately appears with the default value as well as the corresponding namespace URI, local name, and prefix when applicable. The implementation may handle default values from other schemas similarly but applications should use Document.normalizeDocument() to guarantee this information is up-to-date.
If no attribute with this name is found, this method has no effect.
To remove an attribute by local name and namespace URI, use the removeAttributeNS method.

Parameters:
name The name of the attribute to remove.
Exceptions:
DOMException NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

Implements org::w3c::dom::Element.

virtual RAttr acdk::xml::dom::XMLElement::removeAttributeNode IN(RAttr oldAttr  )  throw ( RDOMException ) [virtual]
 

Removes the specified attribute node.

If a default value for the removed Attr node is defined in the DTD, a new node immediately appears with the default value as well as the corresponding namespace URI, local name, and prefix when applicable. The implementation may handle default values from other schemas similarly but applications should use Document.normalizeDocument() to guarantee this information is up-to-date.

Parameters:
oldAttr The Attr node to remove from the attribute list.
Returns:
The Attr node that was removed.
Exceptions:
DOMException NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NOT_FOUND_ERR: Raised if oldAttr is not an attribute of the element.

Implements org::w3c::dom::Element.

virtual void acdk::xml::dom::XMLElement::setAttribute IN(RString name,
IN(RString value
throw ( RDOMException ) [virtual]
 

Adds a new attribute.

If an attribute with that name is already present in the element, its value is changed to be that of the value parameter. This value is a simple string; it is not parsed as it is being set. So any markup (such as syntax to be recognized as an entity reference) is treated as literal text, and needs to be appropriately escaped by the implementation when it is written out. In order to assign an attribute value that contains entity references, the user must create an Attr node plus any Text and EntityReference nodes, build the appropriate subtree, and use setAttributeNode to assign it as the value of an attribute.
To set an attribute with a qualified name and namespace URI, use the setAttributeNS method.

Parameters:
name The name of the attribute to create or alter.
value Value to set in string form.
Exceptions:
DOMException INVALID_CHARACTER_ERR: Raised if the specified name is not an XML name according to the XML version in use specified in the Document.xmlVersion attribute.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

Implements org::w3c::dom::Element.

virtual RAttr acdk::xml::dom::XMLElement::setAttributeNode IN(RAttr newAttr  )  throw ( RDOMException ) [virtual]
 

Adds a new attribute node.

If an attribute with that name ( nodeName) is already present in the element, it is replaced by the new one. Replacing an attribute node by itself has no effect.
To add a new attribute node with a qualified name and namespace URI, use the setAttributeNodeNS method.

Parameters:
newAttr The Attr node to add to the attribute list.
Returns:
If the newAttr attribute replaces an existing attribute, the replaced Attr node is returned, otherwise null is returned.
Exceptions:
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.

Implements org::w3c::dom::Element.

void acdk::xml::dom::XMLElement::setOwnerDocument IN(RDocument doc  )  [inline]
 

RString acdk::xml::dom::XMLElement::toString  )  [inline, virtual]
 

return a string representation of this object Object::toString() return getName() by default

Reimplemented from acdk::lang::Object.

RString acdk::xml::dom::XMLElement::toXML  )  [inline, virtual]
 

dom4j like extension

Todo:
implement in derived interfaces

Reimplemented from acdk::xml::dom::XMLNode.


Member Data Documentation

RXMLAttrArray acdk::xml::dom::XMLElement::_attributes [protected]
 

RDocument acdk::xml::dom::XMLElement::_document [protected]