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

class EnsLib.EDI.XML.DOM extends EnsLib.EDI.Document, EnsLib.EDI.XML.MsgBodyMethods, %XML.SAX.ContentHandler

This class encapsulates an XML document stream and provides methods to interrogate and update it Two types of path strings can be used to identify a document node: a 'Property path' that is based in a particular XML schema definition (xsd), irrespective of any particular document instance, and a 'DOM path' that is based in the structure of a particular document irrespective of any XML schema. The DOM Path uses XPATH conventions; it always starts with '/' while a Property Path never does.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
40 79


Summary

Properties
%CalcCache %CalcCacheRef %CalcCount %ContentHandlerStatus
%ContentRef %DOMCache %DOMCacheRef %FindCache
%FindCacheRef %MaxCalcCache %ParseCache %PropCache
%PropCacheRef %PurgeIndex %SkipFind %XMLDoc
%saveParentDOMPath %storedContentRef DOMCacheSave DOMSaveName
DocType DocTypeCategory DocTypeName Format
GlobalName HandlerType Identifier IsMutable
KeepWhitespace Level Name OriginalDocId
RawContent Source TimeCreated TypeVersion
UserValues attributeCount attributeSub buildRoot
controlblock currentElement namespaceMapping noNamespaceSchemaLocation
pAfterCNode pDSubs pDSubsList pOrdinal
prevElem replace schemaLocation skipSlide

Methods
%%OIDGet %AddToSaveSet %BindExport
%BuildObjectGraph %ClassIsLatestVersion %ClassName
%Close %CompareContents %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty
%DispatchMethod %DispatchSetModified %DispatchSetMultidimProperty
%DispatchSetProperty %DrawHTMLForm %DrawHTMLTable
%Extends %GetContentType %GetParameter
%IncrementCount %IsA %IsModified
%New %NormalizeObject %ObjectModified
%OnTimeout %OriginalNamespace %PackageName
%ProcessSubmit %RemoveFromSaveSet %SerializeObject
%SetModified %ShowContents %ShowContentsHead
%ValidateObject AppendToDom AssertSameParent
Buffer ConditionallyGetElementOrLocal ConditionallyRemoveNSPrefix
ContentOnlyContainsText CopyValues CoverageInit
CoverageStatistics DomOnlyContainsText DrawFormButtons
DrawHTMLContentsForm DrawHTMLForm EnumerateDocTypesClose
EnumerateDocTypesExecute EnumerateDocTypesFetch EnumerateTypeCategoriesClose
EnumerateTypeCategoriesExecute EnumerateTypeCategoriesFetch EnumerateVDocsClose
EnumerateVDocsExecute EnumerateVDocsFetch GatherDOMValue
GetAlias GetContentArray GetManagerLinks
GetNewManagerLinks GetNextIndex GetStatsDimension
GetValueAt IsMutableSet LocatePosition
Mask NormalizeElementNamespacePrefix NormalizeNamespacePrefix
OnPostParse PokeDocType PopHandler
PushHandler ReadString SchematizeNamespace
SetValueAt TypeVersionGet Validate
calcISubscript calcInsertIndex characters
comment createAttrOrNamespaceIndex createIndex
createNonExistent createNonExistentNode dom2SlideElementNodes
domEQ domElemNode domElementNormalize
domElementRemove domElementSort domGE
domGT domGetAllNamespaces domGetAttrs
domGetElemCounts domGetLocalName domGetNamespaceHelper
domGetNamespaceURI domGetNamespaces domGetNextChild
domGetNodeCounts domGetQName domGetSubtree
domGetValueAt domIncreaseElementNodes domLE
domLT domLookUpAttrNumber domNodeRemove
domNonElementSort domParsePath domParsePathElem
domRemoveAttribute domRemoveAttributeNode domRemoveElementNodes
domRemoveNonElementNodes domSeekPositionOfElement domSeekPositionOfNode
domSetAtIndex domSetValueAt domSetValueAt1
domSlideElementNodes domSlideNodes domValidate
domValidateDOMSubs endCDATA endDTD
endDocument endElement endEntity
endPrefixMapping equalElement error
fatalError findIndex findLast
findTextAfterCNode getTestNewArg ignorableWhitespace
listToNodes lookupAttributeNumber nodesToList
processingInstruction setAllElementToAttribute skippedEntity
startCDATA startDTD startDocument
startElement startEntity startPrefixMapping
validateDOM value warning

