Learning
Documentation
Community
Open Exchange
Global Masters
Home / Class Reference / ENSLIB namespace / EnsLib.EDI.XML.Document
Private  Storage   

EnsLib.EDI.XML.Document


persistent class EnsLib.EDI.XML.Document extends
%Persistent, EnsLib.EDI.XML.Prop, %XML.SAX.EntityResolver, %XML.Adaptor

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
6 10 58 2 2 1


Summary


Properties
%CalcCache %CalcCacheRef %CalcCount %Concurrency
%ContentHandlerStatus %ContentRef %DOMCache %DOMCacheRef
%DocTypeRef %EntityResolverHttpTimeout %EntityResolverSSLConfigName %EntityResolverSchemaDir
%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 SSLConfiguration SchemaStatus
Source TimeCreated Timeout TypeVersion
UserValues attributeCount attributeSub buildRoot
controlblock currentElement namespaceMapping noNamespaceSchemaLocation
pAfterCNode pDSubs pDSubsList pOrdinal
prevElem replace schemaLocation skipSlide

Methods
%%OIDGet %1Check %AddJrnObjToSyncSet
%AddToSaveSet %AddToSyncSet %BMEBuilt
%BindExport %BuildIndices %BuildIndicesAsync
%BuildIndicesAsyncResponse %BuildIndicesSegment %BuildObjectGraph
%CheckConstraints %CheckConstraintsForExtent %ClassIsLatestVersion
%ClassName %Close %CompareContents
%ComposeOid %ConstructClone %Delete
%DeleteExtent %DeleteId %DispatchClassMethod
%DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty
%DowngradeConcurrency %DrawHTMLForm %DrawHTMLTable
%ExecuteAfterTriggers %ExecuteBeforeTriggers %Exists
%ExistsId %Extends %FileIndices
%FileIndicesBuffered %GUID %GUIDSet
%GetContentType %GetLock %GetParameter
%GetSwizzleObject %Id %IncrementCount
%InsertBatch %IsA %IsModified
%IsNull %JournalObject %KillExtent
%KillExtentData %LoadFromMemory %LockExtent
%LockId %New %NormalizeObject
%ObjectIsNull %ObjectModified %Oid
%OnBeforeAddToSync %OnDetermineClass %OnTimeout
%Open %OpenId %OriginalNamespace
%PackageName %PhysicalAddress %ProcessSubmit
%PurgeIndices %Reload %RemoveFromSaveSet
%ResolveConcurrencyConflict %RollBack %SQLAcquireLock
%SQLAcquireTableLock %SQLAfterTriggers %SQLBeforeTriggers
%SQLBuildIndices %SQLBuildPurgeIndexForRow %SQLBuildPurgeIndices
%SQLCheckUnique %SQLCheckUniqueIndices %SQLCheckUniqueKeys
%SQLCopyIcolIntoName %SQLCopyNameIntoIcol %SQLCreateInsDelTables
%SQLDefineiDjVars %SQLDelete %SQLDeleteChildren
%SQLDeleteTempStreams %SQLEExit %SQLExists
%SQLFKeyDelLock %SQLFastInsert %SQLFieldValidate
%SQLGetLock %SQLGetOld %SQLGetOldAll
%SQLGetOldIndex %SQLInsert %SQLInsertComputes
%SQLInsertStreams %SQLInvalid %SQLInvalid2
%SQLMVDelete %SQLMVIndexDelete %SQLMVIndexInsert
%SQLMVIndexUpdate %SQLMVInsert %SQLMVUpdate
%SQLMissing %SQLNormalizeCompFields %SQLNormalizeFields
%SQLPurgeIndices %SQLQuickBulkInsert %SQLQuickBulkLoad
%SQLQuickBulkSave %SQLQuickBulkUpdate %SQLQuickDelete
%SQLQuickDeleteChildren %SQLQuickFindPKeyByRowID %SQLQuickFindRowIDByPKey
%SQLQuickInsert %SQLQuickLoad %SQLQuickLoadChildren
%SQLQuickLogicalToOdbc %SQLQuickOdbcToLogical %SQLQuickUpdate
%SQLReleaseLock %SQLReleaseTableLock %SQLStorageValidation
%SQLTrigDelTab %SQLTrigInsTab %SQLUnlock
%SQLUnlock2 %SQLUnlockError %SQLUnlockRef
%SQLUpdate %SQLUpdateComputes %SQLUpdateStreams
%SQLValidateCompFields %SQLValidateFields %SQLicompView
%SQLnBuild %Save %SaveDirect
%SaveIndices %SerializeObject %SetModified
%ShowContents %ShowContentsHead %SortBegin
%SortEnd %SyncObjectIn %SyncTransport
%UnlockExtent %UnlockId %UpgradeConcurrency
%ValidateIndices %ValidateObject %XMLGenerate
AppendToDom AssertSameParent Buffer
CommitNode CommittedMode ConditionallyGetElementOrLocal
ConditionallyRemoveNSPrefix ContentOnlyContainsText CopyValues
CoverageInit CoverageStatistics DocTypeSet
DomOnlyContainsText DrawFormButtons DrawHTMLContentsForm
DrawHTMLForm DumpMaps EnumerateDocTypesClose
EnumerateDocTypesExecute EnumerateDocTypesFetch EnumerateTypeCategoriesClose
EnumerateTypeCategoriesExecute EnumerateTypeCategoriesFetch EnumerateVDocsClose
EnumerateVDocsExecute EnumerateVDocsFetch GatherDOMValue
GetAlias GetContentArray GetManagerLinks
GetNewManagerLinks GetNextIndex GetStatsDimension
GetSubDocumentAt GetValueAt GetValues
GetValuesArray IdentifierGet ImportFromDevice
ImportFromFile ImportFromIOStream ImportFromLibraryStream
ImportFromString IsMutableSet KillGlobals
LocatePosition Mask NameGet
NormalizeElementNamespacePrefix NormalizeNamespacePrefix OnPostParse
OutputHTMLZen OutputToDevice OutputToFile
OutputToIOStream OutputToLibraryStream OutputToString
PokeDocType PopHandler Purge
PushHandler RawContentGet ReadString
SchematizeNamespace SetMaxCalcCache SetSubDocumentAt
SetValueAt TotalCount TypeVersionGet
UseGlobalContent UseProcessContent Validate
XMLAfterExport XMLBeforeExport XMLDTD
XMLExport XMLExportInternal XMLExportToStream
XMLExportToString XMLGetSchemaImports XMLImport
XMLImportInternal XMLIsObjectEmpty XMLNew
XMLSchema XMLSchemaNamespace XMLSchemaType
addNamespacesNotYetOutputted calcISubscript calcInsertIndex
characters choiceGetCount choiceGetIndex
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 getContentAsString getIdentifier
getName getTestNewArg getTypeVersion
getValsArray ignorableWhitespace initNSContext
listToNodes lookupAttributeNumber nodesToList
parseValueTree processingInstruction propGetCount
propGetDOMPathValue propGetValueAt propParsePath
propSetValueAt recordNSPDeclarations resolveEntity
setAllElementToAttribute setDOMNode skippedEntity
startCDATA startDTD startDocument
startElement startEntity startPrefixMapping
syncDOMChild syncToDOMCache validateAnyXML
validateDOM value warning


