All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

XMLParser Interface CATIDOMDocument

System.IUnknown
  |
  +---System.IDispatch
    |
    +---System.CATBaseUnknown
      |
      +---XMLParser.CATIDOMNode
        |
        +---CATIDOMDocument
 

Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.


interface CATIDOMDocument

Interface to refer to XML Document nodes in the DOM.
Conceptually, a DOM document node is the root of the document tree, and provides the primary access to the document's data.

Since elements, text nodes, comments, processing instructions, etc. cannot exist outside the context of a CATIDOMDocument, the CATIDOMDocument interface also contains the factory methods needed to create these objects. The CATIDOMNode objects created have a CATIDOMNode.GetOwnerDocument method which associates them with the CATIDOMDocument within whose context they were created.


Method Index


o CreateAttribute(CATUnicodeString&,CATIDOMAttr_var&)
Creates a CATIDOMAttr of the given name.
o CreateAttributeNS(CATUnicodeString&,CATUnicodeString&,CATIDOMAttr_var&)
Creates an attribute of the given qualified name and namespace URI.
o CreateCDATASection(CATUnicodeString&,CATIDOMCDATASection_var&)
Creates a CATIDOMCDATASection node whose value is the specified string.
o CreateComment(CATUnicodeString&,CATIDOMComment_var&)
Creates a CATIDOMComment node given the specified string.
o CreateDocumentFragment(CATIDOMDocumentFragment_var&)
Creates an empty CATIDOMDocumentFragment object.
o CreateElement(CATUnicodeString&,CATIDOMElement_var&)
Creates an element of the type specified.
o CreateElementNS(CATUnicodeString&,CATUnicodeString&,CATIDOMElement_var&)
Creates an element of the given qualified name and namespace URI.
o CreateEntityReference(CATUnicodeString&,CATIDOMEntityReference_var&)
Creates a CATIDOMEntityReference object.
o CreateProcessingInstruction(CATUnicodeString&,CATUnicodeString&,CATIDOMProcessingInstruction_var&)
Creates a CATIDOMProcessingInstruction node given the specified name and data strings.
o CreateTextNode(CATUnicodeString&,CATIDOMText_var&)
Creates a CATIDOMText node given the specified string.
o GetDocType(CATIDOMDocumentType_var&)
Retrieves the Document Type Declaration associated with this document.
o GetDocumentElement(CATIDOMElement_var&)
Retrieves a reference to the root element of the document.
o GetElementById(CATUnicodeString&,CATIDOMElement_var&)
Retrieves the CATIDOMElement whose ID is given by iElementId.
o GetElementsByTagName(CATUnicodeString&,CATIDOMNodeList_var&)
Retrieves a CATIDOMNodeList of all the elements with a given tag name.
o GetElementsByTagNameNS(CATUnicodeString&,CATUnicodeString&,CATIDOMNodeList_var&)
Retrieves a CATIDOMNodeList of all the CATIDOMElements with a given local name and namespace URI.
o GetImplementation(CATIDOMImplementation_var&)
Return the CATIDOMImplementation object that handles this document.
o ImportNode(CATIDOMNode_var&,CATBoolean&,CATIDOMNode_var&)
Imports a copy of a node from another document into this document.

Methods


