Unicorn XML Toolkit
Version 1.50.00

Namespace Dom
Class IDocument

class IDocument: public INode {
public:
    XDocumentType GetDoctype();
    XDomImplementation GetImplementation();
    XElement GetDocumentElement();
    const WCHAR *GetClass();
public:
    XElement CreateElement(const WCHAR *pszTagName);
    XDocumentFragment CreateDocumentFragment();
    XText CreateTextNode(const WCHAR *pszData);
    XComment CreateComment(const WCHAR *pszData);
    XCdataSection CreateCdataSection(const WCHAR *pszData);
    XProcessingInstruction CreateProcessingInstruction(
        const WCHAR *pszTarget, 
        const WCHAR *pszData);
    XAttr CreateAttribute(const WCHAR *pszName);
    XEntityReference CreateEntityReference(const WCHAR *pszName);
    XNodeList GetElementsByTagName(const WCHAR *pszTagName);
    XNamespace CreateNamespace(const WCHAR *pszName);
    };
typedef XRefCnt<IDocument> XDocument;

The entire XML document.

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

Since:
1.00.00
Version:
1.50.00
Author:
Alexey Gokhberg
See Also:
INodeList, IDomImplementation, IDocumentFragment, IAttr, IElement, IText, IComment, IDoctype, INode, IEntityReference, IProcessingInstruction, INamespace
Function Summary
XDocumentType GetDoctype ();
����������Returns the document type object associated with this document.
XDomImplementation GetImplementation ();
����������Returns the DOM implementation object associated with this document.
XElement GetDocumentElement ();
����������Returns the document element of this document.
const�WCHAR�* GetClass ();
����������Returns the string identifying the class of this document.
XElement CreateElement (const WCHAR *pszTagName);
����������Creates a new element with the tag name specified by pszTagName .
XDocumentFragment CreateDocumentFragment ();
����������Creates a document fragment.
XText CreateTextNode (const WCHAR *pszData);
����������Creates a new text node with the content specified by pszData .
XComment CreateComment (const WCHAR *pszData);
����������Creates a new comment with the content specified by pszData .
XCdataSection CreateCdataSection (const WCHAR *pszData);
����������Creates a new CDATA section with the content specified by pszData .
XProcessingInstruction CreateProcessingInstruction (const WCHAR *pszTarget, const WCHAR *pszData);
����������Creates a new processing instruction with the target specified by pszTarget and the data specified by pszData .
XAttr CreateAttribute (const WCHAR *pszName);
����������Creates a new attribute with the name specified by pszName .
XEntityReference CreateEntityReference (const WCHAR *pszName);
����������Creates a new entity reference with the name specified by pszName .
XNodeList GetElementsByTagName (const WCHAR *pszTagName);
����������Returns the list of all elements having the tag name specified by pszTagName .
XNamespace CreateNamespace (const WCHAR *pszName);
����������Creates a new namespace node with the namespace prefix specified by pszName .

Function Detail

GetDoctype

XDocumentType GetDoctype();

Returns the document type object associated with this document.

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

Returns:
the document type object associated with this document, or NULL if the document type is not available

GetImplementation

XDomImplementation GetImplementation();

Returns the DOM implementation object associated with this document.

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

This method is not supported by XDM.

Returns:
the DOM implementation object associated with this document

GetDocumentElement

XElement GetDocumentElement();

Returns the document element of this document.

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

Returns:
the document element of this document, or NULL if the document element is not yet available (for example, when the document is under construction)

GetClass

const WCHAR *GetClass();

Returns the string identifying the class of this document.

This method has no equivalent in DOM.

Returns:
the string "DOM" if this document implements DOM, and the string "XPath" if this document implements XDM

CreateElement

XElement CreateElement(const WCHAR *pszTagName);

Creates a new element with the tag name specified by pszTagName .

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

This method is not supported by XDM.

Parameters:
pszTagName - the element tag name
Returns:
the newly created element

CreateDocumentFragment

XDocumentFragment CreateDocumentFragment();

Creates a document fragment.

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

This method is not supported by XDM.

Returns:
the newly created document fragment

CreateTextNode

XText CreateTextNode(const WCHAR *pszData);

Creates a new text node with the content specified by pszData .

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

This method is not supported by XDM.

Parameters:
pszData - the content of the text node
Returns:
the newly created text node

CreateComment

XComment CreateComment(const WCHAR *pszData) = 0;

Creates a new comment with the content specified by pszData .

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

This method is not supported by XDM.

Parameters:
pszData - the content of the comment
Returns:
the newly created comment

CreateCdataSection

XCdataSection CreateCdataSection(const WCHAR *pszData);

Creates a new CDATA section with the content specified by pszData .

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

This method is not supported by XDM.

Parameters:
pszData - the content of the CDATA section
Returns:
the newly created CDATA section

CreateProcessingInstruction

XProcessingInstruction CreateProcessingInstruction(
    const WCHAR *pszTarget, 
    const WCHAR *pszData);

Creates a new processing instruction with the target specified by pszTarget and the data specified by pszData .

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

This method is not supported by XDM.

Parameters:
pszTarget - the processing instruction target
pszData - the processing instruction data (empty string if no data required)
Returns:
the newly created processing instruction

CreateAttribute

XAttr CreateAttribute(const WCHAR *pszName);

Creates a new attribute with the name specified by pszName .

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

This method is not supported by XDM.

Parameters:
pszName - the attribute name
Returns:
the newly created attribute

CreateEntityReference

XEntityReference CreateEntityReference(const WCHAR *pszName);

Creates a new entity reference with the name specified by pszName .

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

This method is not supported by XDM.

Parameters:
pszName - the entity reference name
Returns:
the newly created entity reference

GetElementsByTagName

XNodeList GetElementsByTagName(const WCHAR *pszTagName);

Returns the list of all elements 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 document elements
Returns:
the list of selected elements, in order established by the preorder traversal of the document tree

CreateNamespace

XNamespace CreateNamespace(const WCHAR *pszName);

Creates a new namespace node with the namespace prefix specified by pszName .

This extension XDM method has no direct equivalent in DOM.

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

Parameters:
pszName - the namespace prefix
Returns:
the newly created namespace node

Unicorn XML Toolkit
Version 1.50.00


This document was created using Unicorn DOC++.

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