jaxp/src/share/classes/org/w3c/dom/ls/LSParser.java
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 6 7f561c08de6b
permissions -rw-r--r--
Initial load
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
 * This file is available under and governed by the GNU General Public
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
 * License version 2 only, as published by the Free Software Foundation.
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
 * However, the following notice accompanied the original version of this
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
 * file and, per its terms, should not be removed:
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
 * Copyright (c) 2004 World Wide Web Consortium,
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
 * (Massachusetts Institute of Technology, European Research Consortium for
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
 * Informatics and Mathematics, Keio University). All Rights Reserved. This
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
 * work is distributed under the W3C(r) Software License [1] in the hope that
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
 * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
package org.w3c.dom.ls;
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
import org.w3c.dom.Document;
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
import org.w3c.dom.DOMConfiguration;
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
import org.w3c.dom.Node;
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
import org.w3c.dom.DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
 *  An interface to an object that is able to build, or augment, a DOM tree
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
 * from various input sources.
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
 * <p> <code>LSParser</code> provides an API for parsing XML and building the
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
 * corresponding DOM document structure. A <code>LSParser</code> instance
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
 * can be obtained by invoking the
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
 * <code>DOMImplementationLS.createLSParser()</code> method.
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
 * <p> As specified in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
 * , when a document is first made available via the LSParser:
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
 * <ul>
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
 * <li> there will
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
 * never be two adjacent nodes of type NODE_TEXT, and there will never be
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
 * empty text nodes.
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
 * </li>
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
 * <li> it is expected that the <code>value</code> and
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
 * <code>nodeValue</code> attributes of an <code>Attr</code> node initially
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
 * return the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#AVNormalize'>XML 1.0
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
 * normalized value</a>. However, if the parameters "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-validate-if-schema'>
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
 * validate-if-schema</a>" and "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-datatype-normalization'>
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
 * datatype-normalization</a>" are set to <code>true</code>, depending on the attribute normalization
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
 * used, the attribute values may differ from the ones obtained by the XML
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
 * 1.0 attribute normalization. If the parameters "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-datatype-normalization'>
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
 * datatype-normalization</a>" is set to <code>false</code>, the XML 1.0 attribute normalization is
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
 * guaranteed to occur, and if the attributes list does not contain
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
 * namespace declarations, the <code>attributes</code> attribute on
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
 * <code>Element</code> node represents the property <b>[attributes]</b> defined in [<a href='http://www.w3.org/TR/2004/REC-xml-infoset-20040204/'>XML Information Set</a>]
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
 * .
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
 * </li>
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
 * </ul>
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
 * <p> Asynchronous <code>LSParser</code> objects are expected to also
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
 * implement the <code>events::EventTarget</code> interface so that event
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
 * listeners can be registered on asynchronous <code>LSParser</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
 * objects.
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
 * <p> Events supported by asynchronous <code>LSParser</code> objects are:
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
 * <dl>
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
 * <dt>load</dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
 * <dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
 *  The <code>LSParser</code> finishes to load the document. See also the
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
 * definition of the <code>LSLoadEvent</code> interface. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
 * <dt>progress</dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
 * <dd> The
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
 * <code>LSParser</code> signals progress as data is parsed.  This
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
 * specification does not attempt to define exactly when progress events
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
 * should be dispatched. That is intentionally left as
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
 * implementation-dependent. Here is one example of how an application might
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
 * dispatch progress events: Once the parser starts receiving data, a
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
 * progress event is dispatched to indicate that the parsing starts. From
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
 * there on, a progress event is dispatched for every 4096 bytes of data
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
 * that is received and processed. This is only one example, though, and
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
 * implementations can choose to dispatch progress events at any time while
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
 * parsing, or not dispatch them at all.  See also the definition of the
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
 * <code>LSProgressEvent</code> interface. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
 * </dl>
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
 * <p ><b>Note:</b>  All events defined in this specification use the
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
 * namespace URI <code>"http://www.w3.org/2002/DOMLS"</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
 * <p> While parsing an input source, errors are reported to the application
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
 * through the error handler (<code>LSParser.domConfig</code>'s "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
 * error-handler</a>" parameter). This specification does in no way try to define all possible
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
 * errors that can occur while parsing XML, or any other markup, but some
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
 * common error cases are defined. The types (<code>DOMError.type</code>) of
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
 * errors and warnings defined by this specification are:
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
 * <dl>
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
 * <dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
 * <code>"check-character-normalization-failure" [error]</code> </dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
 * <dd> Raised if
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
 * the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-check-character-normalization'>
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
 * check-character-normalization</a>" is set to true and a string is encountered that fails normalization
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
 * checking. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
 * <dt><code>"doctype-not-allowed" [fatal]</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
 * <dd> Raised if the
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
 * configuration parameter "disallow-doctype" is set to <code>true</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
 * and a doctype is encountered. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
 * <dt><code>"no-input-specified" [fatal]</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
 * <dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
 * Raised when loading a document and no input is specified in the
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
 * <code>LSInput</code> object. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
 * <dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
 * <code>"pi-base-uri-not-preserved" [warning]</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
 * <dd> Raised if a processing
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
 * instruction is encountered in a location where the base URI of the
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
 * processing instruction can not be preserved.  One example of a case where
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
 * this warning will be raised is if the configuration parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-entities'>
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
 * entities</a>" is set to <code>false</code> and the following XML file is parsed:
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
 * <pre>
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
 * &lt;!DOCTYPE root [ &lt;!ENTITY e SYSTEM 'subdir/myentity.ent' ]&gt;
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
 * &lt;root&gt; &amp;e; &lt;/root&gt;</pre>
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
 *  And <code>subdir/myentity.ent</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
 * contains:
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
 * <pre>&lt;one&gt; &lt;two/&gt; &lt;/one&gt; &lt;?pi 3.14159?&gt;
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
 * &lt;more/&gt;</pre>
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
 * </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
 * <dt><code>"unbound-prefix-in-entity" [warning]</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
 * <dd> An
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
 * implementation dependent warning that may be raised if the configuration
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
 * parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-namespaces'>
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
 * namespaces</a>" is set to <code>true</code> and an unbound namespace prefix is
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
 * encountered in an entity's replacement text. Raising this warning is not
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
 * enforced since some existing parsers may not recognize unbound namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
 * prefixes in the replacement text of entities. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
 * <dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
 * <code>"unknown-character-denormalization" [fatal]</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
 * <dd> Raised if the
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
 * configuration parameter "ignore-unknown-character-denormalizations" is
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
 * set to <code>false</code> and a character is encountered for which the
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
 * processor cannot determine the normalization properties. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
 * <dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
 * <code>"unsupported-encoding" [fatal]</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
 * <dd> Raised if an unsupported
7f561c08de6b Initial load
duke
parents:
diff changeset
   157
 * encoding is encountered. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   158
 * <dt><code>"unsupported-media-type" [fatal]</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   159
 * <dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
 * Raised if the configuration parameter "supported-media-types-only" is set
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
 * to <code>true</code> and an unsupported media type is encountered. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
 * </dl>
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
 * <p> In addition to raising the defined errors and warnings, implementations
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
 * are expected to raise implementation specific errors and warnings for any
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
 * other error and warning cases such as IO errors (file not found,
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
 * permission denied,...), XML well-formedness errors, and so on.
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
 * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
and Save Specification</a>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
public interface LSParser {
7f561c08de6b Initial load
duke
parents:
diff changeset
   171
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   172
     *  The <code>DOMConfiguration</code> object used when parsing an input
7f561c08de6b Initial load
duke
parents:
diff changeset
   173
     * source. This <code>DOMConfiguration</code> is specific to the parse
7f561c08de6b Initial load
duke
parents:
diff changeset
   174
     * operation. No parameter values from this <code>DOMConfiguration</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   175
     *  object are passed automatically to the <code>DOMConfiguration</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   176
     * object on the <code>Document</code> that is created, or used, by the
7f561c08de6b Initial load
duke
parents:
diff changeset
   177
     * parse operation. The DOM application is responsible for passing any
7f561c08de6b Initial load
duke
parents:
diff changeset
   178
     * needed parameter values from this <code>DOMConfiguration</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   179
     * object to the <code>DOMConfiguration</code> object referenced by the
7f561c08de6b Initial load
duke
parents:
diff changeset
   180
     * <code>Document</code> object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   181
     * <br> In addition to the parameters recognized in on the <a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMConfiguration'>
7f561c08de6b Initial load
duke
parents:
diff changeset
   182
     * DOMConfiguration</a> interface defined in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
7f561c08de6b Initial load
duke
parents:
diff changeset
   183
     * , the <code>DOMConfiguration</code> objects for <code>LSParser</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   184
     * add or modify the following parameters:
7f561c08de6b Initial load
duke
parents:
diff changeset
   185
     * <dl>
7f561c08de6b Initial load
duke
parents:
diff changeset
   186
     * <dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   187
     * <code>"charset-overrides-xml-encoding"</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   188
     * <dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   189
     * <dl>
7f561c08de6b Initial load
duke
parents:
diff changeset
   190
     * <dt><code>true</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   191
     * <dd>[<em>optional</em>] (<em>default</em>) If a higher level protocol such as HTTP [<a href='http://www.ietf.org/rfc/rfc2616.txt'>IETF RFC 2616</a>] provides an
7f561c08de6b Initial load
duke
parents:
diff changeset
   192
     * indication of the character encoding of the input stream being
7f561c08de6b Initial load
duke
parents:
diff changeset
   193
     * processed, that will override any encoding specified in the XML
7f561c08de6b Initial load
duke
parents:
diff changeset
   194
     * declaration or the Text declaration (see also section 4.3.3,
7f561c08de6b Initial load
duke
parents:
diff changeset
   195
     * "Character Encoding in Entities", in [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]).
7f561c08de6b Initial load
duke
parents:
diff changeset
   196
     * Explicitly setting an encoding in the <code>LSInput</code> overrides
7f561c08de6b Initial load
duke
parents:
diff changeset
   197
     * any encoding from the protocol. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   198
     * <dt><code>false</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   199
     * <dd>[<em>required</em>] The parser ignores any character set encoding information from
7f561c08de6b Initial load
duke
parents:
diff changeset
   200
     * higher-level protocols. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   201
     * </dl></dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   202
     * <dt><code>"disallow-doctype"</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   203
     * <dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   204
     * <dl>
7f561c08de6b Initial load
duke
parents:
diff changeset
   205
     * <dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   206
     * <code>true</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   207
     * <dd>[<em>optional</em>] Throw a fatal <b>"doctype-not-allowed"</b> error if a doctype node is found while parsing the document. This is
7f561c08de6b Initial load
duke
parents:
diff changeset
   208
     * useful when dealing with things like SOAP envelopes where doctype
7f561c08de6b Initial load
duke
parents:
diff changeset
   209
     * nodes are not allowed. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   210
     * <dt><code>false</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   211
     * <dd>[<em>required</em>] (<em>default</em>) Allow doctype nodes in the document. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   212
     * </dl></dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   213
     * <dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   214
     * <code>"ignore-unknown-character-denormalizations"</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   215
     * <dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   216
     * <dl>
7f561c08de6b Initial load
duke
parents:
diff changeset
   217
     * <dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   218
     * <code>true</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   219
     * <dd>[<em>required</em>] (<em>default</em>) If, while verifying full normalization when [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>] is
7f561c08de6b Initial load
duke
parents:
diff changeset
   220
     * supported, a processor encounters characters for which it cannot
7f561c08de6b Initial load
duke
parents:
diff changeset
   221
     * determine the normalization properties, then the processor will
7f561c08de6b Initial load
duke
parents:
diff changeset
   222
     * ignore any possible denormalizations caused by these characters.
7f561c08de6b Initial load
duke
parents:
diff changeset
   223
     * This parameter is ignored for [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   224
     * <dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   225
     * <code>false</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   226
     * <dd>[<em>optional</em>] Report an fatal <b>"unknown-character-denormalization"</b> error if a character is encountered for which the processor cannot
7f561c08de6b Initial load
duke
parents:
diff changeset
   227
     * determine the normalization properties. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   228
     * </dl></dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   229
     * <dt><code>"infoset"</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   230
     * <dd> See
7f561c08de6b Initial load
duke
parents:
diff changeset
   231
     * the definition of <code>DOMConfiguration</code> for a description of
7f561c08de6b Initial load
duke
parents:
diff changeset
   232
     * this parameter. Unlike in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
7f561c08de6b Initial load
duke
parents:
diff changeset
   233
     * , this parameter will default to <code>true</code> for
7f561c08de6b Initial load
duke
parents:
diff changeset
   234
     * <code>LSParser</code>. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   235
     * <dt><code>"namespaces"</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   236
     * <dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   237
     * <dl>
7f561c08de6b Initial load
duke
parents:
diff changeset
   238
     * <dt><code>true</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   239
     * <dd>[<em>required</em>] (<em>default</em>) Perform the namespace processing as defined in [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
7f561c08de6b Initial load
duke
parents:
diff changeset
   240
     *  and [<a href='http://www.w3.org/TR/2004/REC-xml-names11-20040204/'>XML Namespaces 1.1</a>]
7f561c08de6b Initial load
duke
parents:
diff changeset
   241
     * . </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   242
     * <dt><code>false</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   243
     * <dd>[<em>optional</em>] Do not perform the namespace processing. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   244
     * </dl></dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   245
     * <dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   246
     * <code>"resource-resolver"</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   247
     * <dd>[<em>required</em>] A reference to a <code>LSResourceResolver</code> object, or null. If
7f561c08de6b Initial load
duke
parents:
diff changeset
   248
     * the value of this parameter is not null when an external resource
7f561c08de6b Initial load
duke
parents:
diff changeset
   249
     * (such as an external XML entity or an XML schema location) is
7f561c08de6b Initial load
duke
parents:
diff changeset
   250
     * encountered, the implementation will request that the
7f561c08de6b Initial load
duke
parents:
diff changeset
   251
     * <code>LSResourceResolver</code> referenced in this parameter resolves
7f561c08de6b Initial load
duke
parents:
diff changeset
   252
     * the resource. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   253
     * <dt><code>"supported-media-types-only"</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   254
     * <dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   255
     * <dl>
7f561c08de6b Initial load
duke
parents:
diff changeset
   256
     * <dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   257
     * <code>true</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   258
     * <dd>[<em>optional</em>] Check that the media type of the parsed resource is a supported media
7f561c08de6b Initial load
duke
parents:
diff changeset
   259
     * type. If an unsupported media type is encountered, a fatal error of
7f561c08de6b Initial load
duke
parents:
diff changeset
   260
     * type <b>"unsupported-media-type"</b> will be raised. The media types defined in [<a href='http://www.ietf.org/rfc/rfc3023.txt'>IETF RFC 3023</a>] must always
7f561c08de6b Initial load
duke
parents:
diff changeset
   261
     * be accepted. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   262
     * <dt><code>false</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   263
     * <dd>[<em>required</em>] (<em>default</em>) Accept any media type. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   264
     * </dl></dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   265
     * <dt><code>"validate"</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   266
     * <dd> See the definition of
7f561c08de6b Initial load
duke
parents:
diff changeset
   267
     * <code>DOMConfiguration</code> for a description of this parameter.
7f561c08de6b Initial load
duke
parents:
diff changeset
   268
     * Unlike in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
7f561c08de6b Initial load
duke
parents:
diff changeset
   269
     * , the processing of the internal subset is always accomplished, even
7f561c08de6b Initial load
duke
parents:
diff changeset
   270
     * if this parameter is set to <code>false</code>. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   271
     * <dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   272
     * <code>"validate-if-schema"</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   273
     * <dd> See the definition of
7f561c08de6b Initial load
duke
parents:
diff changeset
   274
     * <code>DOMConfiguration</code> for a description of this parameter.
7f561c08de6b Initial load
duke
parents:
diff changeset
   275
     * Unlike in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
7f561c08de6b Initial load
duke
parents:
diff changeset
   276
     * , the processing of the internal subset is always accomplished, even
7f561c08de6b Initial load
duke
parents:
diff changeset
   277
     * if this parameter is set to <code>false</code>. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   278
     * <dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   279
     * <code>"well-formed"</code></dt>
7f561c08de6b Initial load
duke
parents:
diff changeset
   280
     * <dd> See the definition of
7f561c08de6b Initial load
duke
parents:
diff changeset
   281
     * <code>DOMConfiguration</code> for a description of this parameter.
7f561c08de6b Initial load
duke
parents:
diff changeset
   282
     * Unlike in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
7f561c08de6b Initial load
duke
parents:
diff changeset
   283
     * , this parameter cannot be set to <code>false</code>. </dd>
7f561c08de6b Initial load
duke
parents:
diff changeset
   284
     * </dl>
7f561c08de6b Initial load
duke
parents:
diff changeset
   285
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   286
    public DOMConfiguration getDomConfig();
7f561c08de6b Initial load
duke
parents:
diff changeset
   287
7f561c08de6b Initial load
duke
parents:
diff changeset
   288
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   289
     *  When a filter is provided, the implementation will call out to the
7f561c08de6b Initial load
duke
parents:
diff changeset
   290
     * filter as it is constructing the DOM tree structure. The filter can
7f561c08de6b Initial load
duke
parents:
diff changeset
   291
     * choose to remove elements from the document being constructed, or to
7f561c08de6b Initial load
duke
parents:
diff changeset
   292
     * terminate the parsing early.
7f561c08de6b Initial load
duke
parents:
diff changeset
   293
     * <br> The filter is invoked after the operations requested by the
7f561c08de6b Initial load
duke
parents:
diff changeset
   294
     * <code>DOMConfiguration</code> parameters have been applied. For
7f561c08de6b Initial load
duke
parents:
diff changeset
   295
     * example, if "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-validate'>
7f561c08de6b Initial load
duke
parents:
diff changeset
   296
     * validate</a>" is set to <code>true</code>, the validation is done before invoking the
7f561c08de6b Initial load
duke
parents:
diff changeset
   297
     * filter.
7f561c08de6b Initial load
duke
parents:
diff changeset
   298
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   299
    public LSParserFilter getFilter();
7f561c08de6b Initial load
duke
parents:
diff changeset
   300
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   301
     *  When a filter is provided, the implementation will call out to the
7f561c08de6b Initial load
duke
parents:
diff changeset
   302
     * filter as it is constructing the DOM tree structure. The filter can
7f561c08de6b Initial load
duke
parents:
diff changeset
   303
     * choose to remove elements from the document being constructed, or to
7f561c08de6b Initial load
duke
parents:
diff changeset
   304
     * terminate the parsing early.
7f561c08de6b Initial load
duke
parents:
diff changeset
   305
     * <br> The filter is invoked after the operations requested by the
7f561c08de6b Initial load
duke
parents:
diff changeset
   306
     * <code>DOMConfiguration</code> parameters have been applied. For
7f561c08de6b Initial load
duke
parents:
diff changeset
   307
     * example, if "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-validate'>
7f561c08de6b Initial load
duke
parents:
diff changeset
   308
     * validate</a>" is set to <code>true</code>, the validation is done before invoking the
7f561c08de6b Initial load
duke
parents:
diff changeset
   309
     * filter.
7f561c08de6b Initial load
duke
parents:
diff changeset
   310
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   311
    public void setFilter(LSParserFilter filter);
7f561c08de6b Initial load
duke
parents:
diff changeset
   312
7f561c08de6b Initial load
duke
parents:
diff changeset
   313
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   314
     *  <code>true</code> if the <code>LSParser</code> is asynchronous,
7f561c08de6b Initial load
duke
parents:
diff changeset
   315
     * <code>false</code> if it is synchronous.
7f561c08de6b Initial load
duke
parents:
diff changeset
   316
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   317
    public boolean getAsync();
7f561c08de6b Initial load
duke
parents:
diff changeset
   318
7f561c08de6b Initial load
duke
parents:
diff changeset
   319
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   320
     *  <code>true</code> if the <code>LSParser</code> is currently busy
7f561c08de6b Initial load
duke
parents:
diff changeset
   321
     * loading a document, otherwise <code>false</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   322
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   323
    public boolean getBusy();
7f561c08de6b Initial load
duke
parents:
diff changeset
   324
7f561c08de6b Initial load
duke
parents:
diff changeset
   325
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   326
     * Parse an XML document from a resource identified by a
7f561c08de6b Initial load
duke
parents:
diff changeset
   327
     * <code>LSInput</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   328
     * @param input  The <code>LSInput</code> from which the source of the
7f561c08de6b Initial load
duke
parents:
diff changeset
   329
     *   document is to be read.
7f561c08de6b Initial load
duke
parents:
diff changeset
   330
     * @return  If the <code>LSParser</code> is a synchronous
7f561c08de6b Initial load
duke
parents:
diff changeset
   331
     *   <code>LSParser</code>, the newly created and populated
7f561c08de6b Initial load
duke
parents:
diff changeset
   332
     *   <code>Document</code> is returned. If the <code>LSParser</code> is
7f561c08de6b Initial load
duke
parents:
diff changeset
   333
     *   asynchronous, <code>null</code> is returned since the document
7f561c08de6b Initial load
duke
parents:
diff changeset
   334
     *   object may not yet be constructed when this method returns.
7f561c08de6b Initial load
duke
parents:
diff changeset
   335
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   336
     *    INVALID_STATE_ERR: Raised if the <code>LSParser</code>'s
7f561c08de6b Initial load
duke
parents:
diff changeset
   337
     *   <code>LSParser.busy</code> attribute is <code>true</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   338
     * @exception LSException
7f561c08de6b Initial load
duke
parents:
diff changeset
   339
     *    PARSE_ERR: Raised if the <code>LSParser</code> was unable to load
7f561c08de6b Initial load
duke
parents:
diff changeset
   340
     *   the XML document. DOM applications should attach a
7f561c08de6b Initial load
duke
parents:
diff changeset
   341
     *   <code>DOMErrorHandler</code> using the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
7f561c08de6b Initial load
duke
parents:
diff changeset
   342
     *   error-handler</a>" if they wish to get details on the error.
7f561c08de6b Initial load
duke
parents:
diff changeset
   343
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   344
    public Document parse(LSInput input)
7f561c08de6b Initial load
duke
parents:
diff changeset
   345
                          throws DOMException, LSException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   346
7f561c08de6b Initial load
duke
parents:
diff changeset
   347
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   348
     *  Parse an XML document from a location identified by a URI reference [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]. If the URI
7f561c08de6b Initial load
duke
parents:
diff changeset
   349
     * contains a fragment identifier (see section 4.1 in [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>]), the
7f561c08de6b Initial load
duke
parents:
diff changeset
   350
     * behavior is not defined by this specification, future versions of
7f561c08de6b Initial load
duke
parents:
diff changeset
   351
     * this specification may define the behavior.
7f561c08de6b Initial load
duke
parents:
diff changeset
   352
     * @param uri The location of the XML document to be read.
7f561c08de6b Initial load
duke
parents:
diff changeset
   353
     * @return  If the <code>LSParser</code> is a synchronous
7f561c08de6b Initial load
duke
parents:
diff changeset
   354
     *   <code>LSParser</code>, the newly created and populated
7f561c08de6b Initial load
duke
parents:
diff changeset
   355
     *   <code>Document</code> is returned, or <code>null</code> if an error
7f561c08de6b Initial load
duke
parents:
diff changeset
   356
     *   occured. If the <code>LSParser</code> is asynchronous,
7f561c08de6b Initial load
duke
parents:
diff changeset
   357
     *   <code>null</code> is returned since the document object may not yet
7f561c08de6b Initial load
duke
parents:
diff changeset
   358
     *   be constructed when this method returns.
7f561c08de6b Initial load
duke
parents:
diff changeset
   359
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   360
     *    INVALID_STATE_ERR: Raised if the <code>LSParser.busy</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   361
     *   attribute is <code>true</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   362
     * @exception LSException
7f561c08de6b Initial load
duke
parents:
diff changeset
   363
     *    PARSE_ERR: Raised if the <code>LSParser</code> was unable to load
7f561c08de6b Initial load
duke
parents:
diff changeset
   364
     *   the XML document. DOM applications should attach a
7f561c08de6b Initial load
duke
parents:
diff changeset
   365
     *   <code>DOMErrorHandler</code> using the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
7f561c08de6b Initial load
duke
parents:
diff changeset
   366
     *   error-handler</a>" if they wish to get details on the error.
7f561c08de6b Initial load
duke
parents:
diff changeset
   367
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   368
    public Document parseURI(String uri)
7f561c08de6b Initial load
duke
parents:
diff changeset
   369
                             throws DOMException, LSException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   370
7f561c08de6b Initial load
duke
parents:
diff changeset
   371
    // ACTION_TYPES
7f561c08de6b Initial load
duke
parents:
diff changeset
   372
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   373
     *  Append the result of the parse operation as children of the context
7f561c08de6b Initial load
duke
parents:
diff changeset
   374
     * node. For this action to work, the context node must be an
7f561c08de6b Initial load
duke
parents:
diff changeset
   375
     * <code>Element</code> or a <code>DocumentFragment</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   376
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   377
    public static final short ACTION_APPEND_AS_CHILDREN = 1;
7f561c08de6b Initial load
duke
parents:
diff changeset
   378
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   379
     *  Replace all the children of the context node with the result of the
7f561c08de6b Initial load
duke
parents:
diff changeset
   380
     * parse operation. For this action to work, the context node must be an
7f561c08de6b Initial load
duke
parents:
diff changeset
   381
     * <code>Element</code>, a <code>Document</code>, or a
7f561c08de6b Initial load
duke
parents:
diff changeset
   382
     * <code>DocumentFragment</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   383
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   384
    public static final short ACTION_REPLACE_CHILDREN   = 2;
7f561c08de6b Initial load
duke
parents:
diff changeset
   385
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   386
     *  Insert the result of the parse operation as the immediately preceding
7f561c08de6b Initial load
duke
parents:
diff changeset
   387
     * sibling of the context node. For this action to work the context
7f561c08de6b Initial load
duke
parents:
diff changeset
   388
     * node's parent must be an <code>Element</code> or a
7f561c08de6b Initial load
duke
parents:
diff changeset
   389
     * <code>DocumentFragment</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   390
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   391
    public static final short ACTION_INSERT_BEFORE      = 3;
7f561c08de6b Initial load
duke
parents:
diff changeset
   392
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   393
     *  Insert the result of the parse operation as the immediately following
7f561c08de6b Initial load
duke
parents:
diff changeset
   394
     * sibling of the context node. For this action to work the context
7f561c08de6b Initial load
duke
parents:
diff changeset
   395
     * node's parent must be an <code>Element</code> or a
7f561c08de6b Initial load
duke
parents:
diff changeset
   396
     * <code>DocumentFragment</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   397
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   398
    public static final short ACTION_INSERT_AFTER       = 4;
7f561c08de6b Initial load
duke
parents:
diff changeset
   399
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   400
     *  Replace the context node with the result of the parse operation. For
7f561c08de6b Initial load
duke
parents:
diff changeset
   401
     * this action to work, the context node must have a parent, and the
7f561c08de6b Initial load
duke
parents:
diff changeset
   402
     * parent must be an <code>Element</code> or a
7f561c08de6b Initial load
duke
parents:
diff changeset
   403
     * <code>DocumentFragment</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   404
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   405
    public static final short ACTION_REPLACE            = 5;
7f561c08de6b Initial load
duke
parents:
diff changeset
   406
7f561c08de6b Initial load
duke
parents:
diff changeset
   407
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   408
     *  Parse an XML fragment from a resource identified by a
7f561c08de6b Initial load
duke
parents:
diff changeset
   409
     * <code>LSInput</code> and insert the content into an existing document
7f561c08de6b Initial load
duke
parents:
diff changeset
   410
     * at the position specified with the <code>context</code> and
7f561c08de6b Initial load
duke
parents:
diff changeset
   411
     * <code>action</code> arguments. When parsing the input stream, the
7f561c08de6b Initial load
duke
parents:
diff changeset
   412
     * context node (or its parent, depending on where the result will be
7f561c08de6b Initial load
duke
parents:
diff changeset
   413
     * inserted) is used for resolving unbound namespace prefixes. The
7f561c08de6b Initial load
duke
parents:
diff changeset
   414
     * context node's <code>ownerDocument</code> node (or the node itself if
7f561c08de6b Initial load
duke
parents:
diff changeset
   415
     * the node of type <code>DOCUMENT_NODE</code>) is used to resolve
7f561c08de6b Initial load
duke
parents:
diff changeset
   416
     * default attributes and entity references.
7f561c08de6b Initial load
duke
parents:
diff changeset
   417
     * <br> As the new data is inserted into the document, at least one
7f561c08de6b Initial load
duke
parents:
diff changeset
   418
     * mutation event is fired per new immediate child or sibling of the
7f561c08de6b Initial load
duke
parents:
diff changeset
   419
     * context node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   420
     * <br> If the context node is a <code>Document</code> node and the action
7f561c08de6b Initial load
duke
parents:
diff changeset
   421
     * is <code>ACTION_REPLACE_CHILDREN</code>, then the document that is
7f561c08de6b Initial load
duke
parents:
diff changeset
   422
     * passed as the context node will be changed such that its
7f561c08de6b Initial load
duke
parents:
diff changeset
   423
     * <code>xmlEncoding</code>, <code>documentURI</code>,
7f561c08de6b Initial load
duke
parents:
diff changeset
   424
     * <code>xmlVersion</code>, <code>inputEncoding</code>,
7f561c08de6b Initial load
duke
parents:
diff changeset
   425
     * <code>xmlStandalone</code>, and all other such attributes are set to
7f561c08de6b Initial load
duke
parents:
diff changeset
   426
     * what they would be set to if the input source was parsed using
7f561c08de6b Initial load
duke
parents:
diff changeset
   427
     * <code>LSParser.parse()</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   428
     * <br> This method is always synchronous, even if the
7f561c08de6b Initial load
duke
parents:
diff changeset
   429
     * <code>LSParser</code> is asynchronous (<code>LSParser.async</code> is
7f561c08de6b Initial load
duke
parents:
diff changeset
   430
     * <code>true</code>).
7f561c08de6b Initial load
duke
parents:
diff changeset
   431
     * <br> If an error occurs while parsing, the caller is notified through
7f561c08de6b Initial load
duke
parents:
diff changeset
   432
     * the <code>ErrorHandler</code> instance associated with the "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
7f561c08de6b Initial load
duke
parents:
diff changeset
   433
     * error-handler</a>" parameter of the <code>DOMConfiguration</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   434
     * <br> When calling <code>parseWithContext</code>, the values of the
7f561c08de6b Initial load
duke
parents:
diff changeset
   435
     * following configuration parameters will be ignored and their default
7f561c08de6b Initial load
duke
parents:
diff changeset
   436
     * values will always be used instead: "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-validate'>
7f561c08de6b Initial load
duke
parents:
diff changeset
   437
     * validate</a>", "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-validate-if-schema'>
7f561c08de6b Initial load
duke
parents:
diff changeset
   438
     * validate-if-schema</a>", and "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-element-content-whitespace'>
7f561c08de6b Initial load
duke
parents:
diff changeset
   439
     * element-content-whitespace</a>". Other parameters will be treated normally, and the parser is expected
7f561c08de6b Initial load
duke
parents:
diff changeset
   440
     * to call the <code>LSParserFilter</code> just as if a whole document
7f561c08de6b Initial load
duke
parents:
diff changeset
   441
     * was parsed.
7f561c08de6b Initial load
duke
parents:
diff changeset
   442
     * @param input  The <code>LSInput</code> from which the source document
7f561c08de6b Initial load
duke
parents:
diff changeset
   443
     *   is to be read. The source document must be an XML fragment, i.e.
7f561c08de6b Initial load
duke
parents:
diff changeset
   444
     *   anything except a complete XML document (except in the case where
7f561c08de6b Initial load
duke
parents:
diff changeset
   445
     *   the context node of type <code>DOCUMENT_NODE</code>, and the action
7f561c08de6b Initial load
duke
parents:
diff changeset
   446
     *   is <code>ACTION_REPLACE_CHILDREN</code>), a DOCTYPE (internal
7f561c08de6b Initial load
duke
parents:
diff changeset
   447
     *   subset), entity declaration(s), notation declaration(s), or XML or
7f561c08de6b Initial load
duke
parents:
diff changeset
   448
     *   text declaration(s).
7f561c08de6b Initial load
duke
parents:
diff changeset
   449
     * @param contextArg  The node that is used as the context for the data
7f561c08de6b Initial load
duke
parents:
diff changeset
   450
     *   that is being parsed. This node must be a <code>Document</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   451
     *   node, a <code>DocumentFragment</code> node, or a node of a type
7f561c08de6b Initial load
duke
parents:
diff changeset
   452
     *   that is allowed as a child of an <code>Element</code> node, e.g. it
7f561c08de6b Initial load
duke
parents:
diff changeset
   453
     *   cannot be an <code>Attribute</code> node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   454
     * @param action  This parameter describes which action should be taken
7f561c08de6b Initial load
duke
parents:
diff changeset
   455
     *   between the new set of nodes being inserted and the existing
7f561c08de6b Initial load
duke
parents:
diff changeset
   456
     *   children of the context node. The set of possible actions is
7f561c08de6b Initial load
duke
parents:
diff changeset
   457
     *   defined in <code>ACTION_TYPES</code> above.
7f561c08de6b Initial load
duke
parents:
diff changeset
   458
     * @return  Return the node that is the result of the parse operation. If
7f561c08de6b Initial load
duke
parents:
diff changeset
   459
     *   the result is more than one top-level node, the first one is
7f561c08de6b Initial load
duke
parents:
diff changeset
   460
     *   returned.
7f561c08de6b Initial load
duke
parents:
diff changeset
   461
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   462
     *   HIERARCHY_REQUEST_ERR: Raised if the content cannot replace, be
7f561c08de6b Initial load
duke
parents:
diff changeset
   463
     *   inserted before, after, or as a child of the context node (see also
7f561c08de6b Initial load
duke
parents:
diff changeset
   464
     *   <code>Node.insertBefore</code> or <code>Node.replaceChild</code> in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
7f561c08de6b Initial load
duke
parents:
diff changeset
   465
     *   ).
7f561c08de6b Initial load
duke
parents:
diff changeset
   466
     *   <br> NOT_SUPPORTED_ERR: Raised if the <code>LSParser</code> doesn't
7f561c08de6b Initial load
duke
parents:
diff changeset
   467
     *   support this method, or if the context node is of type
7f561c08de6b Initial load
duke
parents:
diff changeset
   468
     *   <code>Document</code> and the DOM implementation doesn't support
7f561c08de6b Initial load
duke
parents:
diff changeset
   469
     *   the replacement of the <code>DocumentType</code> child or
7f561c08de6b Initial load
duke
parents:
diff changeset
   470
     *   <code>Element</code> child.
7f561c08de6b Initial load
duke
parents:
diff changeset
   471
     *   <br> NO_MODIFICATION_ALLOWED_ERR: Raised if the context node is a
7f561c08de6b Initial load
duke
parents:
diff changeset
   472
     *   read only node and the content is being appended to its child list,
7f561c08de6b Initial load
duke
parents:
diff changeset
   473
     *   or if the parent node of the context node is read only node and the
7f561c08de6b Initial load
duke
parents:
diff changeset
   474
     *   content is being inserted in its child list.
7f561c08de6b Initial load
duke
parents:
diff changeset
   475
     *   <br> INVALID_STATE_ERR: Raised if the <code>LSParser.busy</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   476
     *   attribute is <code>true</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   477
     * @exception LSException
7f561c08de6b Initial load
duke
parents:
diff changeset
   478
     *    PARSE_ERR: Raised if the <code>LSParser</code> was unable to load
7f561c08de6b Initial load
duke
parents:
diff changeset
   479
     *   the XML fragment. DOM applications should attach a
7f561c08de6b Initial load
duke
parents:
diff changeset
   480
     *   <code>DOMErrorHandler</code> using the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
7f561c08de6b Initial load
duke
parents:
diff changeset
   481
     *   error-handler</a>" if they wish to get details on the error.
7f561c08de6b Initial load
duke
parents:
diff changeset
   482
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   483
    public Node parseWithContext(LSInput input,
7f561c08de6b Initial load
duke
parents:
diff changeset
   484
                                 Node contextArg,
7f561c08de6b Initial load
duke
parents:
diff changeset
   485
                                 short action)
7f561c08de6b Initial load
duke
parents:
diff changeset
   486
                                 throws DOMException, LSException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   487
7f561c08de6b Initial load
duke
parents:
diff changeset
   488
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   489
     *  Abort the loading of the document that is currently being loaded by
7f561c08de6b Initial load
duke
parents:
diff changeset
   490
     * the <code>LSParser</code>. If the <code>LSParser</code> is currently
7f561c08de6b Initial load
duke
parents:
diff changeset
   491
     * not busy, a call to this method does nothing.
7f561c08de6b Initial load
duke
parents:
diff changeset
   492
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   493
    public void abort();
7f561c08de6b Initial load
duke
parents:
diff changeset
   494
7f561c08de6b Initial load
duke
parents:
diff changeset
   495
}