Subclasses
EnsLib.EDI.XML.Prop

Properties

• property %CalcCache  [ MultiDimensional,Transient ];
Cache calculations to speed up findIndex and GetNextIndex
• property %CalcCacheRef as %String(MAXLEN="") [ Transient,ReadOnly ];
Cache calculations to speed up findIndex and GetNextIndex
• property %CalcCount as %Integer [ InitialExpression = 0,Transient,ReadOnly ];
• property %ContentHandlerStatus as %Status [ Transient ];
• property %ContentRef as %String(MAXLEN="") [ Transient,ReadOnly ];
Refers to a process private global when object is new, or to a contents global node %storedContentRef when opened from a stored instance or committed If %storedContentRef is not empty but %ContentRef is not the same, then %ContentRef is referring to a process-private global that contains an exact copy of the stored data (except for its reference to our ID). If we modify the private global contents we must remove our reference to the stored content and its reference to our id. This is intended for bulky static data
• property %DOMCache  [ MultiDimensional,Transient ];
• property %DOMCacheRef as %String(MAXLEN="") [ Transient,ReadOnly ];
Refers to ..%DOMCache (in memory) if active, storage node "domcache" while dormant If both %PropCache and %DOMCache have contents, %PropCache has precedence If %DOMCache needs to change, %PropCache must first be merged into it This is a local property to avoid shared data storage issues when cloning. If it gets too big it can be merged down to the local contents of %ContentRef This is intended for modest sized mutable data. Use CommitNode() if it gets too big.
• property %FindCache  [ MultiDimensional,Transient ];
Cache mapping of findIndex arguments to their outputs
• property %FindCacheRef as %String(MAXLEN="") [ Transient,ReadOnly ];
Cache mapping of findIndex arguments to their outputs
• property %MaxCalcCache as %Integer [ InitialExpression = $$$MAXCALCCACHE,Transient,ReadOnly ];
• property %ParseCache  [ Transient,ReadOnly ];
• property %PropCache  [ MultiDimensional,Transient ];
If this exists, it supersedes %DOMCache
• property %PropCacheRef as %String(MAXLEN="") [ Transient,ReadOnly ];
Refers to ..%PropCache (in memory) if active, storage node "propcache" while dormant If both %PropCache and %DOMCache have contents, %PropCache has precedence This is intended for modest sized mutable data. Use CommitNode() if it gets too big.
• property %PurgeIndex as %Integer [ Transient,ReadOnly ];
Index used to purge PPG area used to store CalcCache when PPG used to store CalcCache (this is done automatically)
• property %SkipFind  [ Transient ];
In createNonExistent skip finds and don't kill the calc cache if inserting at end
• property %XMLDoc as %XML.Document [ Transient,ReadOnly ];
Transient document instance used to build an XML content array from an imported document and hold onto it until we persist it.
• property %saveParentDOMPath  [ Transient,ReadOnly ];
• property %storedContentRef as %String(MAXLEN="") [ ReadOnly ];
Reference to persistently stored content which, if we have been %Save'd, has a reference to our ID
• property DOMCacheSave  [ MultiDimensional,Transient ];
• property DOMSaveName as %String(MAXLEN="") [ Transient ];
• property Format as %String(MAXLEN="") [ Transient ];
Formatting specifiers for XML output and input: whitespace, canonicalization and default values
• property Identifier as %String(MAXLEN="") [ Calculated,Transient,ReadOnly ];
Unique document identification string found in document content (none defined for a general XML document)
• property Level as %Integer [ InitialExpression = 0,Transient ];
• property Name as %String(MAXLEN="") [ Calculated,Transient,ReadOnly ];
Raw type name of document as declared in document content
• property TypeVersion as %String(MAXLEN="") [ Calculated,Transient,ReadOnly ];
Raw type version of document if declared in document content
• property attributeCount  [ MultiDimensional ];
• property attributeSub  [ MultiDimensional ];
• property buildRoot as %Boolean [ InitialExpression = 0,Transient ];
• property controlblock as %String(MAXLEN="") [ Transient ];
Overridden as Transient from %XML.SAX.ContentHandler: Parser control block. Used only when HandlerType is set to $$$LocHandler
• property currentElement as %String(MAXLEN="") [ Transient ];
• property namespaceMapping  [ MultiDimensional ];
• property noNamespaceSchemaLocation as %String(MAXLEN="") [ Transient ];
Used in Document Validation, whether we use xsi:schemaLocation attribute or xsi:noNamespaceSchemaLocation attribute
• property pAfterCNode as %String(MAXLEN="") [ Transient ];
• property pDSubs as %String(MAXLEN="") [ Transient ];
• property pDSubsList  [ MultiDimensional ];
• property pOrdinal as %String(MAXLEN="") [ Transient ];
• property prevElem  [ MultiDimensional ];
• property replace as %Boolean [ InitialExpression = 0,Transient ];
replace nodes since in append
• property schemaLocation as %String(MAXLEN="") [ Transient ];
Used in Document Validate() to pass schema location to DOM
• property skipSlide as %Boolean [ InitialExpression = 1,Transient ];
skip domSlideElementNodes since done by domParsePath