Parameters


• parameter DEFSEARCHCLASS = "EnsLib.EDI.XML.SearchTable";
Name of the default SearchTable indexing class used in UI choices and MessageBank submissions
• parameter DOCCLASSFULLNAME = "XML Virtual Document";
Full descriptive name for this subclass of document
• parameter DOCCLASSNAME = "XML Document";
Compact descriptive name for this subclass of document
• parameter DOCSHORTNAME = "XML";
• parameter SCHEMACLASS = "EnsLib.EDI.XML.Schema:DS";
Name of the associated schema class and, after a colon, the schema class code that represents a DocType
• parameter XMLNOMETADATA = 1;
Suppress normal XML meta data

Properties


• property %EntityResolverHttpTimeout as %Numeric [ Transient ];
• property %EntityResolverSSLConfigName as %String(MAXLEN="") [ Transient ];
• property %EntityResolverSchemaDir as %String(MAXLEN="") [ Transient ];
• property GlobalName as %String(MAXLEN="") [ InitialExpression = "||%xmlTemp",Transient ];
Name of global to write to. Used only when HandlerType is set to $$$IntHandler or $$$LocHandler
• property HandlerType as %Integer [ InitialExpression = $$$ClsHandler,Transient ];
The type of content handler. If the value of this property is changed to $$$IntHandler, then the internal content handler is used that creates the proprietary DOM directly in the global named by GlobalName
• property Identifier as %String(MAXLEN="") [ Calculated,Transient,ReadOnly ];
Unique document identification string found in document content (none defined for a general XML document)
• property KeepWhitespace as %Boolean [ InitialExpression = 0,Transient ];
Flag to keep whitespace. Used only when HandlerType is set to $$$IntHandler
• property Name as %String(MAXLEN="") [ Calculated,Transient,ReadOnly ];
Raw type name of document as declared in document content
• property RawContent as %String(MAXLEN=10000) [ Calculated,Transient,ReadOnly ];
The raw text content of the document. Note that this is a truncated version suitable for use in SQL results and visual inspection, but not a complete or definitive representation of the document.
• property TypeVersion as %String(MAXLEN="") [ Calculated,Transient,ReadOnly ];
Raw type version of document if declared in document content

