Class Reference
IRIS for UNIX 2019.2
InterSystems: The power behind what matters   
Documentation  Search
  [ENSLIB] >  [%XML] >  [Document]
Private  Storage   

class %XML.Document extends %XML.ImportHandler, %XML.Node

%XML.Document represents an XML document as an Document Object Model (DOM). The DOM may be created either

  • from an XML document by accessing the Document property of %XML.Reader after calling an Openxxx method of %XML.Reader.
  • as a new DOM by calling the CreateDocument of this class.

  • The %XML.Document class maintains the namespaces for the DOM. The %XML.Node class created by GetDocumentElement may be used to navigate the DOM or the macros in may be used to navigate the DOM based on the DocumentId of %XML.Document.


    Parameters Properties Methods Queries Indices ForeignKeys Triggers


    Document LocalName Namespace NamespaceIndex Nil
    NodeData NodeId NodeType QName

    %AddToSaveSet %ClassIsLatestVersion %ClassName %ConstructClone
    %DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
    %DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Extends
    %GetParameter %IsA %IsModified %New
    %NormalizeObject %ObjectModified %OriginalNamespace %PackageName
    %RemoveFromSaveSet %SerializeObject %SetModified %ValidateObject
    AddIDs AppendCharacter AppendElement AppendNode
    AppendTree AttributeDefined CopyDocument CountNamespace
    CreateDocument FindNamespace FirstAttributeName GetAttribute
    GetAttributeNS GetAttributeNamespace GetAttributeQName GetAttributeQNameNS
    GetAttributeValue GetAttributeValueNS GetAttributeValueNamespace GetAttributeValueNamespaceNS
    GetDocumentElement GetDocumentFromStream GetDocumentNode GetNamespace
    GetNextId GetNode GetNodeById GetNumberAttributes
    GetText GetVersion HasChildNodes InsertCharacter
    InsertElement InsertNamespace InsertNode InsertTree
    IsDescendant KillDocument LastAttributeName LocatePosition
    Mask MoveToFirstChild MoveToLastChild MoveToNextSibling
    MoveToParent MoveToParentElement MoveToPreviousSibling NextAttributeName
    PopHandler PreviousAttributeName PushHandler Remove
    RemoveAttribute RemoveAttributeNS ReplaceCharacter ReplaceElement
    ReplaceNode ReplaceTree Serialize SerializeAttribute
    SerializeBase64Attribute SerializeBase64Node SerializeNode SetAttribute
    SetNodeById comment endCDATA endDTD
    endEntity ignorableWhitespace processingInstruction skippedEntity
    startCDATA startDTD startEntity


    • method CountNamespace() as %Integer
    Return number of namepsaces in document's namespace table.
    • classmethod CreateDocument(localName As %String, namespace As %String) as %XML.Document
    Create a new Document Object Model (DOM) consisting of only a root element.
    • method FindNamespace(namespace As %String) as %Integer
    Return XML nsIndex into document's namespace table for namespace URI.
    • method GetDocumentElement() as %XML.Node
    Returns an %XML.Node DOM navigation object which is positioned at the the root element of this Document.
    • classmethod GetDocumentFromStream(stream As %BinaryStream, Output document As %XML.Document) as %Status
    Create a doocument by parsing the XML document contained in a stream.
    The parsed document is returned in document.
    A %Status is returned to indicate if parsing is successful.
    • method GetDocumentNode() as %String
    Returns the node id of the root element of this Document.
    • method GetNamespace(nsIndex As %Integer) as %String
    Return XML namespace URI for nsIndex into document's namespace table.
    • method GetNode(nodeId As %String) as %XML.Node
    Returns an %XML.Node DOM navigation object which is positioned at the the node specified by the nodeId argument.
    • method GetNodeById(id As %String)
    Return nodeId for node with id attribute = %id.
    • method GetVersion() as %Integer
    Return the version of the import handler that constructed this document. A programmatically constructed DOM will always have version "".
    • method InsertNamespace(namespace As %String)
    Return XML namespace URI for nsIndex into document's namespace table.
    • method SetNodeById(id As %String, nodeId As %Integer)
    Save nodeId for node with id attribute = %id.

    Copyright (c) 2019 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.