jaxp/src/share/classes/javax/xml/stream/XMLStreamReader.java
author ohair
Mon, 14 Apr 2008 14:52:27 -0700
changeset 311 3c14f21bf3f7
parent 6 7f561c08de6b
permissions -rw-r--r--
6484686: The next directory looks like it is no longer part of the build (deploy makefiles) Summary: Getting rid of the _OUTPUTDIR settings. Using BUILD_PARENT_DIRECTORY instead. This solves problems with the "/build/windows-i586*" paths getting mangled on Windows builds (fastdebug builds in particular). Reviewed-by: tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
 * This code is free software; you can redistribute it and/or modify it
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
 * under the terms of the GNU General Public License version 2 only, as
7f561c08de6b Initial load
duke
parents:
diff changeset
     6
 * published by the Free Software Foundation.  Sun designates this
7f561c08de6b Initial load
duke
parents:
diff changeset
     7
 * particular file as subject to the "Classpath" exception as provided
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
 * by Sun in the LICENSE file that accompanied this code.
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 * accompanied this code).
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
 * CA 95054 USA or visit www.sun.com if you need additional information or
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
 * have any questions.
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
 * Copyright (c) 2003 by BEA Systems, Inc. All Rights Reserved.
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
package javax.xml.stream;
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
import java.io.Reader;
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
import javax.xml.namespace.NamespaceContext;
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
import javax.xml.namespace.QName;
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
 *  The XMLStreamReader interface allows forward, read-only access to XML.
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 *  It is designed to be the lowest level and most efficient way to
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 *  read XML data.
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 * <p> The XMLStreamReader is designed to iterate over XML using
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
 * next() and hasNext().  The data can be accessed using methods such as getEventType(),
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
 * getNamespaceURI(), getLocalName() and getText();
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
 * <p> The <a href="#next()">next()</a> method causes the reader to read the next parse event.
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
 * The next() method returns an integer which identifies the type of event just read.
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
 * <p> The event type can be determined using <a href="#getEventType()">getEventType()</a>.
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
 * <p> Parsing events are defined as the XML Declaration, a DTD,
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
 * start tag, character data, white space, end tag, comment,
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
 * or processing instruction.  An attribute or namespace event may be encountered
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
 * at the root level of a document as the result of a query operation.
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
 * <p>For XML 1.0 compliance an XML processor must pass the
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
 * identifiers of declared unparsed entities, notation declarations and their
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
 * associated identifiers to the application.  This information is
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
 * provided through the property API on this interface.
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
 * The following two properties allow access to this information:
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
 * javax.xml.stream.notations and javax.xml.stream.entities.
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
 * When the current event is a DTD the following call will return a
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
 * list of Notations
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
 *  <code>List l = (List) getProperty("javax.xml.stream.notations");</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
 * The following call will return a list of entity declarations:
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
 * <code>List l = (List) getProperty("javax.xml.stream.entities");</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
 * These properties can only be accessed during a DTD event and
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
 * are defined to return null if the information is not available.
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
 * <p>The following table describes which methods are valid in what state.
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
 * If a method is called in an invalid state the method will throw a
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
 * java.lang.IllegalStateException.
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
 * <table border="2" rules="all" cellpadding="4">
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
 *   <thead>
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
 *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
 *       <th align="center" colspan="2">
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
 *         Valid methods for each state
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
 *       </th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
 *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
 *   </thead>
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
 *   <tbody>
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
 *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
 *       <th>Event Type</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
 *       <th>Valid Methods</th>
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
 *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
 *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
 *       <td> All States  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
 *       <td> getProperty(), hasNext(), require(), close(),
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
 *            getNamespaceURI(), isStartElement(),
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
 *            isEndElement(), isCharacters(), isWhiteSpace(),
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
 *            getNamespaceContext(), getEventType(),getLocation(),
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
 *            hasText(), hasName()
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
 *       </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
 *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
 *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
 *       <td> START_ELEMENT  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
 *       <td> next(), getName(), getLocalName(), hasName(), getPrefix(),
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
 *            getAttributeXXX(), isAttributeSpecified(),
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
 *            getNamespaceXXX(),
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
 *            getElementText(), nextTag()
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
 *       </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
 *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
 *       <td> ATTRIBUTE  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
 *       <td> next(), nextTag()
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
 *            getAttributeXXX(), isAttributeSpecified(),
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
 *       </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
 *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
 *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
 *       <td> NAMESPACE  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
 *       <td> next(), nextTag()
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
 *            getNamespaceXXX()
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
 *       </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
 *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
 *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
 *       <td> END_ELEMENT  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
 *       <td> next(), getName(), getLocalName(), hasName(), getPrefix(),
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
 *            getNamespaceXXX(), nextTag()
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
 *      </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
 *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
 *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
 *       <td> CHARACTERS  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
 *       <td> next(), getTextXXX(), nextTag() </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
 *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
 *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
 *       <td> CDATA  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
 *       <td> next(), getTextXXX(), nextTag() </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
 *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
 *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
 *       <td> COMMENT  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
 *       <td> next(), getTextXXX(), nextTag() </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
 *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
 *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
 *       <td> SPACE  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
 *       <td> next(), getTextXXX(), nextTag() </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
 *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
 *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
 *       <td> START_DOCUMENT  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
 *       <td> next(), getEncoding(), getVersion(), isStandalone(), standaloneSet(),
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
 *            getCharacterEncodingScheme(), nextTag()</td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
 *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
 *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
 *       <td> END_DOCUMENT  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
 *       <td> close()</td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
 *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
 *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
 *       <td> PROCESSING_INSTRUCTION  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
 *       <td> next(), getPITarget(), getPIData(), nextTag() </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
 *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
 *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
 *       <td> ENTITY_REFERENCE  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
 *       <td> next(), getLocalName(), getText(), nextTag() </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
 *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
 *     <tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
 *       <td> DTD  </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
 *       <td> next(), getText(), nextTag() </td>
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
 *     </tr>
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
 *   </tbody>
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
 *  </table>
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
   157
 * @author Copyright (c) 2003 by BEA Systems. All Rights Reserved.
7f561c08de6b Initial load
duke
parents:
diff changeset
   158
 * @see javax.xml.stream.events.XMLEvent