Methods


• private method %OnAddToSaveSet(depth As %Integer = 3, insert As %Integer = 0, callcount As %Integer = 0) as %Status
This callback method is invoked when the current object is added to the SaveSet, either because %Save() was invoked on this object or on an object that references this object. %OnAddToSaveSet can modify the current object. It can also add other objects to the current SaveSet by invoking %AddToSaveSet or remove objects by calling %RemoveFromSaveSet.

If this method returns an error status then %Save() will fail and the transaction will be rolled back.

• private method %OnAfterSave(insert As %Boolean) as %Status
%Save() calls this method internally. As a result %Save() saves a copy of the cache arrays to storage but keeps them in memory as well for further changes.
• private method %OnClose() as %Status
This callback method is invoked by the %Close method to provide notification that the current object is being closed.

The return value of this method is ignored.

• private method %OnConstructClone(object As %RegisteredObject, deep As %Boolean = 0, ByRef cloned As %String) as %Status
This callback method is invoked by the %ConstructClone method to provide notification that a clone of an object is being created. It passes in the oref of the object that was cloned in object.

If this method returns an error then the object will not be created.

• private classmethod %OnDelete(oid As %ObjectIdentity) as %Status
This callback method is invoked by the %Delete method to provide notification that the object specified by oid is being deleted.

If this method returns an error then the object will not be deleted.

• private method %OnNew(initvalue As %RawString = $$$NULLOREF) as %Status
create an object based on id=initvalue but editable
• private method %OnOpen() as %Status
This callback method is invoked by the %Open method to provide notification that the object specified by oid is being opened.

If this method returns an error then the object will not be opened.

• classmethod %XMLGenerate()
Suppress normal XML meta data

• method CommitNode(pPropertyPath As %String = "", pDeep As %Boolean = 0) as %Status
deprecated - never did anything
• method CommittedMode(pMode As %Boolean = 1) as %Status
Switch from keeping changes in memory to keeping them in storage. Allows for unlimited changes to a document without running out of memory. This mode is automatically in effect when the object is created by loading from a stored Id
• method CopyValues(pSource As EnsLib.EDI.XML.Document, pSourcePath As %String, pTargetPath As %String, pAction As %String, pKey As %String, pEmptyFieldAsNull As %Boolean = 0, pIgnoreMissingSource As %Boolean = 0) as %Status
Copy a whole set of values from source to target when iteration is implied between 2 VDocs pSourcePath contains the property path to the source set
pTargetPath contains the property path to the target set
pAction contains an action code: "set", etc..
pKey contains an optional key value or a set of comma-separated key values to be used as array indices where empty array index placeholders are present in pPropertyPath.
• method DumpMaps(pWhich As %String = "") as %Status
• classmethod EnumerateDocTypesClose(ByRef qHandle As %Binary) as %Status
• classmethod EnumerateDocTypesExecute(ByRef qHandle As %Binary, Category As %String, IncludeBase As %Boolean) as %Status
• classmethod EnumerateDocTypesFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer) as %Status
• classmethod EnumerateTypeCategoriesClose(ByRef qHandle As %Binary) as %Status
• classmethod EnumerateTypeCategoriesExecute(ByRef qHandle As %Binary, Standard As %String = "") as %Status
• classmethod EnumerateTypeCategoriesFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer) as %Status
• classmethod GetContentArray(Output pContents, pMode As %String, pDocType As %String, pLevel As %Integer, pIncludeBase As %Boolean, pElem, pNodeAddr) as %Status
Returns array of properties that make up the contents of this object.
This method in implemented within the document class.
The content array is in the form:
pContents(n,"type")="%String"
pContents(n,"name")="Field"
pContents(n,"alias")=alias code
If pContents(n) is non-zero then the property is a composite type with
sub-properties. The sub-properties are indexed with a similar structure under
pContents(n,m) where m is the index of the subtype property.
• classmethod GetManagerLinks(Output pColumns) as %Boolean
Returns an array of links to manager pages for this type of VDoc; item 0 is the family description
• method GetSubDocumentAt(pPropertyPath As %String = "", Output pStatus As %Status, pFormat As %String = "f") as EnsLib.EDI.XML.Document

