IXMLReader Interface

Provides access to members that control the sequential reading of XML.

Members

Name Description
Read-only property Attributes Attributes of current element.
Method CloseElement Moves position to parent element.
Read-only property HasElementChildren Indicates whether the current element has child elements.
Read-only property IsLastChild Indicates whether the current element is the last child element of its parent.
Read-only property LocalName Local name of current element.
Method LookupPrefix Obtains the prefix for a declared URI.
Read-only property NamespaceDeclarations Namespace declarations of current element.
Read-only property NamespacePrefix Namespace prefix of current element.
Read-only property NamespaceURI Namespace URI of current element.
Method NextElement Moves position to next element.
Method OpenElement Moves position to first child element.
Method ReadBinary Reads the current element value as a binary array.
Method ReadBoolean Reads the current element value as a boolean.
Method ReadByte Reads the current element value as a byte.
Method ReadDate Reads the current element value as a date.
Method ReadDouble Reads the current element value as a double.
Method ReadFloat Reads the current element value as a float.
Method ReadFrom Specifies the input XML stream.
Method ReadInteger Reads the current element value as a long.
Method ReadShort Reads the current element value as a short.
Method ReadVariant Reads the current element value as a variant.
Read-only property Text Text value of current element.

IXMLReader.Attributes Property

Attributes of current element.

Public ReadOnly Property Attributes As IXMLAttributes
public IXMLAttributes Attributes {get;}

IXMLReader.CloseElement Method

Moves position to parent element.

Public Sub CloseElement ( _
)
public void CloseElement (
);

IXMLReader.HasElementChildren Property

Indicates whether the current element has child elements.

Public ReadOnly Property HasElementChildren As Boolean
public bool HasElementChildren {get;}

IXMLReader.IsLastChild Property

Indicates whether the current element is the last child element of its parent.

Public ReadOnly Property IsLastChild As Boolean
public bool IsLastChild {get;}

IXMLReader.LocalName Property

Local name of current element.

Public ReadOnly Property LocalName As String
public string LocalName {get;}

IXMLReader.LookupPrefix Method

Obtains the prefix for a declared URI.

Public Function LookupPrefix ( _
    ByVal Prefix As String _
) As String
public string LookupPrefix (
    string Prefix
);

IXMLReader.NamespaceDeclarations Property

Namespace declarations of current element.

Public ReadOnly Property NamespaceDeclarations As IXMLNamespaces
public IXMLNamespaces NamespaceDeclarations {get;}

IXMLReader.NamespacePrefix Property

Namespace prefix of current element.

Public ReadOnly Property NamespacePrefix As String
public string NamespacePrefix {get;}

IXMLReader.NamespaceURI Property

Namespace URI of current element.

Public ReadOnly Property NamespaceURI As String
public string NamespaceURI {get;}

IXMLReader.NextElement Method

Moves position to next element.

Public Sub NextElement ( _
)
public void NextElement (
);

IXMLReader.OpenElement Method

Moves position to first child element.

Public Sub OpenElement ( _
)
public void OpenElement (
);

IXMLReader.ReadBinary Method

Reads the current element value as a binary array.

Public Function ReadBinary ( _
) As Byte[]
public Byte[] ReadBinary (
);

Remarks

The ReadBinary method specifies the current element value as a binary array.

IXMLReader.ReadBoolean Method

Reads the current element value as a boolean.

Public Function ReadBoolean ( _
) As Boolean
public bool ReadBoolean (
);

Remarks

The ReadBoolean method specifies the current element value as a boolean.

Element value 1 or true will return boolean value of true, anything else will return false.

IXMLReader.ReadByte Method

Reads the current element value as a byte.

Public Function ReadByte ( _
) As Byte
public byte ReadByte (
);

Description

Remarks

The ReadByte method specifies the current element value as a byte.

Byte variables are stored as single, unsigned 8 bit numbers (1 byte), its range is from 0 to 255. Anything below and above these numbers will cause the Invalid Procedure Call Error.

IXMLReader.ReadDate Method

Reads the current element value as a date.

Public Function ReadDate ( _
) As DateTime
public DateTime ReadDate (
);

Remarks

The ReadDate method specifies the current element value as a date.Date value in xml file should be only of this format:2005-01-28T12:17:58otherwise the ReadDate will invoke Invalid Procedure Call Error.Example of "data.xml" file:

<?xml version="1.0"?><Data description="example of ReadDate"><type><date>2005-01-28T12:23:34</date>

</type>

</Data>

VB6 code to get date value:

Dim pXMLStream As IXMLStreamSet pXMLStream = New XMLStreampXMLStream.LoadFromFile App.Path + "\data.xml"pXMLReader.OpenElementpXMLReader.OpenElementDim dateValue As DatedateValue = pXMLReader.ReadDate

IXMLReader.ReadDouble Method

Reads the current element value as a double.

Public Function ReadDouble ( _
) As Double
public double ReadDouble (
);

Remarks

The ReadDouble method specifies the current element value as a double.

IXMLReader.ReadFloat Method

Reads the current element value as a float.

Public Function ReadFloat ( _
) As Single
public float ReadFloat (
);

Remarks

The ReadFloat method specifies the current element value as a float.

IXMLReader.ReadFrom Method

Specifies the input XML stream.

Public Sub ReadFrom ( _
    ByVal inputStream As IStream _
)
public void ReadFrom (
    IStream inputStream
);

Remarks

The ReadFrom method specifies the input XML stream.

For example:

Dim pXmlReader As IXMLReaderSet pXmlReader = New XMLReader

Dim pXmlStream as IXMLStreamSet pXmlStream = new XMLStream

pXmlStream.OpenFromFile App.Path & "\file.xml"pXmlReader.ReadFrom pXmlStream

If xml file is empty the XMLStream will evoke Automation error. Xml file needs to be of a proper structure.

IXMLReader.ReadInteger Method

Reads the current element value as a long.

Public Function ReadInteger ( _
) As Integer
public int ReadInteger (
);

Remarks

The ReadInteger method specifies the current element value as a Integer.

IXMLReader.ReadShort Method

Reads the current element value as a short.

Public Function ReadShort ( _
) As Short
public short ReadShort (
);

Remarks

The ReadShort method specifies the current element value as a short.

IXMLReader.ReadVariant Method

Reads the current element value as a variant.

Public Function ReadVariant ( _
) As Object
public object ReadVariant (
);

Remarks

The ReadVariant method specifies the current element value as a variant.

IXMLReader.Text Property

Text value of current element.

Public ReadOnly Property Text As String
public string Text {get;}

Classes that implement IXMLReader

Classes Description
XMLReader An XML sequential document reader.

Remarks

The IXMLReaderinterface provides twenty two methods to use for reading specific data elements.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.