Methods

• method AppendToDom(pDOMSubs As %String, pInsertDSubs As %String, pOrdinal As %Integer) as %Integer
• method AssertSameParent(c1 As %Integer, c2 As %Integer)
• method ConditionallyGetElementOrLocal(pIgnoreNamespaces As %Boolean, pElem As %String, ByRef pNSContext As %String) as %String
• method ConditionallyRemoveNSPrefix(pIgnoreNamespaces As %Boolean, pElem As %String, ByRef pNSContext As %String, Output pStatus As %Status) as %String
• method ContentOnlyContainsText(pContentSubs As %String)
• classmethod CoverageInit()
• classmethod CoverageStatistics()
• method DomOnlyContainsText(pDSubs As %String)
• method GatherDOMValue(pDSubs As %String)
• method NormalizeElementNamespacePrefix(pElem As %String, ByRef pStatus, pIgnoreNamespaces)
• method NormalizeNamespacePrefix(pDOMPath As %String, ByRef pStatus, pIgnoreNamespaces)
• method ReadString(pValue As %String, pReplace As %Boolean = 0, pBuildRoot As %Boolean = 0) as %Status
• method SchematizeNamespace(pFlag As %Boolean, pContentSubs As %Integer, pElem As %String, pNamespaceDef As NamespaceHelper, ByRef pSchemaPrefixes, ByRef pNSContext As %String)
• method calcISubscript(pDSubs As %String, pElemAndIndex As %String)
• method calcInsertIndex(pDSubs As %String, pElemAndIndex As %String)
• method characters(chars As %Library.String, length As %Library.Integer)
Receive notification of character data inside an element.

By default, do nothing. Application writers may override this method to take specific actions for each chunk of character data (such as adding the data to a node or buffer, or printing it to a file).

  • chars: The characters.
  • length: The number of characters to use from the character array.
• method comment(chars As %Library.String, length As %Library.Integer)
Receive notification of comments.

The Parser will call this method to report each occurence of a comment in the XML document.

The application must not attempt to read from the array outside of the specified range.

  • chars: The characters from the XML document.
  • length: The number of characters to read from the array.

Exceptions thrown: SAXException - Any SAX exception, possibly wrapping another exception.