Retrieve an XML virtual document constructed from the tree identified by pPropertyPath. This path may be either a "DOM Path" or a "Property Path". The Document instance is created using the supplied pPropertyPath as the root of the tree -- this is equivalent to calling the GetValueAt() with the "f" format flag specified.

A "DOM Path" is schema independent and starts from the document root with a '/' character and is delimited by the '/' character at each level of descent, and by square brackets '[' and ']' for repeating elements.

A "Property Path" is based on a simplified projection of the XML schema applied to the current document by way of its DocType property. It starts from the root element (one level down from the XML document root) and is delimited by the "." character and by parentheses '(' and ')' for repeating elements.

The third pFormat defaults to f if not supplied.
Pass in d in the pFormat string parameter to include namespace declarations from the top of source document. The f format parameter will be added if not inluded in the parameter.
• method GetValueAt(pPropertyPath As %String = "", pFormat As %String, Output pStatus As %Status, pDummy As %Boolean) as %String
Retrieve the content value of the XML element or attribute identified by pPropertyPath. This path may be either a "DOM Path" or a "Property Path".

A DOM path is schema independent and starts from the document root with a '/' character and is delimited by the '/' character at each level of descent, and by square brackets '[' and ']' for repeating elements.

A Property path is based on a simplified projection of the XML schema applied to the current document by way of its DocType property. It starts from the root element (one level down from the XML document root) and is delimited by the "." character and by parentheses '(' and ')' for repeating elements.

The pFormat argument is an optional string comprised of a collection of single-character flag codes:

  • 1-9 : indent with this number of spaces (4 is the default with the 'i' format specifier)
  • a : attributes alphabetical
  • c : canonical ; ignores 'eintw'
  • e : close elements even when empty
  • f : full top element not just its contents
  • i : indent with 4 spaces unless 't' or 1-9
  • l : output schema information, schema uri and schema location, based on property stored in ..schemaLocation
  • n : newline (lf) after every text-free element
  • o : output unescaped - for instance don't change < to &lt;
  • p : suppress output of namespace prefixes
  • q : use double quotes to set off attribute values if possible
  • s : use stored indentation whitespace (ignores 'it1-9')
  • r : use stored returns / newlines (ignores 'nw')
  • t : indent with tab
  • u : declare prefixes as well as using them
  • w : Windows-style cr/lf newline after every text-free element
  • x : omit namespaces in output
