Unicorn XML Toolkit
Version 1.50.00

Namespace Dom
Class IElement

class IElement: public INode {
public:
    const WCHAR *GetTagName();
public:
    const WCHAR *GetAttribute(const WCHAR *pszName);
    void SetAttribute(
        const WCHAR *pszName, 
        const WCHAR *pszValue);
    void RemoveAttribute(const WCHAR *pszName);
    XAttr GetAttributeNode(const WCHAR *pszName);
    XAttr SetAttributeNode(IAttr *pNewAttr);
    XAttr RemoveAttributeNode(IAttr *pOldAttr);
    XNodeList GetElementsByTagName(const WCHAR *pszTagName);
    const WCHAR *GetNamespace(const WCHAR *pszName);
    void SetNamespace(
        const WCHAR *pszName, 
        const WCHAR *pszValue);
    void RemoveNamespace(const WCHAR *pszName);
    XNamespace GetNamespaceNode(const WCHAR *pszName);
    XNamespace SetNamespaceNode(INamespace *pNewNs);
    XNamespace RemoveNamespaceNode(INamespace *pOldNs);
    };
typedef XRefCnt<IElement> XElement;

The element node.

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

Since:
1.00.00
Version:
1.50.00
Author:
Alexey Gokhberg
See Also:
INodeList, IAttr, INamespace
Function Summary
const�WCHAR�* GetTagName ();
����������Returns the tag name of this element.
const�WCHAR�* GetAttribute (const WCHAR *pszName);
����������Returns the value of the attribute on this element, with the attribute name specified by pszName .
void SetAttribute (const WCHAR *pszName, const WCHAR *pszValue);
����������Sets an attribute on this element, with the attribute name specified by pszName and the attribute value specified by pszValue .
void RemoveAttribute (const WCHAR *pszName);
����������Removes an attribute on this element, with the attribute name specified by pszName .
XAttr GetAttributeNode (const WCHAR *pszName);
����������Returns the attribute node on this element, with the attribute name specified by pszName .
XAttr SetAttributeNode (IAttr *pNewAttr);
����������Sets the attribute node specified by pNewAttr on this element.
XAttr RemoveAttributeNode (IAttr *pOldAttr);
����������Removes the attribute node specified by pOldAttr from the attribute list of this element.
XNodeList GetElementsByTagName (const WCHAR *pszTagName);
����������Returns the list of all descendant elements of this element, having the tag name specified by pszTagName .
const�WCHAR�* GetNamespace (const WCHAR *pszName);
����������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 WCHAR *pszName, const WCHAR *pszValue);
����������Sets a namespace declaration on this element, with the namespace prefix specified by pszName and the namespace URI specified by pszValue .
void RemoveNamespace (const WCHAR *pszName);
����������Removes a namespace declaration on this element, with the namespace prefix specified by pszName .
XNamespace GetNamespaceNode (const WCHAR *pszName);
����������Returns a namespace node declared on this element, with the namespace prefix specified by pszName .
XNamespace SetNamespaceNode (INamespace *pNewNs);
����������Sets the namespace declaration specified by pNewNs on this element.
XNamespace RemoveNamespaceNode (INamespace *pOldNs);
����������Removes the namespace node specified by pOldNs from the namespace list of this element.

Function Detail

GetTagName

const WCHAR *GetTagName();

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

const WCHAR *GetAttribute(const WCHAR *pszName);

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

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

Parameters:
pszName - 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

void SetAttribute(
    const WCHAR *pszName, 
    const WCHAR *pszValue);

Sets an attribute on this element, with the attribute name specified by pszName and the attribute value specified by pszValue .

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

This method is not supported by XDM.

Parameters:
pszName - the attribute name
pszValue - the attribute value

RemoveAttribute

void RemoveAttribute(const WCHAR *pszName);

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

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

Parameters:
pszName - the attribute name

GetAttributeNode

XAttr GetAttributeNode(const WCHAR *pszName);

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

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

This method is not supported by XDM.

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

SetAttributeNode

XAttr SetAttributeNode(IAttr *pNewAttr);

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.

This method is not supported by XDM.

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

RemoveAttributeNode

XAttr RemoveAttributeNode(IAttr *pOldAttr);

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.

This method is not supported by XDM.

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

GetElementsByTagName

XNodeList GetElementsByTagName(const WCHAR *pszTagName);

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

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

At present this method is not implemented for any document model.

Parameters:
pszTagName - 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

const WCHAR *GetNamespace(const WCHAR *pszName);

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.

This method is not supported by DOM.

Parameters:
pszName - 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

void SetNamespace(
    const WCHAR *pszName, 
    const WCHAR *pszValue);

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

This is an extension XDM method which has no equivalent in DOM.

At present this method is not implemented for any document model.

Parameters:
pszName - the namespace prefix
pszValue - the namespace URI

RemoveNamespace

void RemoveNamespace(const WCHAR *pszName);

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

This is an extension XDM method which has no equivalent in DOM.

At present this method is not implemented for any document model.

Parameters:
pszName - the namespace prefix

GetNamespaceNode

XNamespace GetNamespaceNode(const WCHAR *pszName);

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

This is an extension XDM method which has no equivalent in DOM.

This method is not supported by DOM.

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

SetNamespaceNode

XNamespace SetNamespaceNode(INamespace *pNewNs);

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.

At present this method is not supported for any document model.

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

RemoveNamespaceNode

XNamespace RemoveNamespaceNode(INamespace *pOldNs);

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.

At present this method is not supported for any document model.

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

Unicorn XML Toolkit
Version 1.50.00


This document was created using Unicorn DOC++.

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