• method createAttrOrNamespaceIndex(pDOMSubs As %String, pFormat As %String, ByRef Index, ByRef pDomOrderedIndex)
• method createIndex(pDSubs As %String, ByRef Index)
• method createNonExistent(pDSubs As %String, pCSubs As %String, pElem As %String, pIndex As %Integer, pIsNode As %Boolean, ByRef pDom As %Integer, pNonExistent As %Boolean, pCHit As %Boolean, byName As %Boolean, Output pElemIndex As %Integer, pIgnoreNamespaces As %Boolean, ByRef pNSContext As %String, isTypeElement As %Boolean)
• method createNonExistentNode(pDSubs As %String, pCSubs As %String, pIndex As %Integer, pIsNode As %Boolean, pRightType As %String, pIgnoreNamespaces As %Boolean, ByRef pNSContext As %String)
• method dom2SlideElementNodes(pDSubs As %String, pNodeIndex As %String, pElem As %String)
Make space to insert a new node by sliding up by one the given node in the given DOM element and all higher nodes in that element
• method domEQ(c1 As %Integer, c2 As %Integer)
• method domElemNode(pDSubs As %String, pElemId As %String, Output pStatus As %Status)
Get the node index within the given DOM element of the child element given by pElemId = name>item
• method domElementNormalize(pDSubs, pElemName)
• method domElementRemove(pInsertDSubs As %String, pFinalSubscript As %String, pDSubs As %String, pCHit As %Boolean, pDHit As %Boolean)
• method domElementSort(pDSubs As %String, pElem As %String)
• method domGE(c1 As %Integer, c2 As %Integer)
• method domGT(c1 As %Integer, c2 As %Integer)
• method domGetAllNamespaces(ByRef pValue As %String, pDOMPath As %String, pContentSubs As %String, pDOMSubs As %String, pFormat As %String, ByRef pNSContext As %String, pCHit As %Boolean, pDHit As %Boolean, pNamespaces As %String, ByRef level=0, ByRef SeenCNode, ByRef cSeen, ByRef pSC, ByRef pCachedNamespaces, pCount As %Integer = 1) as %Boolean
Get all namespaces in the subttree determined by pContentSubs and pDOMSubs returns whether any namespaces found
• method domGetAttrs(ByRef pPrefixes, ByRef pAttrs As %String = "", pContentSubs As %String, pDOMSubs As %String, pFormat As %String, ByRef pNSContext As %String, pCHit As %Boolean, pDHit As %Boolean, Output pAttrCount, pInputAttr As %String = "", Output pAttrIndex, pInputCount As %String = "", Output pOutputName, Output pOutputValue, pIncludeNamespaces=0) as %Status
Get the attributes of the given element
• method domGetElemCounts(pDSubs As %String, pCSubs As %String, pElem As %String, pIgnoreNamespaces As %Boolean, ByRef pNSContext As %String) as %Integer
Find and cache the DOM and Content-combined counts for the given element name
• method domGetLocalName(documentId, nodeId)
• method domGetNamespaceHelper(ByRef pNamespaces As %String, pContentSubs As %String, pDOMSubs As %String, ByRef pNSContext As %String, ByRef pNamespaceFound As %Boolean, ByRef pCachedNamespaces, pCount As %Integer) as %Status
Get the namespaces of the given element
• method domGetNamespaceURI(documentId, nodeId)
• method domGetNamespaces(pNamespaces As %String, pContentSubs As %String, pDOMSubs As %String, ByRef pNSContext As %String, pFormat As %String = "", ByRef pNamespaceFound As %Boolean, ByRef pCachedNamespaces, pCount As %Integer = "") as %Status
Get the namespaces of the given element
• method domGetNextChild(documentId, nodeId, childId) as %String
• method domGetNodeCounts(pDSubs As %String, pCSubs As %String, pElem As %String, ByRef pNSContext As %String) as %Integer
Find and cache the DOM and Content-combined child node counts for the given node
• method domGetQName(documentId, nodeId)
• method domGetSubtree(ByRef pValue As %String, pDOMPath As %String, pContentSubs As %String, pDOMSubs As %String, pFormat As %String, ByRef pNSContext As %String, pCHit As %Boolean, pDHit As %Boolean, pNamespaces As NamespaceHelper, ByRef level=0, ByRef SeenCNode, ByRef cSeen, pPPGIndex As %Integer = 0, pIsStream As %Boolean = 0, ByRef pWriteIndex As %Integer = 0, pNamespaceFound As %Boolean = 1, pCount As %Integer = 0, ByRef pCachedNamespaces) as %Status
pValue - return value if return value is a string
pDOMPath - input full DOM Path
pContentSubs - node in Content Array
pDOMSubs - node in DOM array
pFormat - format string used to decide things like indentation
pNSContext - multidimensional array used to store information, including namespace information, about calculation in progress pCHit - whether hit at Content Array node
pDHit - whether hit at DOM node
pNamespaces - namespace string used to output namespaces at node
level - what level of XML tree are we on? Special processing at level 1. SeenCNode - avoid processing cNode twice cSeen - avoid processing cNode twice pPPGIndex - index into process private global
pIsStream - are outputting a stream or a pValue string variable?
pWriteIndex - write index into process private global
pNamespaceFound - are namespaces used at node or below it in XML tree
pCount - number of element amongst sibling nodes (the parent has n children and these are all siblings)
pCachedNamespaces - cached namespaces - can include cached namespaces for entire XML tree
• method domGetValueAt(Output pValue As %String, pDOMPath As %String, pFormat As %String, pIgnoreNamespaces As %Boolean = 0) as %Status
• method domIncreaseElementNodes(pDSubs As %String, pNodeIndex As %String, pElem As %String)
Make space to insert a new node by sliding up by one the given node in the given DOM element and all higher nodes in that element following function currently used for debugging by substituting for domSlideElementNodes
• method domLE(c1 As %Integer, c2 As %Integer)
• method domLT(c1 As %Integer, c2 As %Integer)
• method domLookUpAttrNumber(pDSubs As %String, pAttrName As %String)
• method domNodeRemove(pDSubs As %String, pCHit As %Boolean, pDHit As %Boolean, pCSubs)
we remove a node whether it is textual content, a DOM annotation of textual content, or a DOM node that has been inserted into the array of values beneath a DOM node
• method domNonElementSort(pDSubs As %String, pOrdinal As %String)
• method domParsePath(pDOMPath As %String, pMode As %String, Output pCSubs As %String, Output pDSubs As %String, Output pNodeType As %String, Output pNodeIndex As %String, Output pNodeValue As %String, Output pNSContext As %String, Output pAfterCNode, Output pFinalSubscript, Output pInsertDSubs, Output pInsertIndex, Output pCHit As %Boolean, Output pDHit As %Boolean, Output pInsertType As %String, Output pTextOrdinal As %String = 1, Output pTextAfterCNode, Output pTextSubscript, Output pInsertSubscript, Output pCNamespace As %Integer, pFormat As %String, Output pNamespaces, pAction As %String = "", Output pPrevNode As %String, Output pCurrentNode As %String, Output pCNodeTextHit As %Boolean, Output pElemSubscript, Output tNode, Output isElement, Output tCHitPrev, Output tDHitPrev, pValue As %String) as %Status
Parse a DOM path and return a reference into ..%DOMCache for the given node's parent, plus the node index pNodeIndex can be returned as: empty, node position, ~node position (for insert), or count (for count queries). pAfterCNode is only relevant when we are doing an insert and represents the node in the Content Array to the left of the node being inserted in the case where the item to the left is also in the DOM array, the current implementation is incomplete (JSL 08-26-10) In some cases, the current implementation is incomplete (JSL 08-26-10)
• method domParsePathElem(pDOMPath As %String, ByRef pElem As %String, pNextElem As %String, pMode As %String, ByRef pIndex As %String, Output pIsNodeIndex As %Boolean, Output pIsInsert As %Boolean, Output pFinal As %Boolean, Output pElemIgnoreNamespaces As %Boolean) as %Status
• method domRemoveAttribute(pContentSubs, pDSubs As %String, pAttrName As %String, pCHit As %Boolean, pDHit As %Boolean)
• method domRemoveAttributeNode(pDSubs As %String, pAttrName As %String, pDom As %String)
• method domRemoveElementNodes(pDSubs As %String, pNodeIndex As %String, pElem As %String)
Remove node by sliding down by one the given node in the given DOM element and all higher nodes in that element
• method domRemoveNonElementNodes(pDSubs As %String, pNodeIndex As %String)
Remove node by sliding down by one the given node in the given DOM element and all higher nodes in that element
• method domSeekPositionOfElement(pDSubs As %String, pCSubs As %String, pElem As %String, pElemNumber As %Integer, pIgnoreNamespaces As %Boolean, ByRef pNSContext As %String) as %Integer
• method domSeekPositionOfNode(pDSubs As %String, pCSubs As %String, pElem As %String, pElemNumber As %Integer, pIgnoreNamespaces As %Boolean, ByRef pNSContext As %String) as %Integer
• method domSetAtIndex(pDOMPath As %String, pMode As %String, Output pCSubs As %String, Output pDSubs As %String, Output pNodeType As %String, Output pNodeIndex As %String, Output pNodeValue As %String, Output pNSContext As %String, Output pAfterCNode, Output pFinalSubscript, Output pInsertDSubs, Output pInsertIndex, Output pCHit As %Boolean, Output pDHit As %Boolean, Output pInsertType As %String, Output pTextOrdinal As %String = 1, Output pTextAfterCNode, Output pTextSubscript, Output pInsertSubscript, Output pCNamespace As %Integer, pFormat As %String, Output pNamespaces, pIgnoreNamespaces As %Boolean = 0, pAction As %String = "", Output pPrevNode As %String, Output pCurrentNode As %String, Output pCNodeTextHit As %Boolean, Output pElemSubscript, tNode, tIndex, tParam, Output tCHit, Output tDHit, Output tCNode, Output prevCNode, tIgnoreNamespaces, tElemIgnoreNamespaces, tInsert, tFinalBeforeAttribute, tChildCount, tOperateOnSet, Output tNonExistent) as %Status
• method domSetValueAt(pValue As %String, pDOMPath As %String, pAction As %String = "set", pKey As %String = "") as %Status
• method domSetValueAt1(pValue As %String, pDOMPath As %String, pAction As %String = "set", pKey As %String = "") as %Status
• method domSlideElementNodes(pDSubs As %String, pNodeIndex As %String, pElem As %String)
Make space to insert a new node by sliding up by one the given node in the given DOM element and all higher nodes in that element following function currently used for debugging by substituting for domSlideElementNodes
• method domSlideNodes(pDSubs As %String, pNodeIndex As %String, Output pHighestIndex As %String)
Make space to insert a new node by sliding up by one the given node in the given DOM element and all higher nodes in that element
• method domValidate(pDOMPath As %String, pContentSubs As %String, pDOMSubs As %String, pFormat As %String, ByRef pNSContext As %String, pCHit As %Boolean, pDHit As %Boolean, pNamespaces As %String, ByRef level=0, ByRef SeenCNode, ByRef cSeen, pNamespaceFound As %Boolean = 1, pCount As %Integer = 0, ByRef pCachedNamespaces) as %Status
pDOMPath - input full DOM Path
pContentSubs - node in Content Array
pDOMSubs - node in DOM array
pFormat - format string used to decide things like indentation
pNSContext - multidimensional array used to store information, including namespace information, about calculation in progress pCHit - whether hit at Content Array node
pDHit - whether hit at DOM node
pNamespaces - namespace string used to output namespaces at node
level - what level of XML tree are we on? Special processing at level 1. SeenCNode - avoid processing cNode twice cSeen - avoid processing cNode twice pPPGIndex - index into process private global
pWriteIndex - write index into process private global
pNamespaceFound - are namespaces used at node or below it in XML tree
pCount - number of element amongst sibling nodes (the parent has n children and these are all siblings)
pCachedNamespaces - cached namespaces - can include cached namespaces for entire XML tree
• method domValidateDOMSubs(pDOMPath, pDOMSubs, ByRef Index) as %Status
• method endElement(uri As %Library.String, localname As %Library.String, qname As %Library.String)
Receive notification of the end of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each element (such as finalising a tree node or writing output to a file).

  • uri: The URI of the associated namespace for this element
  • localname: The local part of the element name
  • qname: The QName of this element

