Home > Class Reference > ENSLIB namespace > %XML.Reader


class %XML.Reader extends %Library.RegisteredObject

XML Objects Reader class. A usage example follows:
  #include %occStatus
  // Create a new XML Reader class
  Set reader = ##class(%XML.Reader).%New()
  // Begin processing of the XML input
  Set sc=reader.OpenFile(filename)
  If $$$ISERR(sc) Do $system.OBJ.DisplayError(sc) Quit  
  // Associate a class name with the XML element name
  Do reader.Correlate("Person","Sample.Person")
  // read Sample.Person objects from xml file
  Set Count=0
  While reader.Next(.person,.sc) {
      Write person.Name_" imported.",!
      Set Count=Count+1
      Set sc=person.%Save()
      If $$$ISERR(sc) Do $system.OBJ.DisplayError(sc) Quit  
  If $$$ISERR(sc) Do $system.OBJ.DisplayError(sc) Quit  
  Write Count_" Sample.Person instances found."

Property Inventory (Including Private)

Method Inventory (Including Private)

Properties (Including Private)

property CheckRequired as %Boolean [ InitialExpression = 0 ];
Checking the existence of REQUIRED properties is off by default in %XML.Reader. To turn on REQUIRED property checking. set the CheckRequired property to 1 (default is 0).
Property methods: CheckRequiredDisplayToLogical(), CheckRequiredGet(), CheckRequiredIsValid(), CheckRequiredLogicalToDisplay(), CheckRequiredNormalize(), CheckRequiredSet()
property Document as %XML.Document;
The %XML.Document that holds the parsed XML document.
Property methods: DocumentGet(), DocumentGetSwizzled(), DocumentIsValid(), DocumentNewObject(), DocumentSet()
property EntityResolver as %XML.SAX.EntityResolver;
This property should be set to an instance of %XML.SAX.EntityResolver OR a user-defined subclass IF the default EntityResolver is not required
Property methods: EntityResolverGet(), EntityResolverGetSwizzled(), EntityResolverIsValid(), EntityResolverNewObject(), EntityResolverSet()
property Format as %String;
The format of the XML document: "literal", "encoded" or "encoded12". This parameter may be overriden by the Open... format parameter.
Property methods: FormatDisplayToLogical(), FormatGet(), FormatIsValid(), FormatLogicalToDisplay(), FormatLogicalToOdbc(), FormatNormalize(), FormatSet()
property IgnoreNull as %String [ InitialExpression = 0 ];
The runtime specification of the XMLIGNORENULL parameter to %XML.Adaptor. IgnoreNull specifies the value of XMLIGNORENULL at runtime as either 0, 1 or inputonly. IgnoreNull="inputonly" is equivalent to IgnoreNull=1.
Property methods: IgnoreNullDisplayToLogical(), IgnoreNullGet(), IgnoreNullIsValid(), IgnoreNullLogicalToDisplay(), IgnoreNullLogicalToOdbc(), IgnoreNullNormalize(), IgnoreNullSet()
property IgnoreSAXWarnings as %Boolean [ InitialExpression = 0 ];
If true (1), then any warnings from the SAX parser will be not be reported and ignored.
Property methods: IgnoreSAXWarningsDisplayToLogical(), IgnoreSAXWarningsGet(), IgnoreSAXWarningsIsValid(), IgnoreSAXWarningsLogicalToDisplay(), IgnoreSAXWarningsNormalize(), IgnoreSAXWarningsSet()
property Node as %String [ InitialExpression = 0 ];
Current node in tree representation of XML document. Note that 0 means the document itself, i.e. the parent of the root element.
Property methods: NodeDisplayToLogical(), NodeGet(), NodeIsCurrentDisplayToLogical(), NodeIsCurrentGet(), NodeIsCurrentIsValid(), NodeIsCurrentLogicalToDisplay(), NodeIsCurrentNormalize(), NodeIsCurrentSet(), NodeIsValid(), NodeLogicalToDisplay(), NodeLogicalToOdbc(), NodeNormalize(), NodeSet()
property OpenFormat as %String [ Private ];
The internal format to be used for XMLImport. This property is set during Open.
Property methods: OpenFormatDisplayToLogical(), OpenFormatGet(), OpenFormatIsValid(), OpenFormatLogicalToDisplay(), OpenFormatLogicalToOdbc(), OpenFormatNormalize(), OpenFormatSet()
property SAXFlags as %Integer [ InitialExpression = $$$SAXFULLDEFAULT ];
This property should be set to a combination of flags (see %occSAX.inc for details) if the default behavior of the parser is required to be modified
Property methods: SAXFlagsDisplayToLogical(), SAXFlagsGet(), SAXFlagsIsValid(), SAXFlagsLogicalToDisplay(), SAXFlagsNormalize(), SAXFlagsSet()
property SAXMask as %Integer [ InitialExpression = $$$SAXCONTENTEVENTS ];
The SAXMask property is kept for compatibility only. The best mask is now computed and this property ignored.
Property methods: SAXMaskDisplayToLogical(), SAXMaskGet(), SAXMaskIsValid(), SAXMaskLogicalToDisplay(), SAXMaskNormalize(), SAXMaskSet()
property SAXSchemaSpec as %String;
This property specifies the schema specifications that should be used when validating the document. See %XML.SAX.Parser for a full description of this property.
Property methods: SAXSchemaSpecDisplayToLogical(), SAXSchemaSpecGet(), SAXSchemaSpecIsValid(), SAXSchemaSpecLogicalToDisplay(), SAXSchemaSpecLogicalToOdbc(), SAXSchemaSpecNormalize(), SAXSchemaSpecSet()
property SSLConfiguration as %String;
The name of the activated TLS/SSL configuration to use for https requests by the entity resolver.
Property methods: SSLConfigurationDisplayToLogical(), SSLConfigurationGet(), SSLConfigurationIsValid(), SSLConfigurationLogicalToDisplay(), SSLConfigurationLogicalToOdbc(), SSLConfigurationNormalize(), SSLConfigurationSet()
property Summary as %Boolean [ InitialExpression = 0 ];
If true (1), then only the summary fields should be imported by the %XML.Adaptor.
Property methods: SummaryDisplayToLogical(), SummaryGet(), SummaryIsValid(), SummaryLogicalToDisplay(), SummaryNormalize(), SummarySet()
property UsePPGHandler as %Boolean;
If UsePPGHandler is true (1), then force document parsing to use PPG memory. If UsePPGHandler is false (0), then force document parsing to use local array memory. If UsePPGHandler is not set ( or = ""), then use default memory -- usually local array memory.
Property methods: UsePPGHandlerDisplayToLogical(), UsePPGHandlerGet(), UsePPGHandlerIsValid(), UsePPGHandlerLogicalToDisplay(), UsePPGHandlerNormalize(), UsePPGHandlerSet()

Methods (Including Private)

method Close()