• method GetValues(pPropertyPath As %String = "", pFormat As %String, pValSepString As %String = "<>", Output pStatus As %Status) as %String
Finds all values matching a PropertyPath string that contains zero or more () implicit iterators Supports PropertyPath values with (), (n) to choose a specific one of the given type, or just plain (same as path().
• method GetValuesArray(pPropertyPath As %String, pFormat As %String, ByRef pArray As %String, Output pStatus As %Status, ByRef pLongArray As %String)
• method IdentifierGet() as %String
This is a Get accessor method for the Identifier property.
• classmethod ImportFromDevice(Output pStatus As %Status, ByRef pConfigItem As %String) as EnsLib.EDI.XML.Document
• classmethod ImportFromFile(pFilename As %String, pDocNum As %Integer = 1, Output pStatus As %Status, pConfigItem As %String) as EnsLib.EDI.XML.Document
• classmethod ImportFromIOStream(pIOStream As %IO.I.CharacterStream, Output pStatus As %Status = $$$OK, ByRef pConfigItem As %String = "") as EnsLib.EDI.XML.Document
• classmethod ImportFromLibraryStream(pLibStream As %Stream.Object, Output pStatus As %Status, ByRef pConfigItem As %String) as EnsLib.EDI.XML.Document
• classmethod ImportFromString(pString As %String, Output pStatus As %Status, ByRef pConfigItem As %String) as EnsLib.EDI.XML.Document
• classmethod KillGlobals(Output pDeletedCount, pKeepExtentCount=0, pDisplayLog=1)
• method NameGet() as %String
This is a Get accessor method for the Name property.
• method OutputHTMLZen() as %Status
Display Document as HTML
• method OutputToDevice(pFormat As %String) as %Status
• method OutputToFile(pFilename As %String, pOverwrite As %Boolean, pFormat As %String) as %Status
• method OutputToIOStream(pIOStream As %IO.I.CharacterStream, pFormat As %String, pFlush As %Boolean = 1) as %Status
If pFormat contains a string of the form: C(encoding) then an XML charset declaration line will be output. If encoding is empty the IOStream's encoding will be used. If encoding starts with ! then the IOStream's encoding will be set to the given encoding.
• method OutputToLibraryStream(pLibStream As %Stream.Object, pFormat As %String) as %Status
• method OutputToString(pFormat As %String, Output pStatus As %Status) as %String
• classmethod Purge(Output pDeletedCount As %Integer, pDaysToKeep As %Integer = 7, pDummy As %Boolean = 0) as %Status
• method RawContentGet() as %String
This is a Get accessor method for the RawContent property.
• method SetMaxCalcCache(size As %Integer)
• method SetSubDocumentAt(pSubDocument As EnsLib.EDI.XML.Document = "", pPropertyPath As %String = "") as %Status
Insert the XML representation of pSubDocument into this document at the path specified by pPropertyPath.
• method SetValueAt(pValue As %String = "", pPropertyPath As %String = "", pAction As %String = "set", pKey As %String = "") as %Status
Set the value of the designated virtual property.
pValue contains the value to set.
pPropertyPath contains a text expression representing the address within the document of the value of interest.
pKey contains an optional key value or a set of comma-separated key values to be used as array indices where empty array index placeholders are present in pPropertyPath.
pAction contains an action code: "set", "clear", "append", etc.
• classmethod TotalCount() as %Integer
• method TypeVersionGet() as %String
Subclasses should override this if the version can be gotten from the document content
• method UseGlobalContent() as %Status
Deprecated - see CommittedMode()
• method UseProcessContent()
Deprecated - see CommittedMode()
• method Validate(pValidationSpec As %String = "", pSSLConfig As %String = "", pHttpTimeout As %Numeric = "") as %Status
Validates the XML VDoc against the schema that is referenced in its DocType property. If the schema URL specifies https then you must provide an SSL configuration name in pSSLConfig that will work with the URL target server.
• classmethod XMLDTD(top As %String, format As %String, input As %Boolean, ByRef dtdlist) as %Status
No DTD available for XML VDoc
• method XMLExportInternal() as %Status
Export XML VDoc data
• method XMLImportInternal() as %Status
No XMLImport available for XML VDoc
• classmethod XMLSchema(top As %String, format As %String, namespacePrefix As %String = "", input As %Boolean, refOnly As %Boolean, ByRef schema) as %Status
No XMLSchema available for XML VDoc
• classmethod getContentAsString(pId As %String, pMaxLen As %Integer = 10000, pStartOffset As %Integer = 1) as %String
This method is for use from the RawContent property's SQL Compute invocation
• classmethod getIdentifier(pId, pDocType) as %String
• classmethod getName(pId As %String) as %String
• classmethod getTypeVersion(pId As %String) as %String
• method getValsArray(pPropertyPath As %String = "", pFormat As %String, ByRef pArray As %String, Output pStatus As %Status, ByRef pLongArray As %String)
Finds all values matching a SegPath:PropertyPath string that contains zero or more () implicit iterators
• method resolveEntity(publicID As %Library.String, systemID As %Library.String) as %Library.Integer

Queries


• query EnumerateDocTypes(Category As %String = "", IncludeBase As %Boolean = 0)
Selects Type As %String
Returns a list of available DocTypes for this document class.
The DocType is returned as the first column in the result set.
The Category parameter can be used to restrict the list.
If Category is:
0 - return only DocTypes in standard categories
+ - return only DocTypes in user-defined categories
empty - return DocTypes from all categories
a category name - return only DocTypes in the named category
a partial name suffixed with '%' - return only DocTypes in categories matching the partial category name
other - return nothing
If IncludeBase is:
0 - return only DocTypes defined in the current schema category itself
1 - return all DocTypes in the current schema category's base category in addition to those defined in the current category itself
• query EnumerateTypeCategories(Standard As %String = "")
Selects Category As %String, Description As %String, IsStandard As %Boolean, Base As %String
Returns a list of document type schema categories for the document class.
The Standard parameter can be used to restrict the list.
If Standard is: 0 - return only standard categories + - return only user-defined categories empty - return all categories a category name - return only the named category a partial name suffixed with '%' - return only categories matching the partial category name other - return nothing

Indices


•index (Extent on ) [Extent,Type = bitmap];
•index (OriginalDocId on OriginalDocId);

Triggers


•trigger OnDelete (BEFORE event DELETE)