• method endPrefixMapping(prefix As %Library.String)
Receive notification of the end of an namespace prefix mapping.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each namespace prefix mapping.

  • prefix: The namespace prefix used

• method equalElement(pIgnoreNamespaces As %Boolean = 0, pElem1 As %String, pElem2 As %String, ByRef pNSContext As %String)
• method fatalError(fatalerror As %Library.String)
Report a fatal XML parsing error.

The default implementation throws an exeption Application writers may override this method in a subclass if they need to take specific actions for each fatal error (such as collecting all of the errors into a single report): in any case, the application must stop all regular processing when this method is invoked, since the document is no longer reliable, and the parser may no longer report parsing events.

  • fatalerror: The error information encoded as a string

• method findIndex(pDSubs As %String, pCSubs As %String, pElem As %String, pIndex As %String, pIsNode As %Boolean, ByRef pStatus As %Status, ByRef pCHit As %Boolean, ByRef pDHit As %Boolean, ByRef pNode As %String, ByRef prevCNode As %String, Existing As %Boolean, ByRef pElemIndex As %String, ByRef pElemName As %String, isTypeElement As %Boolean, pRightType As %String, ByRef nFound As %Integer, Output isElementOut As %Boolean, Output pOutputType, Output pCount, pIgnoreNamespaces As %Boolean = 0, Output pMatchedElemName As %String, ByRef pNamespaces, ByRef pNSContext As %String, Output kReturn, pUnSorted As %Boolean = 0, pReturnRemoved As %Boolean = 0, ByRef kFinal As %String)
Set tIndex="" to return count
findIndex - return information about child of XML parent at pDSubs,pCSubs. findIndex walks children. The children are all siblings.
Arguments:
input
pDSubs - parent in DOM array - maybe "_" to indicate no DOM array parent
pCSubs - parent in Content Array - maybe "" to indicate no Content Array parent (in which case no Content Array)
pElem - name of element we are looking for in children, else null
pIndex - ordinal of element we are looking for or ordinal of node (in all children, including textual children)
pIsNode - element or node - 0 or 1
Existing - are we looking for existing node or element?
isTypeElement - we are looking for an element = 1, some other node type (text, comment, etc.,) 0
pRightType - the type of what we are looking for, e.g. text /ElemA/text(3) - look for third text node
pIgnoreNamespaces - in looking for match - ignore matching namespaces, if NCNames match it is enough
pNamespaces - object reference containing namespace information
pNSContext - local array containing namespace information
pUnSorted - was control to determine when we need to sort kDOM by tAfterCNode, now always 0
pReturnRemoved - idea was we would return match of removed element, always 0, no longer relevant
OUTPUT
pStatus - a status
pCHit - match in content array
pDHit - match in DOM array (can be match in both content array and DOM array, in which case DOM array wins)
pNode - the child Content Array node which is matched
prevCNode - the child Content Array node "left of" what is matched (in sibling order)
pElemIndex - a decomposed value in matching DOM array node ( pElemName>pElemIndex is value of node)
pElemName - see pElemIndex
nFound - ordinal number of found node
isElementOut - is matched node an element? if 1 it is.
pOutputType - type of matched element - element,text,comment, etc., pCount - count of input, for example /root/ElemA[*] pMatchedElemName - when searching for Nth element,e.g., element()[N] - we want to know name that matched
kReturn - variable introduce to solve bug that was another problem, needs to be removed at some point
kFinal - this looks like another variable, which is no longer used
Note there are 13 input arguments and 14 output arguments
• method findLast(pDSubs As %String, pCSubs As %String, pElem As %String, ByRef pCHit As %Boolean, ByRef pDHit As %Boolean, ByRef pNode As %String, ByRef prevCNode As %String, Existing As %Boolean, ByRef pElemIndex As %String, ByRef pElemName As %String, isTypeElement As %Boolean, pRightType As %String, Output pOutputType, pIgnoreNamespaces As %Boolean, Output pMatchedElemName As %String, ByRef pNSContext As %String, pElementFunctionInsert As %Boolean = 0)
• method findTextAfterCNode(pDSubs As %String, pCSubs As %String, pIgnoreNamespaces As %Boolean, Existing As %Boolean, ByRef pNSContext As %String, ByRef pTextAfterCNode As %String)
• method ignorableWhitespace(chars As %Library.String, length As %Library.Integer)
Receive notification of ignorable whitespace in element content.