o CreateAttribute
public virtual HRESULT CreateAttribute( const CATUnicodeString& iName,
CATIDOMAttr_var& oAttribute) = 0
Creates a CATIDOMAttr of the given name. Note that the CATIDOMAttr instance can then be attached to a CATIDOMElement using the CATIDOMElement.SetAttribute method.
Parameters:
iName
The name of the attribute.
oAttribute
A
CATIDOMAttr that references the newly created Attr.
Errors Returned:
Error Class Error Id Description
CATDOMException XMLParserERR_2205 INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.
See also:
CATIDOMAttr
o CreateAttributeNS
public virtual HRESULT CreateAttributeNS( const CATUnicodeString& iNamespaceURI,
const CATUnicodeString& iQualifiedName,
CATIDOMAttr_var& oAttribute) = 0
Creates an attribute of the given qualified name and namespace URI.
Parameters:
iNamespaceURI
The namespace URI of the attribute to create. When it is an empty
CATUnicodeString, this method behaves like CreateAttribute.
iQualifiedName
The qualified name of the attribute type to instantiate.
oAttribute
A new
CATIDOMAttr object. The attribute has the following characteristics:
Attribute Value
CATIDOMNode.GetNodeName iQualifiedName
CATIDOMNode.GetNamespaceURI iNamespaceURI
CATIDOMNode.GetPrefix prefix, extracted from iQualifiedName, or an empty CATUnicodeString if there is no prefix
CATIDOMNode.GetLocalName local name, extracted from iQualifiedName
CATIDOMAttr.GetName iQualifiedName
CATIDOMNode.GetNodeValue the empty CATUnicodeString
Errors Returned:
Error Class Error Id Description
CATDOMException XMLParserERR_2205 INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.
o CreateCDATASection
public virtual HRESULT CreateCDATASection( const CATUnicodeString& iData,
CATIDOMCDATASection_var& oCDDataSection) = 0
Creates a CATIDOMCDATASection node whose value is the specified string.
Parameters:
iData
The data for the
CATIDOMCDATASection contents.
oCDDataSection
A
CATIDOMCDATASection object.
Errors Returned:
Error Class Error Id Description
CATDOMException XMLParserERR_2209 NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
See also:
CATIDOMCDATASection
o CreateComment
public virtual HRESULT CreateComment( const CATUnicodeString& iData,
CATIDOMComment_var& oComment) = 0
Creates a CATIDOMComment node given the specified string.
Parameters:
iData
The data for the comment.
oComment
A
CATIDOMComment that references the newly created comment node.
See also:
CATIDOMComment
o CreateDocumentFragment
public virtual HRESULT CreateDocumentFragment(CATIDOMDocumentFragment_var& oDocumentFragment) = 0
Creates an empty CATIDOMDocumentFragment object.
Parameters:
oDocumentFragment
A
CATIDOMDocumentFragment that references the newly created document fragment.
See also:
CATIDOMDocumentFragment
o CreateElement
public virtual HRESULT CreateElement( const CATUnicodeString& iTagName,
CATIDOMElement_var& oElement) = 0
Creates an element of the type specified. Note that the instance returned implements the CATIDOMElement interface, so attributes can be specified directly on the returned object.
Parameters:
iTagName
The name of the element type to instantiate.
oElement
A
CATIDOMElement that references the new element.
Errors Returned:
Error Class Error Id Description
CATDOMException XMLParserERR_2205 INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.
See also:
CATIDOMElement
o CreateElementNS
public virtual HRESULT CreateElementNS( const CATUnicodeString& iNamespaceURI,
const CATUnicodeString& iQualifiedName,
CATIDOMElement_var& oElementNS) = 0
Creates an element of the given qualified name and namespace URI.
Parameters:
iNamespaceURI
The namespace URI of the element to create. When it is an empty
CATUnicodeString, this method behaves like CreateElement.
iQualifiedName
The qualified name of the element type to instantiate.
oElementNS
A new
CATIDOMElement object. The element has the following characteristics:
Attribute Value
CATIDOMNode.GetNodeName iQualifiedName
CATIDOMNode.GetNamespaceURI iNamespaceURI
CATIDOMNode.GetPrefix prefix, extracted from iQualifiedName, or an empty CATUnicodeString if there is no prefix
CATIDOMNode.GetLocalName local name, extracted from iQualifiedName
CATIDOMElement.GetTagName iQualifiedName
Errors Returned:
Error Class Error Id Description
CATDOMException XMLParserERR_2205 INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.
o CreateEntityReference
public virtual HRESULT CreateEntityReference( const CATUnicodeString& iName,
CATIDOMEntityReference_var& oEntityReference) = 0
Creates a CATIDOMEntityReference object.
Parameters:
iName
The name of the entity to reference.
oEntityReference
A
CATIDOMEntityReference that references the newly created EntityReference node.
Errors Returned:
Error Class Error Id Description
CATDOMException XMLParserERR_2205 INVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.
See also:
CATIDOMEntityReference
o CreateProcessingInstruction
public virtual HRESULT CreateProcessingInstruction( const CATUnicodeString& iTarget,
const CATUnicodeString& iData,
CATIDOMProcessingInstruction_var& oProcessingInstruction) = 0
Creates a CATIDOMProcessingInstruction node given the specified name and data strings.
Parameters:
iTarget
The target part of the processing instruction.
iData
The data for the node.
oProcessingInstruction
A
CATIDOMProcessingInstruction that references the newly created PI node.
Errors Returned:
Error Class Error Id Description
CATDOMException XMLParserERR_2205 INVALID_CHARACTER_ERR: Raised if an invalid character is specified.
See also:
CATIDOMProcessingInstruction
o CreateTextNode
public virtual HRESULT CreateTextNode( const CATUnicodeString& iData,
CATIDOMText_var& oTextNode) = 0
Creates a CATIDOMText node given the specified string.
Parameters:
iData
The data for the node.
oTextNode
A
CATIDOMText object that references the newly created text node.
See also:
CATIDOMText
o GetDocType
public virtual HRESULT GetDocType(CATIDOMDocumentType_var& oDocumentType) = 0
Retrieves the Document Type Declaration associated with this document. For documents without a document type declaration oDocumentType is set to NULL_var. The DOM Level 1 does not support editing the Document Type Declaration, therefore oDocumentType cannot be altered in any way.
Parameters:
oDocumentType
The retrieved Document Type Declaration associated with this document.
See also:
CATIDOMDocumentType
o GetDocumentElement
public virtual HRESULT GetDocumentElement(CATIDOMElement_var& oDocumentElement) = 0
Retrieves a reference to the root element of the document.
Parameters:
oDocumentElement
The retrieved reference to the root element of the document.
See also:
CATIDOMElement
o GetElementById
public virtual HRESULT GetElementById( const CATUnicodeString& iElementId,
CATIDOMElement_var& oElement) = 0
Retrieves the CATIDOMElement whose ID is given by iElementId. If no such element exists, returns NULL_var. Behavior is not defined if more than one element has this ID.
Parameters:
iElementId
The unique id value for an element.
oElement
The matching element.
o GetElementsByTagName
public virtual HRESULT GetElementsByTagName( const CATUnicodeString& iTagName,
CATIDOMNodeList_var& oNodeList) = 0
Retrieves a CATIDOMNodeList of all the elements with a given tag name. The returned node list is "live", in that changes to the document tree made after a nodelist was initially returned will be immediately reflected in the node list. The elements in the node list are ordered in the same order in which they would be encountered in a preorder traversal of the CATIDOMDocument tree.
Parameters:
iTagName
The name of the tag to match on. The special value "*" matches all tags.
oNodeList
A reference to a
CATIDOMNodeList containing all the matched instances of CATIDOMElement.
See also:
CATIDOMNodeList
o GetElementsByTagNameNS
public virtual HRESULT GetElementsByTagNameNS( const CATUnicodeString& iNamespaceURI,
const CATUnicodeString& iLocalName,
CATIDOMNodeList_var& oNodeList) = 0
Retrieves a CATIDOMNodeList of all the CATIDOMElements with a given local name and namespace URI. The elements are returned in the order in which they would be encountered in a preorder traversal of the CATIDOMDocument tree.
Parameters:
iNamespaceURI
The namespace URI of the elements to match on. The special value "*" matches all namespaces. When it is an empty
CATUnicodeString, this method behaves like GetElementsByTagName.
iLocalName
The local name of the elements to match on. The special value "*" matches all local names.
oNodeList
A new
CATIDOMNodeList object containing all the matched instances of CATIDOMElement.
o GetImplementation
public virtual HRESULT GetImplementation(CATIDOMImplementation_var& oImplementation) = 0
Return the CATIDOMImplementation object that handles this document.
Parameters:
oImplementation
The retrieved
CATIDOMImplementation object that handles this document.
See also:
CATIDOMImplementation
o ImportNode
public virtual HRESULT ImportNode( const CATIDOMNode_var& iNode,
const CATBoolean& iDeep,
CATIDOMNode_var& oNode) = 0
Imports a copy of a node from another document into this document. The source node, which may belong to a different document, is copied, with the copy belonging to this document. The copy is not placed into the document (the parent node is NULL_var).
Parameters:
iNode
The node to import.
iDeep
If TRUE, recursively import the subtree under the specified node; if FALSE, import only the node itself (and its attributes, if if is a CATIDOMElement.
oNode
The newly created copy of the source node, belonging to this document

This object is included in the file: CATIDOMDocument.h
If needed, your Imakefile.mk should include the module: CATXMLParserItf

Copyright © 2003, Dassault Systèmes. All rights reserved.