7f561c08de6b Initial load
duke
parents:
diff changeset
   159
 * @see XMLInputFactory
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
 * @see XMLStreamWriter
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
 * @since 1.6
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
public interface XMLStreamReader extends XMLStreamConstants {
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
   * Get the value of a feature/property from the underlying implementation
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
   * @param name The name of the property, may not be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
   * @return The value of the property
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
   * @throws IllegalArgumentException if name is null
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
  public Object getProperty(java.lang.String name) throws java.lang.IllegalArgumentException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   171
7f561c08de6b Initial load
duke
parents:
diff changeset
   172
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   173
   * Get next parsing event - a processor may return all contiguous
7f561c08de6b Initial load
duke
parents:
diff changeset
   174
   * character data in a single chunk, or it may split it into several chunks.
7f561c08de6b Initial load
duke
parents:
diff changeset
   175
   * If the property javax.xml.stream.isCoalescing is set to true
7f561c08de6b Initial load
duke
parents:
diff changeset
   176
   * element content must be coalesced and only one CHARACTERS event
7f561c08de6b Initial load
duke
parents:
diff changeset
   177
   * must be returned for contiguous element content or
7f561c08de6b Initial load
duke
parents:
diff changeset
   178
   * CDATA Sections.
7f561c08de6b Initial load
duke
parents:
diff changeset
   179
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   180
   * By default entity references must be
7f561c08de6b Initial load
duke
parents:
diff changeset
   181
   * expanded and reported transparently to the application.
7f561c08de6b Initial load
duke
parents:
diff changeset
   182
   * An exception will be thrown if an entity reference cannot be expanded.
7f561c08de6b Initial load
duke
parents:
diff changeset
   183
   * If element content is empty (i.e. content is "") then no CHARACTERS event will be reported.
7f561c08de6b Initial load
duke
parents:
diff changeset
   184
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   185
   * <p>Given the following XML:<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   186
   * &lt;foo>&lt;!--description-->content text&lt;![CDATA[&lt;greeting>Hello&lt;/greeting>]]>other content&lt;/foo><br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   187
   * The behavior of calling next() when being on foo will be:<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   188
   * 1- the comment (COMMENT)<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   189
   * 2- then the characters section (CHARACTERS)<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   190
   * 3- then the CDATA section (another CHARACTERS)<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   191
   * 4- then the next characters section (another CHARACTERS)<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   192
   * 5- then the END_ELEMENT<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   193
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   194
   * <p><b>NOTE:</b> empty element (such as &lt;tag/>) will be reported
7f561c08de6b Initial load
duke
parents:
diff changeset
   195
   *  with  two separate events: START_ELEMENT, END_ELEMENT - This preserves
7f561c08de6b Initial load
duke
parents:
diff changeset
   196
   *   parsing equivalency of empty element to &lt;tag>&lt;/tag>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   197
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   198
   * This method will throw an IllegalStateException if it is called after hasNext() returns false.
7f561c08de6b Initial load
duke
parents:
diff changeset
   199
   * @see javax.xml.stream.events.XMLEvent
7f561c08de6b Initial load
duke
parents:
diff changeset
   200
   * @return the integer code corresponding to the current parse event
7f561c08de6b Initial load
duke
parents:
diff changeset
   201
   * @throws NoSuchElementException if this is called when hasNext() returns false
7f561c08de6b Initial load
duke
parents:
diff changeset
   202
   * @throws XMLStreamException  if there is an error processing the underlying XML source
7f561c08de6b Initial load
duke
parents:
diff changeset
   203
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   204
  public int next() throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   205
7f561c08de6b Initial load
duke
parents:
diff changeset
   206
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   207
   * Test if the current event is of the given type and if the namespace and name match the current
7f561c08de6b Initial load
duke
parents:
diff changeset
   208
   * namespace and name of the current event.  If the namespaceURI is null it is not checked for equality,
7f561c08de6b Initial load
duke
parents:
diff changeset
   209
   * if the localName is null it is not checked for equality.
7f561c08de6b Initial load
duke
parents:
diff changeset
   210
   * @param type the event type
7f561c08de6b Initial load
duke
parents:
diff changeset
   211
   * @param namespaceURI the uri of the event, may be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   212
   * @param localName the localName of the event, may be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   213
   * @throws XMLStreamException if the required values are not matched.
7f561c08de6b Initial load
duke
parents:
diff changeset
   214
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   215
  public void require(int type, String namespaceURI, String localName) throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   216
7f561c08de6b Initial load
duke
parents:
diff changeset
   217
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   218
   * Reads the content of a text-only element, an exception is thrown if this is
7f561c08de6b Initial load
duke
parents:
diff changeset
   219
   * not a text-only element.
7f561c08de6b Initial load
duke
parents:
diff changeset
   220
   * Regardless of value of javax.xml.stream.isCoalescing this method always returns coalesced content.
7f561c08de6b Initial load
duke
parents:
diff changeset
   221
   * <br /> Precondition: the current event is START_ELEMENT.
7f561c08de6b Initial load
duke
parents:
diff changeset
   222
   * <br /> Postcondition: the current event is the corresponding END_ELEMENT.
7f561c08de6b Initial load
duke
parents:
diff changeset
   223
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   224
   * <br />The method does the following (implementations are free to optimized
7f561c08de6b Initial load
duke
parents:
diff changeset
   225
   * but must do equivalent processing):
7f561c08de6b Initial load
duke
parents:
diff changeset
   226
   * <pre>
7f561c08de6b Initial load
duke
parents:
diff changeset
   227
   * if(getEventType() != XMLStreamConstants.START_ELEMENT) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   228
   * throw new XMLStreamException(
7f561c08de6b Initial load
duke
parents:
diff changeset
   229
   * "parser must be on START_ELEMENT to read next text", getLocation());
7f561c08de6b Initial load
duke
parents:
diff changeset
   230
   * }
7f561c08de6b Initial load
duke
parents:
diff changeset
   231
   * int eventType = next();
7f561c08de6b Initial load
duke
parents:
diff changeset
   232
   * StringBuffer content = new StringBuffer();
7f561c08de6b Initial load
duke
parents:
diff changeset
   233
   * while(eventType != XMLStreamConstants.END_ELEMENT ) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   234
   * if(eventType == XMLStreamConstants.CHARACTERS
7f561c08de6b Initial load
duke
parents:
diff changeset
   235
   * || eventType == XMLStreamConstants.CDATA
7f561c08de6b Initial load
duke
parents:
diff changeset
   236
   * || eventType == XMLStreamConstants.SPACE
7f561c08de6b Initial load
duke
parents:
diff changeset
   237
   * || eventType == XMLStreamConstants.ENTITY_REFERENCE) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   238
   * buf.append(getText());
