Unicorn XML Toolkit
Version 1.00.00

Namespace Dom
Class IElement

class IElement: virtual public INode {
public:
    IElement();
    virtual ~IElement();
public:
    virtual CString GetTagName() = 0;
public:
    virtual CString GetAttribute(const CString &strName) = 0;
    virtual void SetAttribute(
        const CString &strName, 
        const CString &strValue) = 0;
    virtual void RemoveAttribute(const CString &strName) = 0;
    virtual XAttr GetAttributeNode(const CString &strName) = 0;
    virtual XAttr SetAttributeNode(const XAttr &pNewAttr) = 0;
    virtual XAttr RemoveAttributeNode(const XAttr &pOldAttr) = 0;
    virtual XNodeList GetElementsByTagName(
        const CString &strTagName) = 0;
    virtual CString GetNamespace(const CString &strName) = 0;
    virtual void SetNamespace(
        const CString &strName, 
        const CString &strValue) = 0;
    virtual void RemoveNamespace(const CString &strName) = 0;
    virtual XNamespace GetNamespaceNode(const CString &strName) = 0;
    virtual XNamespace SetNamespaceNode(
        const XNamespace &pNewNs) = 0;
    virtual XNamespace RemoveNamespaceNode(
        const XNamespace &pOldNs) = 0;
    };

The element node.

This class implements the C++ binding for the Element interface specified by DOM.

Since:
1.00.00
Version:
1.00.00
Author:
Alexey Gokhberg
See Also:
INodeList, IAttr, INamespace
Constructor/Destructor Summary
IElement ();
����������Constructs the element.
~IElement ();
����������Destroys the element.

Function Summary
CString GetTagName ();
����������Returns the tag name of this element.
CString GetAttribute (const CString &strName);
����������Returns the value of the attribute on this element, with the attribute name specified by strName .
void SetAttribute (const CString &strName, const CString &strValue);
����������Sets an attribute on this element, with the attribute name specified by strName and the attribute value specified by strValue .
void RemoveAttribute (const CString &strName);
����������Removes an attribute on this element, with the attribute name specified by strName .
XAttr GetAttributeNode (const CString &strName);
����������Returns the attribute node on this element, with the attribute name specified by strName .
XAttr SetAttributeNode (const XAttr &pNewAttr);
����������Sets the attribute node specified by pNewAttr on this element.
XAttr RemoveAttributeNode (const XAttr &pOldAttr);
����������Removes the attribute node specified by pOldAttr from the attribute list of this element.
XNodeList GetElementsByTagName (const CString &strTagName);
����������Returns the list of all descendant elements of this element, having the tag name specified by strTagName .
CString GetNamespace (const CString &strName);
����������Looks up the namespace prefix in the list of namespaces declared on this element; if found, returns the namespace URI bound to the specified namespace prefix.
void SetNamespace (const CString &strName, const CString &strValue);
����������Sets a namespace declaration on this element, with the namespace prefix specified by strName and the namespace URI specified by strValue .
void RemoveNamespace (const CString &strName);
����������Removes a namespace declaration on this element, with the namespace prefix specified by strName .
XNamespace GetNamespaceNode (const CString &strName);
����������Returns a namespace node declared on this element, with the namespace prefix specified by strName .
XNamespace SetNamespaceNode (const XNamespace &pNewNs);
����������Sets the namespace declaration specified by pNewNs on this element.
XNamespace RemoveNamespaceNode (const XNamespace &pOldNs);
����������Removes the namespace node specified by pOldNs from the namespace list of this element.

Constructor/Destructor Detail

IElement

IElement();

Constructs the element.

~IElement

virtual ~IElement();

Destroys the element.

Function Detail

GetTagName

virtual CString GetTagName() = 0;

Returns the tag name of this element.

This method implements the C++ binding for the tagName attribute specified by DOM.

Returns:
the tag name of this element

GetAttribute

virtual CString GetAttribute(const CString &strName) = 0;

Returns the value of the attribute on this element, with the attribute name specified by strName .

This method implements the C++ binding for the getAttribute operation specified by DOM.

Parameters:
strName - the attribute name
Returns:
the value of the attribute on this element, having the requested name, or the empty string if there is no such attribute

SetAttribute

virtual void SetAttribute(
    const CString &strName, 
    const CString &strValue) = 0;

Sets an attribute on this element, with the attribute name specified by strName and the attribute value specified by strValue .

This method implements the C++ binding for the setAttribute operation specified by DOM.

Parameters:
strName - the attribute name
strValue - the attribute value

