| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IXMLReader
Provides access to members that control the sequential reading of XML.
The IXMLReader interface provides twenty two methods to use for reading specific data elements.
| Method Summary | |
|---|---|
 void | 
closeElement()
Moves position to parent element.  | 
 IXMLAttributes | 
getAttributes()
Attributes of current element.  | 
 String | 
getLocalName()
Local name of current element.  | 
 IXMLNamespaces | 
getNamespaceDeclarations()
Namespace declarations of current element.  | 
 String | 
getNamespacePrefix()
Namespace prefix of current element.  | 
 String | 
getNamespaceURI()
Namespace URI of current element.  | 
 String | 
getText()
Text value of current element.  | 
 boolean | 
isHasElementChildren()
Indicates whether the current element has child elements.  | 
 boolean | 
isLastChild()
Indicates whether the current element is the last child element of its parent.  | 
 String | 
lookupPrefix(String prefix)
Obtains the prefix for a declared URI.  | 
 void | 
nextElement()
Moves position to next element.  | 
 void | 
openElement()
Moves position to first child element.  | 
 byte[] | 
readBinary()
Reads the current element value as a binary array.  | 
 boolean | 
readBoolean()
Reads the current element value as a boolean.  | 
 byte | 
readByte()
Reads the current element value as a byte.  | 
 Date | 
readDate()
Reads the current element value as a date.  | 
 double | 
readDouble()
Reads the current element value as a double.  | 
 float | 
readFloat()
Reads the current element value as a float.  | 
 void | 
readFrom(IStream inputStream)
Specifies the input XML stream.  | 
 int | 
readInteger()
Reads the current element value as a long.  | 
 short | 
readShort()
Reads the current element value as a short.  | 
 Object | 
readVariant()
Reads the current element value as a variant.  | 
| Method Detail | 
|---|
void readFrom(IStream inputStream)
              throws IOException,
                     AutomationException
The ReadFrom method specifies the input XML stream.
For example:
Dim pXmlReader As IXMLReader
Set pXmlReader = New XMLReader
Dim pXmlStream as IXMLStream
Set 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.
inputStream - A reference to a com.esri.arcgis.system.IStream  (in)
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
String getLocalName()
                    throws IOException,
                           AutomationException
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
String getNamespaceURI()
                       throws IOException,
                              AutomationException
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
String getNamespacePrefix()
                          throws IOException,
                                 AutomationException
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
IXMLNamespaces getNamespaceDeclarations()
                                        throws IOException,
                                               AutomationException
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
IXMLAttributes getAttributes()
                             throws IOException,
                                    AutomationException
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
String getText()
               throws IOException,
                      AutomationException
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
boolean isHasElementChildren()
                             throws IOException,
                                    AutomationException
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
boolean isLastChild()
                    throws IOException,
                           AutomationException
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
void nextElement()
                 throws IOException,
                        AutomationException
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
void openElement()
                 throws IOException,
                        AutomationException
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
void closeElement()
                  throws IOException,
                         AutomationException
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
String lookupPrefix(String prefix)
                    throws IOException,
                           AutomationException
prefix - The prefix  (in)
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
boolean readBoolean()
                    throws IOException,
                           AutomationException
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.
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
byte readByte()
              throws IOException,
                     AutomationException
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.
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
short readShort()
                throws IOException,
                       AutomationException
The ReadShort method specifies the current element value as a short.
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
int readInteger()
                throws IOException,
                       AutomationException
The ReadInteger method specifies the current element value as a Integer.
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
float readFloat()
                throws IOException,
                       AutomationException
The ReadFloat method specifies the current element value as a float.
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
double readDouble()
                  throws IOException,
                         AutomationException
The ReadDouble method specifies the current element value as a double.
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
Date readDate()
              throws IOException,
                     AutomationException
<?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 IXMLStream
Set pXMLStream = New XMLStream
  
pXMLStream.LoadFromFile App.Path + "\data.xml" 
pXMLReader.OpenElement
pXMLReader.OpenElement
Dim dateValue As Date
dateValue = pXMLReader.ReadDate
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
byte[] readBinary()
                  throws IOException,
                         AutomationException
The ReadBinary method specifies the current element value as a binary array.
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
Object readVariant()
                   throws IOException,
                          AutomationException
The ReadVariant method specifies the current element value as a variant.
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||