Skip to main content

%XML.TextReader

class %XML.TextReader extends %Library.RegisteredObject

For details on using this class, see Using %XML.TextReader.

Property Inventory

Method Inventory

Properties

property AttributeCount as %Integer;
Public property, Only applicable to element nodes. Returns the number of attributes on the current node.
Property methods: AttributeCountDisplayToLogical(), AttributeCountIsValid(), AttributeCountLogicalToDisplay(), AttributeCountNormalize(), AttributeCountSet()
property Depth as %Integer;
Public property, The depth of the current node in the XML document.
Property methods: DepthDisplayToLogical(), DepthIsValid(), DepthLogicalToDisplay(), DepthNormalize(), DepthSet()
property EOF as %Boolean;
Public property, true if the reader is positioned at the end of the stream; otherwise, false.
Property methods: EOFDisplayToLogical(), EOFIsValid(), EOFLogicalToDisplay(), EOFNormalize(), EOFSet()
property GlobalName as %String;
Property methods: GlobalNameDisplayToLogical(), GlobalNameGet(), GlobalNameIsValid(), GlobalNameLogicalToDisplay(), GlobalNameLogicalToOdbc(), GlobalNameNormalize(), GlobalNameSet()
property HasAttributes as %Boolean;
Public property, Gets a value indicating whether the current node has any attributes. true if the current node has attributes; otherwise, false.
Property methods: HasAttributesDisplayToLogical(), HasAttributesIsValid(), HasAttributesLogicalToDisplay(), HasAttributesNormalize(), HasAttributesSet()
property HasValue as %Boolean;
Public property, returns true if the node on which the reader is currently positioned can have a Value; otherwise, false. The following lists node types and the corresponding values:

Node Type :: Value

attribute :: The value of the attribute.
comment :: The content of the comment.
processinginstruction :: The entire content of the processing instruction, excluding the target.
ignorablewhitespace :: The white space between markup in a mixed content model.
chars :: The content of the text node.
startprefixmapping :: The prefix and uri of the mapping
endprefixmappping :: The prefix of the mapping

Property methods: HasValueDisplayToLogical(), HasValueIsValid(), HasValueLogicalToDisplay(), HasValueNormalize(), HasValueSet()
property IsEmptyElement as %Boolean;
Public property, returns true if the current element is empty
Property methods: IsEmptyElementDisplayToLogical(), IsEmptyElementIsValid(), IsEmptyElementLogicalToDisplay(), IsEmptyElementNormalize(), IsEmptyElementSet()
property LocalName as %String;
Public property, The name of the current node with the prefix removed. For example, LocalName is book for the element <bk:book>. The name returned is dependent on the NodeType of the node. The following node types return the listed values. All other node types return an empty string. Name: Attribute
Value: The name of the attribute.

Name: Element
Value: The tag name.

Property methods: LocalNameDisplayToLogical(), LocalNameIsValid(), LocalNameLogicalToDisplay(), LocalNameLogicalToOdbc(), LocalNameNormalize(), LocalNameSet()
property Name as %String;
Public property,The qualified name of the current node. For example, Name is bk:book for the element <bk:book>. The name returned is dependent on the NodeType of the node. The following node types return the listed values. All other node types return an empty string. Name: Attribute
Value: The name of the attribute.

Name: Element
Value: The tag name.

Name: EntityReference
Value: The name of the entity referenced.

Name: ProcessingInstruction
Value: The target of the processing instruction.

Name: StartPrefixMapping
Value: The prefix of the mapping and the uri mapped, delimited by a single space

Name: EndPrefixMapping
Value: The prefix of the mapping

Property methods: NameDisplayToLogical(), NameIsValid(), NameLogicalToDisplay(), NameLogicalToOdbc(), NameNormalize(), NameSet()
property NamespaceUri as %String;
Public property, The namespace URI of the current node; otherwise an empty string. This property is relevant to Element and Attribute nodes only.
Property methods: NamespaceUriDisplayToLogical(), NamespaceUriIsValid(), NamespaceUriLogicalToDisplay(), NamespaceUriLogicalToOdbc(), NamespaceUriNormalize(), NamespaceUriSet()
property NodeType as %String;
Public property, contains the node type of the current node as indicated by the following list:

attribute
cdata
comment
processinginstruction
ignorablewhitespace
chars
element
entity
endelement

Property methods: NodeTypeDisplayToLogical(), NodeTypeIsValid(), NodeTypeLogicalToDisplay(), NodeTypeLogicalToOdbc(), NodeTypeNormalize(), NodeTypeSet()
property Path as %String;
Public property, contains the current path to the containing element
Property methods: PathDisplayToLogical(), PathIsValid(), PathLogicalToDisplay(), PathLogicalToOdbc(), PathNormalize(), PathSet()
property ReadState as %String [ InitialExpression = "Initial" ];
Public property, returns the current read state of the reader The following table lists the states and their meanings

EndOfFile: The end of the file has been reached successfully.

Initial: The Read method has not been called.

Interactive: The Read method has been called. Additional methods may be called on the reader.

Property methods: ReadStateDisplayToLogical(), ReadStateIsValid(), ReadStateLogicalToDisplay(), ReadStateLogicalToOdbc(), ReadStateNormalize(), ReadStateSet()
property Value as %String;
Public property, returns the value of the current node. The following types have a value to return:

Node Type :: Value

attribute :: The value of the attribute.

cdata :: The content of the CDATA section.

comment :: The content of the comment.

processinginstruction :: The entire content of the processing instruction, excluding the target.

ignorablewhitespace :: The white space between markup in a mixed content model.

chars :: The content of the text node.

entity :: The expanded content of the entity

Property methods: ValueDisplayToLogical(), ValueIsValid(), ValueLogicalToDisplay(), ValueLogicalToOdbc(), ValueNormalize(), ValueSet()
property seq as %Integer [ InitialExpression = 0 ];
Property methods: seqDisplayToLogical(), seqGet(), seqIsValid(), seqLogicalToDisplay(), seqNormalize(), seqSet()

Methods

method %OnClose() as %Status
Inherited description: 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.

method %OnNew(pInitval As %Integer, pGlobalName As %String = "^IRIS.Temp") as %Status
Inherited description: This callback method is invoked by the %New() method to provide notification that a new instance of an object is being created.

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

It is passed the arguments provided in the %New call. When customizing this method, override the arguments with whatever variables and types you expect to receive from %New(). For example, if you're going to call %New, passing 2 arguments, %OnNew's signature could be:

Method %OnNew(dob as %Date = "", name as %Name = "") as %Status If instead of returning a %Status code this returns an oref and this oref is a subclass of the current class then this oref will be the one returned to the caller of %New method.