By default, do nothing. Application writers may override this method to take specific actions for each chunk of ignorable whitespace (such as adding data to a node or buffer, or printing it to a file).

  • chars: The whitespace characters.
  • length: The number of characters to use from the character array.

• classmethod listToNodes(pList, Output pArray)
• method lookupAttributeNumber(pDSubs As %String, pAttrName As %String)
• classmethod nodesToList(ByRef array)
• method processingInstruction(target As %Library.String, data As %Library.String)
Receive notification of a processing instruction in element content.

Application writers may override this method in a subclass if they need to take specific actions for processing instruction.

  • target: The target of the processing instruction
  • data: The associated data

• method setAllElementToAttribute(pDOMPath As %String, Output pTargetDOMPath As %String, Output pAttrName As %String, Output tSC)
• method startElement(uri As %Library.String, localname As %Library.String, qname As %Library.String, attrs As %Library.List)
Receive notification of the start of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writin output to a file).

  • uri: The URI of the associated namespace for this element
  • localname: the local part of the element name
  • qname: the QName of this element
  • attrs: a list in $List format consisting of a repeating group of attributes.

The format of the repeating group is as follows:

  • +0 - uri: The URI of the associated namespace for this attribute
  • +1 - localname: The local part of the name of this attribute
  • +2 - qname: The QName of this attribute
  • +3 - type: The type of this attribute ("CDATA", NMTOKEN", "ENTITY", etc.)
  • +4 - value: The value of this attribute

• method startPrefixMapping(prefix As %Library.String, uri As %Library.String)
Receive notification of the start of an namespace prefix mapping.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each namespace prefix mapping.

  • prefix: The namespace prefix used
  • uri: The namespace URI used.

• method validateDOM(pDOMPath As %String) as %Status
• method value(chars As %Library.String, length As %Library.Integer, valueType As %String)


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