package javax.xml.stream;
import java.io.Reader;
import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;
/**
* The XMLStreamReader interface allows forward, read-only access to XML.
* It is designed to be the lowest level and most efficient way to
* read XML data.
*
* <p> The XMLStreamReader is designed to iterate over XML using
* next() and hasNext(). The data can be accessed using methods such as getEventType(),
* getNamespaceURI(), getLocalName() and getText();
*
* <p> The <a href="#next()">next()</a> method causes the reader to read the next parse event.
* The next() method returns an integer which identifies the type of event just read.
* <p> The event type can be determined using <a href="#getEventType()">getEventType()</a>.
* <p> Parsing events are defined as the XML Declaration, a DTD,
* start tag, character data, white space, end tag, comment,
* or processing instruction. An attribute or namespace event may be encountered
* at the root level of a document as the result of a query operation.
*
* <p>For XML 1.0 compliance an XML processor must pass the
* identifiers of declared unparsed entities, notation declarations and their
* associated identifiers to the application. This information is
* provided through the property API on this interface.
* The following two properties allow access to this information:
* javax.xml.stream.notations and javax.xml.stream.entities.
* When the current event is a DTD the following call will return a
* list of Notations
* <code>List l = (List) getProperty("javax.xml.stream.notations");</code>
* The following call will return a list of entity declarations:
* <code>List l = (List) getProperty("javax.xml.stream.entities");</code>
* These properties can only be accessed during a DTD event and
* are defined to return null if the information is not available.
*
* <p>The following table describes which methods are valid in what state.
* If a method is called in an invalid state the method will throw a
* java.lang.IllegalStateException.
*
* <table border="2" rules="all" cellpadding="4">
* <thead>
* <tr>
* <th align="center" colspan="2">
* Valid methods for each state
* </th>
* </tr>
* </thead>
* <tbody>
* <tr>
* <th>Event Type</th>
* <th>Valid Methods</th>
* </tr>
* <tr>
* <td> All States </td>
* <td> getProperty(), hasNext(), require(), close(),
* getNamespaceURI(), isStartElement(),
* isEndElement(), isCharacters(), isWhiteSpace(),
* getNamespaceContext(), getEventType(),getLocation(),
* hasText(), hasName()
* </td>
* </tr>
* <tr>
* <td> START_ELEMENT </td>
* <td> next(), getName(), getLocalName(), hasName(), getPrefix(),
* getAttributeXXX(), isAttributeSpecified(),
* getNamespaceXXX(),
* getElementText(), nextTag()
* </td>
* </tr>
* <td> ATTRIBUTE </td>
* <td> next(), nextTag()
* getAttributeXXX(), isAttributeSpecified(),
* </td>
* </tr>
* </tr>
* <td> NAMESPACE </td>
* <td> next(), nextTag()
* getNamespaceXXX()
* </td>
* </tr>
* <tr>
* <td> END_ELEMENT </td>
* <td> next(), getName(), getLocalName(), hasName(), getPrefix(),
* getNamespaceXXX(), nextTag()
* </td>
* </tr>
* <tr>
* <td> CHARACTERS </td>
* <td> next(), getTextXXX(), nextTag() </td>
* </tr>
* <tr>
* <td> CDATA </td>
* <td> next(), getTextXXX(), nextTag() </td>
* </tr>
* <tr>
* <td> COMMENT </td>
* <td> next(), getTextXXX(), nextTag() </td>
* </tr>
=1= |