Home > Class Reference > %SYS namespace > %ZHSLIB.PackageManager.Developer.XML.CommentHandler

%ZHSLIB.PackageManager.Developer.XML.CommentHandler

class %ZHSLIB.PackageManager.Developer.XML.CommentHandler extends %XML.SAX.ContentHandler

Use: Extracts XML comments from a document and allows them to be added back in later, assuming that the XPath paths to their previous locations are still valid.

Property Inventory (Including Private)

Method Inventory (Including Private)

Properties (Including Private)

property Content [ Private , MultiDimensional ];
..Content = ..Content(i) = $lb((comment|characters),)
Property methods: ContentDisplayToLogical(), ContentGet(), ContentIsValid(), ContentLogicalToDisplay(), ContentLogicalToOdbc(), ContentMapDisplayToLogical(), ContentMapGet(), ContentMapIsValid(), ContentMapLogicalToDisplay(), ContentMapLogicalToOdbc(), ContentMapNormalize(), ContentMapSet(), ContentNormalize(), ContentSet()
property ContentMap [ Private , MultiDimensional ];
..ContentMap(i) =
Property methods: ContentMapDisplayToLogical(), ContentMapGet(), ContentMapIsValid(), ContentMapLogicalToDisplay(), ContentMapLogicalToOdbc(), ContentMapNormalize(), ContentMapSet()
property LastNodeType as %String [ Private ];
Last node type (document, element, comment)
Property methods: LastNodeTypeDisplayToLogical(), LastNodeTypeGet(), LastNodeTypeIsValid(), LastNodeTypeLogicalToDisplay(), LastNodeTypeLogicalToOdbc(), LastNodeTypeNormalize(), LastNodeTypeSet()
property Path [ Private , MultiDimensional ];
..Path = ..Path(i) = $ListBuild(,,)
Property methods: PathCountsDisplayToLogical(), PathCountsGet(), PathCountsIsValid(), PathCountsLogicalToDisplay(), PathCountsLogicalToOdbc(), PathCountsNormalize(), PathCountsSet(), PathDisplayToLogical(), PathGet(), PathIsValid(), PathLogicalToDisplay(), PathLogicalToOdbc(), PathNormalize(), PathSet()
property PathCounts [ Private , MultiDimensional ];
If no attributes are available to identify an element, then occurrences of element paths are counted and used instead (stored here) ..PathCount($zcrc(,7)) =
Property methods: PathCountsDisplayToLogical(), PathCountsGet(), PathCountsIsValid(), PathCountsLogicalToDisplay(), PathCountsLogicalToOdbc(), PathCountsNormalize(), PathCountsSet()
property ReplacePaths [ Private , MultiDimensional ];
In case a duplicate path is found later in processing, this is used to track what the replacement should be. ..ReplacePaths($zcrc(,7)) =
Property methods: ReplacePathsDisplayToLogical(), ReplacePathsGet(), ReplacePathsIsValid(), ReplacePathsLogicalToDisplay(), ReplacePathsLogicalToOdbc(), ReplacePathsNormalize(), ReplacePathsSet()
property UnmappedContent [ Private , MultiDimensional ];
Content (comments/whitespace) that have been found but not yet mapped to their appropriate position in the document.
Property methods: UnmappedContentDisplayToLogical(), UnmappedContentGet(), UnmappedContentIsValid(), UnmappedContentLogicalToDisplay(), UnmappedContentLogicalToOdbc(), UnmappedContentNormalize(), UnmappedContentSet()

Methods (Including Private)

private classmethod BuildAttributeFilter(pAttrList As %List) as %String [ Language = objectscript ]
method GetPosition() as %String [ Language = objectscript ]
Returns current position in the XML document, as an XPath expression with information on the next non-comment node.
method MapContent() [ Language = objectscript ]
method Reapply(ByRef pXMLStream As %Stream.Object, pIndent As %Boolean = 1) as %Status [ Language = objectscript ]
method characters(chars As %Library.String, length As %Library.Integer) [ Language = objectscript ]
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 %String, length As %Integer) [ Language = objectscript ]
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 endElement(uri As %Library.String, localname As %Library.String, qname As %Library.String) [ Language = objectscript ]
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 startDocument() [ Language = objectscript ]
Receive notification of the beginning of the document.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the beginning of a document (such as allocating the root node of a tree or creating an output file)

method startElement(uri As %Library.String, localname As %Library.String, qname As %Library.String, attrs As %Library.List) [ Language = objectscript ]
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

Inherited Members

Inherited Methods (Including Private)