7f561c08de6b Initial load
duke
parents:
diff changeset
   239
   * } else if(eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
7f561c08de6b Initial load
duke
parents:
diff changeset
   240
   * || eventType == XMLStreamConstants.COMMENT) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   241
   * // skipping
7f561c08de6b Initial load
duke
parents:
diff changeset
   242
   * } else if(eventType == XMLStreamConstants.END_DOCUMENT) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   243
   * throw new XMLStreamException(
7f561c08de6b Initial load
duke
parents:
diff changeset
   244
   * "unexpected end of document when reading element text content", this);
7f561c08de6b Initial load
duke
parents:
diff changeset
   245
   * } else if(eventType == XMLStreamConstants.START_ELEMENT) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   246
   * throw new XMLStreamException(
7f561c08de6b Initial load
duke
parents:
diff changeset
   247
   * "element text content may not contain START_ELEMENT", getLocation());
7f561c08de6b Initial load
duke
parents:
diff changeset
   248
   * } else {
7f561c08de6b Initial load
duke
parents:
diff changeset
   249
   * throw new XMLStreamException(
7f561c08de6b Initial load
duke
parents:
diff changeset
   250
   * "Unexpected event type "+eventType, getLocation());
7f561c08de6b Initial load
duke
parents:
diff changeset
   251
   * }
7f561c08de6b Initial load
duke
parents:
diff changeset
   252
   * eventType = next();
7f561c08de6b Initial load
duke
parents:
diff changeset
   253
   * }
7f561c08de6b Initial load
duke
parents:
diff changeset
   254
   * return buf.toString();
7f561c08de6b Initial load
duke
parents:
diff changeset
   255
   * </pre>
7f561c08de6b Initial load
duke
parents:
diff changeset
   256
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   257
   * @throws XMLStreamException if the current event is not a START_ELEMENT
7f561c08de6b Initial load
duke
parents:
diff changeset
   258
   * or if a non text element is encountered
7f561c08de6b Initial load
duke
parents:
diff changeset
   259
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   260
  public String getElementText() throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   261
7f561c08de6b Initial load
duke
parents:
diff changeset
   262
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   263
   * Skips any white space (isWhiteSpace() returns true), COMMENT,
7f561c08de6b Initial load
duke
parents:
diff changeset
   264
   * or PROCESSING_INSTRUCTION,
7f561c08de6b Initial load
duke
parents:
diff changeset
   265
   * until a START_ELEMENT or END_ELEMENT is reached.
7f561c08de6b Initial load
duke
parents:
diff changeset
   266
   * If other than white space characters, COMMENT, PROCESSING_INSTRUCTION, START_ELEMENT, END_ELEMENT
7f561c08de6b Initial load
duke
parents:
diff changeset
   267
   * are encountered, an exception is thrown. This method should
7f561c08de6b Initial load
duke
parents:
diff changeset
   268
   * be used when processing element-only content seperated by white space.
7f561c08de6b Initial load
duke
parents:
diff changeset
   269
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   270
   * <br /> Precondition: none
7f561c08de6b Initial load
duke
parents:
diff changeset
   271
   * <br /> Postcondition: the current event is START_ELEMENT or END_ELEMENT
7f561c08de6b Initial load
duke
parents:
diff changeset
   272
   * and cursor may have moved over any whitespace event.
7f561c08de6b Initial load
duke
parents:
diff changeset
   273
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   274
   * <br />Essentially it does the following (implementations are free to optimized
7f561c08de6b Initial load
duke
parents:
diff changeset
   275
   * but must do equivalent processing):
7f561c08de6b Initial load
duke
parents:
diff changeset
   276
   * <pre>
7f561c08de6b Initial load
duke
parents:
diff changeset
   277
   * int eventType = next();
7f561c08de6b Initial load
duke
parents:
diff changeset
   278
   * while((eventType == XMLStreamConstants.CHARACTERS &amp;&amp; isWhiteSpace()) // skip whitespace
7f561c08de6b Initial load
duke
parents:
diff changeset
   279
   * || (eventType == XMLStreamConstants.CDATA &amp;&amp; isWhiteSpace())
7f561c08de6b Initial load
duke
parents:
diff changeset
   280
   * // skip whitespace
7f561c08de6b Initial load
duke
parents:
diff changeset
   281
   * || eventType == XMLStreamConstants.SPACE
7f561c08de6b Initial load
duke
parents:
diff changeset
   282
   * || eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
7f561c08de6b Initial load
duke
parents:
diff changeset
   283
   * || eventType == XMLStreamConstants.COMMENT
7f561c08de6b Initial load
duke
parents:
diff changeset
   284
   * ) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   285
   * eventType = next();
7f561c08de6b Initial load
duke
parents:
diff changeset
   286
   * }
7f561c08de6b Initial load
duke
parents:
diff changeset
   287
   * if (eventType != XMLStreamConstants.START_ELEMENT &amp;&amp; eventType != XMLStreamConstants.END_ELEMENT) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   288
   * throw new String XMLStreamException("expected start or end tag", getLocation());
7f561c08de6b Initial load
duke
parents:
diff changeset
   289
   * }
7f561c08de6b Initial load
duke
parents:
diff changeset
   290
   * return eventType;
7f561c08de6b Initial load
duke
parents:
diff changeset
   291
   * </pre>
7f561c08de6b Initial load
duke
parents:
diff changeset
   292
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   293
   * @return the event type of the element read (START_ELEMENT or END_ELEMENT)
7f561c08de6b Initial load
duke
parents:
diff changeset
   294
   * @throws XMLStreamException if the current event is not white space, PROCESSING_INSTRUCTION,
7f561c08de6b Initial load
duke
parents:
diff changeset
   295
   * START_ELEMENT or END_ELEMENT
7f561c08de6b Initial load
duke
parents:
diff changeset
   296
   * @throws NoSuchElementException if this is called when hasNext() returns false
7f561c08de6b Initial load
duke
parents:
diff changeset
   297
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   298
  public int nextTag() throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   299
7f561c08de6b Initial load
duke
parents:
diff changeset
   300
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   301
   * Returns true if there are more parsing events and false
7f561c08de6b Initial load
duke
parents:
diff changeset
   302
   * if there are no more events.  This method will return
7f561c08de6b Initial load
duke
parents:
diff changeset
   303
   * false if the current state of the XMLStreamReader is
7f561c08de6b Initial load
duke
parents:
diff changeset
   304
   * END_DOCUMENT
7f561c08de6b Initial load
duke
parents:
diff changeset
   305
   * @return true if there are more events, false otherwise