method AttributeCountGet() as %Integer
AttributeCount Implementation
method DepthGet() as %Integer
Depth Implementation
method EOFGet() as %Boolean
EOF Implementation
method HasAttributesGet() as %Boolean
HasAttributes Implementation
method HasValueGet() as %Boolean
HasValue Implementation
method IsEmptyElementGet() as %Boolean
IsEmptyElement Implementation
method LocalNameGet() as %String
LocalName implementation
method MoveToAttributeIndex(pIndex As %String) as %Boolean
Moves to the attribute with the specified index. returns true on success false otherwise
method MoveToAttributeName(pName As %String, pUri As %String = "") as %Boolean
method MoveToContent() as %Boolean
Checks whether the current node is a content (non-white space text, CDATA, Element, EndElement, EntityReference, or EndEntity) node. If the node is not a content node, the reader skips ahead to the next content node or end of file. It skips over nodes of the following types: processinginstruction, comment, ignorablewhitespace,endelement
method MoveToElement() as %Boolean
Moves to the associated element when the current node is of type attribute
method NameGet() as %String
Name implementation
method NamespaceUriGet() as %String
NamespaceUri Implementation
method NodeTypeGet() as %String
NodeType implementation
final classmethod ParseFile(Filename As %String, Output TextReader As %XML.TextReader, Resolver As %XML.SAX.EntityResolver = $$$NULLOREF, Flags As %Integer = $$$SAXDEFAULTS, Mask As %Integer = $$$SAXCONTENTEVENTS, SchemaSpec As %String = "", KeepWhiteSpace As %Boolean = 0, GlobalName As %String = "^||IRIS.Temp") as %Status
This method takes the name of a file to be parsed and a reference to a variable which, upon success, will be set to a new instance of an %XML.TextReader. Optionally, additional arguments specifying an Entity resolver, Flags , Mask and SchemaSpec be passed. Please see class %XML.SAX.Parser for a full description of these optional parameters.
final classmethod ParseStream(Stream As %AbstractStream, Output TextReader As %XML.TextReader, Resolver As %XML.SAX.EntityResolver = $$$NULLOREF, Flags As %Integer = $$$SAXDEFAULTS, Mask As %Integer = $$$SAXCONTENTEVENTS, SchemaSpec As %String = "", KeepWhiteSpace As %Boolean = 0, GlobalName As %String = "^||IRIS.Temp") as %Status
This method takes a Stream to be parsed and a reference to a variable which, upon success, will be set to a new instance of an %XML.TextReader. Optionally, additional arguments specifying an Entity resolver, Flags , Mask and SchemaSpec be passed. Please see class %XML.SAX.Parser for a full description of these optional parameters.
final classmethod ParseString(String As %String, Output TextReader As %XML.TextReader, Resolver As %XML.SAX.EntityResolver = $$$NULLOREF, Flags As %Integer = $$$SAXDEFAULTS, Mask As %Integer = $$$SAXCONTENTEVENTS, SchemaSpec As %String = "", KeepWhiteSpace As %Boolean = 0, GlobalName As %String = "^||IRIS.Temp") as %Status
This method takes a String to be parsed and a reference to a variable which, upon success, will be set to a new instance of an %XML.TextReader. Optionally, additional arguments specifying an Entity resolver, Flags , Mask and SchemaSpec be passed. Please see class %XML.SAX.Parser for a full description of these optional parameters.
final classmethod ParseURL(URL As %String, Output TextReader As %XML.TextReader, Resolver As %XML.SAX.EntityResolver = $$$NULLOREF, Flags As %Integer = $$$SAXDEFAULTS, Mask As %Integer = $$$SAXCONTENTEVENTS, SchemaSpec As %String = "", KeepWhiteSpace As %Boolean = 0, pHttpRequest As %Net.HttpRequest = $$$NULLOREF, GlobalName As %String = "^||IRIS.Temp") as %Status
This method takes a URL to be parsed and a reference to a variable which, upon success, will be set to a new instance of an %XML.TextReader. Optionally, additional arguments specifying an Entity resolver, Flags , Mask and SchemaSpec be passed. Please see class %XML.SAX.Parser for a full description of these optional parameters.
method PathGet() as %String
Implementation of Path property.
method Read() as %Boolean
Reads the next node from the stream. Returns true if the next node was read successfully; false if there are no more nodes to read. When an XmlReader is first created and initialized, there is no information available. You must call Read to read the first node. Each node has a particular type. There is not necessarily a one to one correspondence between the number of nodes in a document and the number of identifiable xml components. For example,the cdata, comment and chars nodes contain textual information which corresponds to their XML equivalent in the document. However a single XML component of type chars may be spread over a number of nodes of the same type. This is entirely due to the way the XML engine processes the document. Therefore if you do a read and the node type is character, for example, then you have to continue reading until the node type changes to ensure that you have seen all the character data.
method ReadStartElement(pName As %String, pUri As %String = "") as %Boolean
Advances to the first element that matches the provided name and (optional) namespace uri Returns true on success, false if the element could not be matched
method ReadStateGet() as %String
ReadState Implementation
method Rewind()
Resets the reader to the initial state
method ValueGet() as %String
Value Implementation

Inherited Members

Inherited Methods

FeedbackOpens in a new tab