RemoveAttribute

virtual void RemoveAttribute(const CString &strName) = 0;

Removes an attribute on this element, with the attribute name specified by strName .

This method implements the C++ binding for the removeAttribute operation specified by DOM.

Parameters:
strName - the attribute name

GetAttributeNode

virtual XAttr GetAttributeNode(const CString &strName) = 0;

Returns the attribute node on this element, with the attribute name specified by strName .

This method implements the C++ binding for the getAttributeNode operation specified by DOM.

Parameters:
strName - the attribute name
Returns:
the attribute node on this element, having the name specified, or NULL if there is no such attribute

SetAttributeNode

virtual XAttr SetAttributeNode(const XAttr &pNewAttr) = 0;

Sets the attribute node specified by pNewAttr on this element.

If the attribute node with the same name is already defined on the element, it is replaced.

This method implements the C++ binding for the setAttributeNode operation specified by DOM.

Parameters:
pNewAttr - the attribute node to set
Returns:
the replaced attribute node, if the replacement took place; NULL otherwise

RemoveAttributeNode

virtual XAttr RemoveAttributeNode(const XAttr &pOldAttr) = 0;

Removes the attribute node specified by pOldAttr from the attribute list of this element.

This method implements the C++ binding for the removeAttributeNode operation specified by DOM.

Parameters:
pOldAttr - the attribute node to remove
Returns:
the removed attribute node (that referenced by pOldAttr )

GetElementsByTagName

virtual XNodeList GetElementsByTagName(
    const CString &strTagName) = 0;

Returns the list of all descendant elements of this element, having the tag name specified by strTagName .

This method implements the C++ binding for the getElementsByTagName operation specified by DOM.

Parameters:
strTagName - the element tag name, or the special value of "*" to select all descendant elements
Returns:
the list of selected elements, in the order established by the preorder traversal of the document tree

GetNamespace

virtual CString GetNamespace(const CString &strName) = 0;

Looks up the namespace prefix in the list of namespaces declared on this element; if found, returns the namespace URI bound to the specified namespace prefix.

This is an extension XDM method which has no equivalent in DOM. It is applicable only to element nodes that support XDM extensions.

Parameters:
strName - the namespace prefix to look up
Returns:
the namespace URI bound to the requested namespace prefix, or the empty string if the prefix is not declared on this element

SetNamespace

virtual void SetNamespace(
    const CString &strName, 
    const CString &strValue) = 0;

Sets a namespace declaration on this element, with the namespace prefix specified by strName and the namespace URI specified by strValue .

This is an extension XDM method which has no equivalent in DOM. It is applicable only to element nodes that support XDM extensions.

Parameters:
strName - the namespace prefix
strValue - the namespace URI

RemoveNamespace

virtual void RemoveNamespace(const CString &strName) = 0;

Removes a namespace declaration on this element, with the namespace prefix specified by strName .

This is an extension XDM method which has no equivalent in DOM. It is applicable only to element nodes that support XDM extensions.

Parameters:
strName - the namespace prefix

GetNamespaceNode

virtual XNamespace GetNamespaceNode(const CString &strName) = 0;

Returns a namespace node declared on this element, with the namespace prefix specified by strName .

This is an extension XDM method which has no equivalent in DOM. It is applicable only to element nodes that support XDM extensions.

Parameters:
strName - the namespace prefix
Returns:
the namespace node on this element, having the prefix specified; NULL if there is no such namespace

SetNamespaceNode

virtual XNamespace SetNamespaceNode(
    const XNamespace &pNewNs) = 0;

Sets the namespace declaration specified by pNewNs on this element.

If a namespace node with the same prefix is already defined on this element, it is replaced.

This is an extension XDM method which has no equivalent in DOM. It is applicable only to element nodes that support XDM extensions.

Parameters:
pNewAttr - the namespace node to set
Returns:
the replaced namespace node, if the replacement took place; NULL otherwise

RemoveNamespaceNode

virtual XNamespace RemoveNamespaceNode(
    const XNamespace &pOldNs) = 0;

Removes the namespace node specified by pOldNs from the namespace list of this element.

This is an extension XDM method which has no equivalent in DOM. It is applicable only to element nodes that support XDM extensions.

Parameters:
pOldNs - the namespace node to remove
Returns:
the removed namespace node (that referenced by pOldNs )

Unicorn XML Toolkit
Version 1.00.00


This document was created using Unicorn DOC++.

Copyright 1999-2001 Unicorn Enterprises SA.
All Rights Reserved.