7f561c08de6b Initial load
duke
parents:
diff changeset
   306
   * @throws XMLStreamException if there is a fatal error detecting the next state
7f561c08de6b Initial load
duke
parents:
diff changeset
   307
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   308
  public boolean hasNext() throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   309
7f561c08de6b Initial load
duke
parents:
diff changeset
   310
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   311
   * Frees any resources associated with this Reader.  This method does not close the
7f561c08de6b Initial load
duke
parents:
diff changeset
   312
   * underlying input source.
7f561c08de6b Initial load
duke
parents:
diff changeset
   313
   * @throws XMLStreamException if there are errors freeing associated resources
7f561c08de6b Initial load
duke
parents:
diff changeset
   314
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   315
  public void close() throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   316
7f561c08de6b Initial load
duke
parents:
diff changeset
   317
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   318
   * Return the uri for the given prefix.
7f561c08de6b Initial load
duke
parents:
diff changeset
   319
   * The uri returned depends on the current state of the processor.
7f561c08de6b Initial load
duke
parents:
diff changeset
   320
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   321
   * <p><strong>NOTE:</strong>The 'xml' prefix is bound as defined in
7f561c08de6b Initial load
duke
parents:
diff changeset
   322
   * <a href="http://www.w3.org/TR/REC-xml-names/#ns-using">Namespaces in XML</a>
7f561c08de6b Initial load
duke
parents:
diff changeset
   323
   * specification to "http://www.w3.org/XML/1998/namespace".
7f561c08de6b Initial load
duke
parents:
diff changeset
   324
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   325
   * <p><strong>NOTE:</strong> The 'xmlns' prefix must be resolved to following namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
   326
   * <a href="http://www.w3.org/2000/xmlns/">http://www.w3.org/2000/xmlns/</a>
7f561c08de6b Initial load
duke
parents:
diff changeset
   327
   * @param prefix The prefix to lookup, may not be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   328
   * @return the uri bound to the given prefix or null if it is not bound
7f561c08de6b Initial load
duke
parents:
diff changeset
   329
   * @throws IllegalArgumentException if the prefix is null
7f561c08de6b Initial load
duke
parents:
diff changeset
   330
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   331
  public String getNamespaceURI(String prefix);
7f561c08de6b Initial load
duke
parents:
diff changeset
   332
7f561c08de6b Initial load
duke
parents:
diff changeset
   333
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   334
   * Returns true if the cursor points to a start tag (otherwise false)
7f561c08de6b Initial load
duke
parents:
diff changeset
   335
   * @return true if the cursor points to a start tag, false otherwise
7f561c08de6b Initial load
duke
parents:
diff changeset
   336
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   337
  public boolean isStartElement();
7f561c08de6b Initial load
duke
parents:
diff changeset
   338
7f561c08de6b Initial load
duke
parents:
diff changeset
   339
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   340
   * Returns true if the cursor points to an end tag (otherwise false)
7f561c08de6b Initial load
duke
parents:
diff changeset
   341
   * @return true if the cursor points to an end tag, false otherwise
7f561c08de6b Initial load
duke
parents:
diff changeset
   342
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   343
  public boolean isEndElement();
7f561c08de6b Initial load
duke
parents:
diff changeset
   344
7f561c08de6b Initial load
duke
parents:
diff changeset
   345
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   346
   * Returns true if the cursor points to a character data event
7f561c08de6b Initial load
duke
parents:
diff changeset
   347
   * @return true if the cursor points to character data, false otherwise
7f561c08de6b Initial load
duke
parents:
diff changeset
   348
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   349
  public boolean isCharacters();
7f561c08de6b Initial load
duke
parents:
diff changeset
   350
7f561c08de6b Initial load
duke
parents:
diff changeset
   351
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   352
   * Returns true if the cursor points to a character data event
7f561c08de6b Initial load
duke
parents:
diff changeset
   353
   * that consists of all whitespace
7f561c08de6b Initial load
duke
parents:
diff changeset
   354
   * @return true if the cursor points to all whitespace, false otherwise
7f561c08de6b Initial load
duke
parents:
diff changeset
   355
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   356
  public boolean isWhiteSpace();
7f561c08de6b Initial load
duke
parents:
diff changeset
   357
7f561c08de6b Initial load
duke
parents:
diff changeset
   358
7f561c08de6b Initial load
duke
parents:
diff changeset
   359
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   360
   * Returns the normalized attribute value of the
7f561c08de6b Initial load
duke
parents:
diff changeset
   361
   * attribute with the namespace and localName
7f561c08de6b Initial load
duke
parents:
diff changeset
   362
   * If the namespaceURI is null the namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
   363
   * is not checked for equality
7f561c08de6b Initial load
duke
parents:
diff changeset
   364
   * @param namespaceURI the namespace of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   365
   * @param localName the local name of the attribute, cannot be null
7f561c08de6b Initial load
duke
parents:
diff changeset
   366
   * @return returns the value of the attribute , returns null if not found
7f561c08de6b Initial load
duke
parents:
diff changeset
   367
   * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
7f561c08de6b Initial load
duke
parents:
diff changeset
   368
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   369
  public String getAttributeValue(String namespaceURI,
7f561c08de6b Initial load
duke
parents:
diff changeset
   370
                                  String localName);
7f561c08de6b Initial load
duke
parents:
diff changeset
   371
7f561c08de6b Initial load
duke
parents:
diff changeset
   372
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   373
   * Returns the count of attributes on this START_ELEMENT,
7f561c08de6b Initial load
duke
parents:
diff changeset
   374
   * this method is only valid on a START_ELEMENT or ATTRIBUTE.  This
7f561c08de6b Initial load
duke
parents:
diff changeset
   375
   * count excludes namespace definitions.  Attribute indices are
7f561c08de6b Initial load
duke
parents:
diff changeset
   376
   * zero-based.
7f561c08de6b Initial load
duke
parents:
diff changeset
   377
   * @return returns the number of attributes
7f561c08de6b Initial load
duke
parents:
diff changeset
   378
   * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
7f561c08de6b Initial load
duke
parents:
diff changeset
   379
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   380
  public int getAttributeCount();
7f561c08de6b Initial load
duke
parents:
diff changeset
   381
7f561c08de6b Initial load
duke
parents:
diff changeset
   382
  /** Returns the qname of the attribute at the provided index
7f561c08de6b Initial load
duke
parents:
diff changeset
   383
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   384
   * @param index the position of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   385
   * @return the QName of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   386
   * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
7f561c08de6b Initial load
duke
parents:
diff changeset
   387
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   388
  public QName getAttributeName(int index);
7f561c08de6b Initial load
duke
parents:
diff changeset
   389
7f561c08de6b Initial load
duke
parents:
diff changeset
   390
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   391
   * Returns the namespace of the attribute at the provided
7f561c08de6b Initial load
duke
parents:
diff changeset
   392
   * index
7f561c08de6b Initial load
duke
parents:
diff changeset
   393
   * @param index the position of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   394
   * @return the namespace URI (can be null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   395
   * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
7f561c08de6b Initial load
duke
parents:
diff changeset
   396
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   397
  public String getAttributeNamespace(int index);
7f561c08de6b Initial load
duke
parents:
diff changeset
   398
7f561c08de6b Initial load
duke
parents:
diff changeset
   399
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   400
   * Returns the localName of the attribute at the provided
7f561c08de6b Initial load
duke
parents:
diff changeset
   401
   * index
7f561c08de6b Initial load
duke
parents:
diff changeset
   402
   * @param index the position of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   403
   * @return the localName of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   404
   * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
7f561c08de6b Initial load
duke
parents:
diff changeset
   405
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   406
  public String getAttributeLocalName(int index);
7f561c08de6b Initial load
duke
parents:
diff changeset
   407
7f561c08de6b Initial load
duke
parents:
diff changeset
   408
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   409
   * Returns the prefix of this attribute at the
7f561c08de6b Initial load
duke
parents:
diff changeset
   410
   * provided index
7f561c08de6b Initial load
duke
parents:
diff changeset
   411
   * @param index the position of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   412
   * @return the prefix of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   413
   * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
7f561c08de6b Initial load
duke
parents:
diff changeset
   414
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   415
  public String getAttributePrefix(int index);
7f561c08de6b Initial load
duke
parents:
diff changeset
   416
7f561c08de6b Initial load
duke
parents:
diff changeset
   417
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   418
   * Returns the XML type of the attribute at the provided
7f561c08de6b Initial load
duke
parents:
diff changeset
   419
   * index
7f561c08de6b Initial load
duke
parents:
diff changeset
   420
   * @param index the position of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   421
   * @return the XML type of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   422
   * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
7f561c08de6b Initial load
duke
parents:
diff changeset
   423
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   424
  public String getAttributeType(int index);
7f561c08de6b Initial load
duke
parents:
diff changeset
   425
7f561c08de6b Initial load
duke
parents:
diff changeset
   426
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   427
   * Returns the value of the attribute at the
7f561c08de6b Initial load
duke
parents:
diff changeset
   428
   * index
7f561c08de6b Initial load
duke
parents:
diff changeset
   429
   * @param index the position of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   430
   * @return the attribute value
7f561c08de6b Initial load
duke
parents:
diff changeset
   431
   * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
7f561c08de6b Initial load
duke
parents:
diff changeset
   432
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   433
  public String getAttributeValue(int index);
7f561c08de6b Initial load
duke
parents:
diff changeset
   434
7f561c08de6b Initial load
duke
parents:
diff changeset
   435
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   436
   * Returns a boolean which indicates if this
7f561c08de6b Initial load
duke
parents:
diff changeset
   437
   * attribute was created by default
7f561c08de6b Initial load
duke
parents:
diff changeset
   438
   * @param index the position of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   439
   * @return true if this is a default attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   440
   * @throws IllegalStateException if this is not a START_ELEMENT or ATTRIBUTE
7f561c08de6b Initial load
duke
parents:
diff changeset
   441
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   442
  public boolean isAttributeSpecified(int index);
7f561c08de6b Initial load
duke
parents:
diff changeset
   443
7f561c08de6b Initial load
duke
parents:
diff changeset
   444
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   445
   * Returns the count of namespaces declared on this START_ELEMENT or END_ELEMENT,
7f561c08de6b Initial load
duke
parents:
diff changeset
   446
   * this method is only valid on a START_ELEMENT, END_ELEMENT or NAMESPACE. On
7f561c08de6b Initial load
duke
parents:
diff changeset
   447
   * an END_ELEMENT the count is of the namespaces that are about to go
7f561c08de6b Initial load
duke
parents:
diff changeset
   448
   * out of scope.  This is the equivalent of the information reported
7f561c08de6b Initial load
duke
parents:
diff changeset
   449
   * by SAX callback for an end element event.
7f561c08de6b Initial load
duke
parents:
diff changeset
   450
   * @return returns the number of namespace declarations on this specific element
7f561c08de6b Initial load
duke
parents:
diff changeset
   451
   * @throws IllegalStateException if this is not a START_ELEMENT, END_ELEMENT or NAMESPACE
7f561c08de6b Initial load
duke
parents:
diff changeset
   452
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   453
  public int getNamespaceCount();
7f561c08de6b Initial load
duke
parents:
diff changeset
   454
7f561c08de6b Initial load
duke
parents:
diff changeset
   455
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   456
   * Returns the prefix for the namespace declared at the
7f561c08de6b Initial load
duke
parents:
diff changeset
   457
   * index.  Returns null if this is the default namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
   458
   * declaration
7f561c08de6b Initial load
duke
parents:
diff changeset
   459
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   460
   * @param index the position of the namespace declaration
7f561c08de6b Initial load
duke
parents:
diff changeset
   461
   * @return returns the namespace prefix
7f561c08de6b Initial load
duke
parents:
diff changeset
   462
   * @throws IllegalStateException if this is not a START_ELEMENT, END_ELEMENT or NAMESPACE
7f561c08de6b Initial load
duke
parents:
diff changeset
   463
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   464
  public String getNamespacePrefix(int index);
7f561c08de6b Initial load
duke
parents:
diff changeset
   465
7f561c08de6b Initial load
duke
parents:
diff changeset
   466
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   467
   * Returns the uri for the namespace declared at the
7f561c08de6b Initial load
duke
parents:
diff changeset
   468
   * index.
7f561c08de6b Initial load
duke
parents:
diff changeset
   469
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   470
   * @param index the position of the namespace declaration
7f561c08de6b Initial load
duke
parents:
diff changeset
   471
   * @return returns the namespace uri
7f561c08de6b Initial load
duke
parents:
diff changeset
   472
   * @throws IllegalStateException if this is not a START_ELEMENT, END_ELEMENT or NAMESPACE
7f561c08de6b Initial load
duke
parents:
diff changeset
   473
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   474
  public String getNamespaceURI(int index);
7f561c08de6b Initial load
duke
parents:
diff changeset
   475
7f561c08de6b Initial load
duke
parents:
diff changeset
   476
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   477
   * Returns a read only namespace context for the current
7f561c08de6b Initial load
duke
parents:
diff changeset
   478
   * position.  The context is transient and only valid until
7f561c08de6b Initial load
duke
parents:
diff changeset
   479
   * a call to next() changes the state of the reader.
7f561c08de6b Initial load
duke
parents:
diff changeset
   480
   * @return return a namespace context
7f561c08de6b Initial load
duke
parents:
diff changeset
   481
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   482
  public NamespaceContext getNamespaceContext();
7f561c08de6b Initial load
duke
parents:
diff changeset
   483
7f561c08de6b Initial load
duke
parents:
diff changeset
   484
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   485
   * Returns a reader that points to the current start element
7f561c08de6b Initial load
duke
parents:
diff changeset
   486
   * and all of its contents.  Throws an XMLStreamException if the
7f561c08de6b Initial load
duke
parents:
diff changeset
   487
   * cursor does not point to a START_ELEMENT.<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   488
   * The sub stream is read from it MUST be read before the parent stream is
7f561c08de6b Initial load
duke
parents:
diff changeset
   489
   * moved on, if not any call on the sub stream will cause an XMLStreamException to be
7f561c08de6b Initial load
duke
parents:
diff changeset
   490
   * thrown.   The parent stream will always return the same result from next()
7f561c08de6b Initial load
duke
parents:
diff changeset
   491
   * whatever is done to the sub stream.
7f561c08de6b Initial load
duke
parents:
diff changeset
   492
   * @return an XMLStreamReader which points to the next element
7f561c08de6b Initial load
duke
parents:
diff changeset
   493
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   494
  //  public XMLStreamReader subReader() throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   495
7f561c08de6b Initial load
duke
parents:
diff changeset
   496
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   497
   * Allows the implementation to reset and reuse any underlying tables
7f561c08de6b Initial load
duke
parents:
diff changeset
   498
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   499
  //  public void recycle() throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   500
7f561c08de6b Initial load
duke
parents:
diff changeset
   501
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   502
   * Returns an integer code that indicates the type
7f561c08de6b Initial load
duke
parents:
diff changeset
   503
   * of the event the cursor is pointing to.
7f561c08de6b Initial load
duke
parents:
diff changeset
   504
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   505
  public int getEventType();
7f561c08de6b Initial load
duke
parents:
diff changeset
   506
7f561c08de6b Initial load
duke
parents:
diff changeset
   507
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   508
   * Returns the current value of the parse event as a string,
7f561c08de6b Initial load
duke
parents:
diff changeset
   509
   * this returns the string value of a CHARACTERS event,
7f561c08de6b Initial load
duke
parents:
diff changeset
   510
   * returns the value of a COMMENT, the replacement value
7f561c08de6b Initial load
duke
parents:
diff changeset
   511
   * for an ENTITY_REFERENCE, the string value of a CDATA section,
7f561c08de6b Initial load
duke
parents:
diff changeset
   512
   * the string value for a SPACE event,
7f561c08de6b Initial load
duke
parents:
diff changeset
   513
   * or the String value of the internal subset of the DTD.
7f561c08de6b Initial load
duke
parents:
diff changeset
   514
   * If an ENTITY_REFERENCE has been resolved, any character data
7f561c08de6b Initial load
duke
parents:
diff changeset
   515
   * will be reported as CHARACTERS events.
7f561c08de6b Initial load
duke
parents:
diff changeset
   516
   * @return the current text or null
7f561c08de6b Initial load
duke
parents:
diff changeset
   517
   * @throws java.lang.IllegalStateException if this state is not
7f561c08de6b Initial load
duke
parents:
diff changeset
   518
   * a valid text state.
7f561c08de6b Initial load
duke
parents:
diff changeset
   519
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   520
  public String getText();
7f561c08de6b Initial load
duke
parents:
diff changeset
   521
7f561c08de6b Initial load
duke
parents:
diff changeset
   522
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   523
   * Returns an array which contains the characters from this event.
7f561c08de6b Initial load
duke
parents:
diff changeset
   524
   * This array should be treated as read-only and transient. I.e. the array will
7f561c08de6b Initial load
duke
parents:
diff changeset
   525
   * contain the text characters until the XMLStreamReader moves on to the next event.
7f561c08de6b Initial load
duke
parents:
diff changeset
   526
   * Attempts to hold onto the character array beyond that time or modify the
7f561c08de6b Initial load
duke
parents:
diff changeset
   527
   * contents of the array are breaches of the contract for this interface.
7f561c08de6b Initial load
duke
parents:
diff changeset
   528
   * @return the current text or an empty array
7f561c08de6b Initial load
duke
parents:
diff changeset
   529
   * @throws java.lang.IllegalStateException if this state is not
7f561c08de6b Initial load
duke
parents:
diff changeset
   530
   * a valid text state.
7f561c08de6b Initial load
duke
parents:
diff changeset
   531
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   532
  public char[] getTextCharacters();
7f561c08de6b Initial load
duke
parents:
diff changeset
   533
7f561c08de6b Initial load
duke
parents:
diff changeset
   534
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   535
   * Gets the the text associated with a CHARACTERS, SPACE or CDATA event.
7f561c08de6b Initial load
duke
parents:
diff changeset
   536
   * Text starting a "sourceStart" is copied into "target" starting at "targetStart".
7f561c08de6b Initial load
duke
parents:
diff changeset
   537
   * Up to "length" characters are copied.  The number of characters actually copied is returned.
7f561c08de6b Initial load
duke
parents:
diff changeset
   538
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   539
   * The "sourceStart" argument must be greater or equal to 0 and less than or equal to
7f561c08de6b Initial load
duke
parents:
diff changeset
   540
   * the number of characters associated with the event.  Usually, one requests text starting at a "sourceStart" of 0.
7f561c08de6b Initial load
duke
parents:
diff changeset
   541
   * If the number of characters actually copied is less than the "length", then there is no more text.
7f561c08de6b Initial load
duke
parents:
diff changeset
   542
   * Otherwise, subsequent calls need to be made until all text has been retrieved. For example:
7f561c08de6b Initial load
duke
parents:
diff changeset
   543
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   544
   *<code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   545
   * int length = 1024;
7f561c08de6b Initial load
duke
parents:
diff changeset
   546
   * char[] myBuffer = new char[ length ];
7f561c08de6b Initial load
duke
parents:
diff changeset
   547
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   548
   * for ( int sourceStart = 0 ; ; sourceStart += length )
7f561c08de6b Initial load
duke
parents:
diff changeset
   549
   * {
7f561c08de6b Initial load
duke
parents:
diff changeset
   550
   *    int nCopied = stream.getTextCharacters( sourceStart, myBuffer, 0, length );
7f561c08de6b Initial load
duke
parents:
diff changeset
   551
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   552
   *   if (nCopied < length)
7f561c08de6b Initial load
duke
parents:
diff changeset
   553
   *       break;
7f561c08de6b Initial load
duke
parents:
diff changeset
   554
   * }
7f561c08de6b Initial load
duke
parents:
diff changeset
   555
   * </code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   556
   * XMLStreamException may be thrown if there are any XML errors in the underlying source.
7f561c08de6b Initial load
duke
parents:
diff changeset
   557
   * The "targetStart" argument must be greater than or equal to 0 and less than the length of "target",
7f561c08de6b Initial load
duke
parents:
diff changeset
   558
   * Length must be greater than 0 and "targetStart + length" must be less than or equal to length of "target".
7f561c08de6b Initial load
duke
parents:
diff changeset
   559
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   560
   * @param sourceStart the index of the first character in the source array to copy
7f561c08de6b Initial load
duke
parents:
diff changeset
   561
   * @param target the destination array
7f561c08de6b Initial load
duke
parents:
diff changeset
   562
   * @param targetStart the start offset in the target array
7f561c08de6b Initial load
duke
parents:
diff changeset
   563
   * @param length the number of characters to copy
7f561c08de6b Initial load
duke
parents:
diff changeset
   564
   * @return the number of characters actually copied
7f561c08de6b Initial load
duke
parents:
diff changeset
   565
   * @throws XMLStreamException if the underlying XML source is not well-formed
7f561c08de6b Initial load
duke
parents:
diff changeset
   566
   * @throws IndexOutOfBoundsException if targetStart < 0 or > than the length of target
7f561c08de6b Initial load
duke
parents:
diff changeset
   567
   * @throws IndexOutOfBoundsException if length < 0 or targetStart + length > length of target
7f561c08de6b Initial load
duke
parents:
diff changeset
   568
   * @throws UnsupportedOperationException if this method is not supported
7f561c08de6b Initial load
duke
parents:
diff changeset
   569
   * @throws NullPointerException is if target is null
7f561c08de6b Initial load
duke
parents:
diff changeset
   570
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   571
   public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length)
7f561c08de6b Initial load
duke
parents:
diff changeset
   572
     throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   573
7f561c08de6b Initial load
duke
parents:
diff changeset
   574
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   575
   * Gets the text associated with a CHARACTERS, SPACE or CDATA event.  Allows the underlying
7f561c08de6b Initial load
duke
parents:
diff changeset
   576
   * implementation to return the text as a stream of characters.  The reference to the
7f561c08de6b Initial load
duke
parents:
diff changeset
   577
   * Reader returned by this method is only valid until next() is called.
7f561c08de6b Initial load
duke
parents:
diff changeset
   578
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   579
   * All characters must have been checked for well-formedness.
7f561c08de6b Initial load
duke
parents:
diff changeset
   580
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   581
   * <p> This method is optional and will throw UnsupportedOperationException if it is not supported.
7f561c08de6b Initial load
duke
parents:
diff changeset
   582
   * @throws UnsupportedOperationException if this method is not supported
7f561c08de6b Initial load
duke
parents:
diff changeset
   583
   * @throws IllegalStateException if this is not a valid text state
7f561c08de6b Initial load
duke
parents:
diff changeset
   584
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   585
  //public Reader getTextStream();
7f561c08de6b Initial load
duke
parents:
diff changeset
   586
7f561c08de6b Initial load
duke
parents:
diff changeset
   587
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   588
   * Returns the offset into the text character array where the first
7f561c08de6b Initial load
duke
parents:
diff changeset
   589
   * character (of this text event) is stored.
7f561c08de6b Initial load
duke
parents:
diff changeset
   590
   * @throws java.lang.IllegalStateException if this state is not
7f561c08de6b Initial load
duke
parents:
diff changeset
   591
   * a valid text state.
7f561c08de6b Initial load
duke
parents:
diff changeset
   592
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   593
  public int getTextStart();
7f561c08de6b Initial load
duke
parents:
diff changeset
   594
7f561c08de6b Initial load
duke
parents:
diff changeset
   595
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   596
   * Returns the length of the sequence of characters for this
7f561c08de6b Initial load
duke
parents:
diff changeset
   597
   * Text event within the text character array.
7f561c08de6b Initial load
duke
parents:
diff changeset
   598
   * @throws java.lang.IllegalStateException if this state is not
7f561c08de6b Initial load
duke
parents:
diff changeset
   599
   * a valid text state.
7f561c08de6b Initial load
duke
parents:
diff changeset
   600
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   601
  public int getTextLength();
7f561c08de6b Initial load
duke
parents:
diff changeset
   602
7f561c08de6b Initial load
duke
parents:
diff changeset
   603
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   604
   * Return input encoding if known or null if unknown.
7f561c08de6b Initial load
duke
parents:
diff changeset
   605
   * @return the encoding of this instance or null
7f561c08de6b Initial load
duke
parents:
diff changeset
   606
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   607
  public String getEncoding();
7f561c08de6b Initial load
duke
parents:
diff changeset
   608
7f561c08de6b Initial load
duke
parents:
diff changeset
   609
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   610
   * Return true if the current event has text, false otherwise
7f561c08de6b Initial load
duke
parents:
diff changeset
   611
   * The following events have text:
7f561c08de6b Initial load
duke
parents:
diff changeset
   612
   * CHARACTERS,DTD ,ENTITY_REFERENCE, COMMENT, SPACE
7f561c08de6b Initial load
duke
parents:
diff changeset
   613
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   614
  public boolean hasText();
7f561c08de6b Initial load
duke
parents:
diff changeset
   615
7f561c08de6b Initial load
duke
parents:
diff changeset
   616
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   617
   * Return the current location of the processor.
7f561c08de6b Initial load
duke
parents:
diff changeset
   618
   * If the Location is unknown the processor should return
7f561c08de6b Initial load
duke
parents:
diff changeset
   619
   * an implementation of Location that returns -1 for the
7f561c08de6b Initial load
duke
parents:
diff changeset
   620
   * location and null for the publicId and systemId.
7f561c08de6b Initial load
duke
parents:
diff changeset
   621
   * The location information is only valid until next() is
7f561c08de6b Initial load
duke
parents:
diff changeset
   622
   * called.
7f561c08de6b Initial load
duke
parents:
diff changeset
   623
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   624
  public Location getLocation();
7f561c08de6b Initial load
duke
parents:
diff changeset
   625
7f561c08de6b Initial load
duke
parents:
diff changeset
   626
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   627
   * Returns a QName for the current START_ELEMENT or END_ELEMENT event
7f561c08de6b Initial load
duke
parents:
diff changeset
   628
   * @return the QName for the current START_ELEMENT or END_ELEMENT event
7f561c08de6b Initial load
duke
parents:
diff changeset
   629
   * @throws IllegalStateException if this is not a START_ELEMENT or
7f561c08de6b Initial load
duke
parents:
diff changeset
   630
   * END_ELEMENT
7f561c08de6b Initial load
duke
parents:
diff changeset
   631
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   632
  public QName getName();
7f561c08de6b Initial load
duke
parents:
diff changeset
   633
7f561c08de6b Initial load
duke
parents:
diff changeset
   634
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   635
   * Returns the (local) name of the current event.
7f561c08de6b Initial load
duke
parents:
diff changeset
   636
   * For START_ELEMENT or END_ELEMENT returns the (local) name of the current element.
7f561c08de6b Initial load
duke
parents:
diff changeset
   637
   * For ENTITY_REFERENCE it returns entity name.
7f561c08de6b Initial load
duke
parents:
diff changeset
   638
   * The current event must be START_ELEMENT or END_ELEMENT,
7f561c08de6b Initial load
duke
parents:
diff changeset
   639
   * or ENTITY_REFERENCE
7f561c08de6b Initial load
duke
parents:
diff changeset
   640
   * @return the localName
7f561c08de6b Initial load
duke
parents:
diff changeset
   641
   * @throws IllegalStateException if this not a START_ELEMENT,
7f561c08de6b Initial load
duke
parents:
diff changeset
   642
   * END_ELEMENT or ENTITY_REFERENCE
7f561c08de6b Initial load
duke
parents:
diff changeset
   643
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   644
  public String getLocalName();
7f561c08de6b Initial load
duke
parents:
diff changeset
   645
7f561c08de6b Initial load
duke
parents:
diff changeset
   646
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   647
   * returns true if the current event has a name (is a START_ELEMENT or END_ELEMENT)
7f561c08de6b Initial load
duke
parents:
diff changeset
   648
   * returns false otherwise
7f561c08de6b Initial load
duke
parents:
diff changeset
   649
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   650
  public boolean hasName();
7f561c08de6b Initial load
duke
parents:
diff changeset
   651
7f561c08de6b Initial load
duke
parents:
diff changeset
   652
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   653
   * If the current event is a START_ELEMENT or END_ELEMENT  this method
7f561c08de6b Initial load
duke
parents:
diff changeset
   654
   * returns the URI of the prefix or the default namespace.
7f561c08de6b Initial load
duke
parents:
diff changeset
   655
   * Returns null if the event does not have a prefix.
7f561c08de6b Initial load
duke
parents:
diff changeset
   656
   * @return the URI bound to this elements prefix, the default namespace, or null
7f561c08de6b Initial load
duke
parents:
diff changeset
   657
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   658
  public String getNamespaceURI();
7f561c08de6b Initial load
duke
parents:
diff changeset
   659
7f561c08de6b Initial load
duke
parents:
diff changeset
   660
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   661
   * Returns the prefix of the current event or null if the event does not have a prefix
7f561c08de6b Initial load
duke
parents:
diff changeset
   662
   * @return the prefix or null
7f561c08de6b Initial load
duke
parents:
diff changeset
   663
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   664
  public String getPrefix();
7f561c08de6b Initial load
duke
parents:
diff changeset
   665
7f561c08de6b Initial load
duke
parents:
diff changeset
   666
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   667
   * Get the xml version declared on the xml declaration
7f561c08de6b Initial load
duke
parents:
diff changeset
   668
   * Returns null if none was declared
7f561c08de6b Initial load
duke
parents:
diff changeset
   669
   * @return the XML version or null
7f561c08de6b Initial load
duke
parents:
diff changeset
   670
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   671
  public String getVersion();
7f561c08de6b Initial load
duke
parents:
diff changeset
   672
7f561c08de6b Initial load
duke
parents:
diff changeset
   673
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   674
   * Get the standalone declaration from the xml declaration
7f561c08de6b Initial load
duke
parents:
diff changeset
   675
   * @return true if this is standalone, or false otherwise
7f561c08de6b Initial load
duke
parents:
diff changeset
   676
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   677
  public boolean isStandalone();
7f561c08de6b Initial load
duke
parents:
diff changeset
   678
7f561c08de6b Initial load
duke
parents:
diff changeset
   679
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   680
   * Checks if standalone was set in the document
7f561c08de6b Initial load
duke
parents:
diff changeset
   681
   * @return true if standalone was set in the document, or false otherwise
7f561c08de6b Initial load
duke
parents:
diff changeset
   682
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   683
  public boolean standaloneSet();
7f561c08de6b Initial load
duke
parents:
diff changeset
   684
7f561c08de6b Initial load
duke
parents:
diff changeset
   685
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   686
   * Returns the character encoding declared on the xml declaration
7f561c08de6b Initial load
duke
parents:
diff changeset
   687
   * Returns null if none was declared
7f561c08de6b Initial load
duke
parents:
diff changeset
   688
   * @return the encoding declared in the document or null
7f561c08de6b Initial load
duke
parents:
diff changeset
   689
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   690
  public String getCharacterEncodingScheme();
7f561c08de6b Initial load
duke
parents:
diff changeset
   691
7f561c08de6b Initial load
duke
parents:
diff changeset
   692
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   693
   * Get the target of a processing instruction
7f561c08de6b Initial load
duke
parents:
diff changeset
   694
   * @return the target or null
7f561c08de6b Initial load
duke
parents:
diff changeset
   695
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   696
  public String getPITarget();
7f561c08de6b Initial load
duke
parents:
diff changeset
   697
7f561c08de6b Initial load
duke
parents:
diff changeset
   698
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   699
   * Get the data section of a processing instruction
7f561c08de6b Initial load
duke
parents:
diff changeset
   700
   * @return the data or null
7f561c08de6b Initial load
duke
parents:
diff changeset
   701
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   702
  public String getPIData();
7f561c08de6b Initial load
duke
parents:
diff changeset
   703
}