jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java
author dfuchs
Tue, 30 Jun 2015 12:04:27 +0200
changeset 31497 4a6b2e733c0d
parent 31286 4c6b605ceb9f
child 32901 42af6bc4d36a
permissions -rw-r--r--
8130051: Cleanup usage of reflection in jaxp Summary: replaced usage of reflection with direct access where possible, removed obsolete code where possible. Reviewed-by: joehw
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
 * reserved comment block
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
 * DO NOT REMOVE OR ALTER!
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
/*
25834
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 25264
diff changeset
     6
 * Licensed to the Apache Software Foundation (ASF) under one or more
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 25264
diff changeset
     7
 * contributor license agreements.  See the NOTICE file distributed with
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 25264
diff changeset
     8
 * this work for additional information regarding copyright ownership.
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 25264
diff changeset
     9
 * The ASF licenses this file to You under the Apache License, Version 2.0
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 25264
diff changeset
    10
 * (the "License"); you may not use this file except in compliance with
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 25264
diff changeset
    11
 * the License.  You may obtain a copy of the License at
6
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 *      http://www.apache.org/licenses/LICENSE-2.0
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 * Unless required by applicable law or agreed to in writing, software
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 * distributed under the License is distributed on an "AS IS" BASIS,
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 * See the License for the specific language governing permissions and
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 * limitations under the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
package com.sun.org.apache.xerces.internal.dom;
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
import com.sun.org.apache.xerces.internal.impl.RevalidationHandler;
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
import com.sun.org.apache.xerces.internal.parsers.DOMParserImpl;
12458
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
    25
import com.sun.org.apache.xerces.internal.parsers.DTDConfiguration;
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
    26
import com.sun.org.apache.xerces.internal.parsers.XIncludeAwareParserConfiguration;
6
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
import com.sun.org.apache.xerces.internal.util.XMLChar;
12458
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
    28
import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
6
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription;
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
import com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl;
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
import org.w3c.dom.DOMException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
import org.w3c.dom.DOMImplementation;
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
import org.w3c.dom.Document;
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
import org.w3c.dom.DocumentType;
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
import org.w3c.dom.Element;
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
import org.w3c.dom.ls.LSParser;
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
import org.w3c.dom.ls.DOMImplementationLS;
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
import org.w3c.dom.ls.LSInput;
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
import org.w3c.dom.ls.LSOutput;
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
import org.w3c.dom.ls.LSSerializer;
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
 * The DOMImplementation class is description of a particular
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
 * implementation of the Document Object Model. As such its data is
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
 * static, shared by all instances of this implementation.
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
 * <P>
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
 * The DOM API requires that it be a real object rather than static
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
 * methods. However, there's nothing that says it can't be a singleton,
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
 * so that's how I've implemented it.
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
 * <P>
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
 * This particular class, along with CoreDocumentImpl, supports the DOM
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
 * Core and Load/Save (Experimental). Optional modules are supported by
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
 * the more complete DOMImplementation class along with DocumentImpl.
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
 * @xerces.internal
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
 * @since PR-DOM-Level-1-19980818.
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
public class CoreDOMImplementationImpl
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
        implements DOMImplementation, DOMImplementationLS {
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
        //
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
        // Data
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
        //
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
    // validators pool
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
    private static final int SIZE = 2;
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
    private RevalidationHandler validators[] = new RevalidationHandler[SIZE];
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
    private RevalidationHandler dtdValidators[] = new RevalidationHandler[SIZE];
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
    private int freeValidatorIndex = -1;
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
    private int freeDTDValidatorIndex = -1;
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
    private int currentSize = SIZE;
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
    // Document and doctype counter.  Used to assign order to documents and
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
    // doctypes without owners, on an demand basis.   Used for
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
    // compareDocumentPosition
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
    private int docAndDoctypeCounter = 0;
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
        // static
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
        /** Dom implementation singleton. */
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
        static CoreDOMImplementationImpl singleton =
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
                new CoreDOMImplementationImpl();
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
        //
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
        // Public methods
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
        //
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
        /** NON-DOM: Obtain and return the single shared object */
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
        public static DOMImplementation getDOMImplementation() {
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
                return singleton;
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
        //
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
        // DOMImplementation methods
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
        //
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
        /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
         * Test if the DOM implementation supports a specific "feature" --
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
         * currently meaning language and level thereof.
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
         *
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
         * @param feature The package name of the feature to test.
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
         * In Level 1, supported values are "HTML" and "XML" (case-insensitive).
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
         * At this writing, com.sun.org.apache.xerces.internal.dom supports only XML.
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
         *
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
         * @param version The version number of the feature being tested.
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
         * This is interpreted as "Version of the DOM API supported for the
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
         * specified Feature", and in Level 1 should be "1.0"
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
         *
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
         * @return true iff this implementation is compatable with the specified
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
         * feature and version.
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
         */
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
        public boolean hasFeature(String feature, String version) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
            boolean anyVersion = version == null || version.length() == 0;
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
            if (feature.startsWith("+")) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
                feature = feature.substring(1);
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
            return (
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
                feature.equalsIgnoreCase("Core")
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
                    && (anyVersion
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
                        || version.equals("1.0")
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
                        || version.equals("2.0")
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
                        || version.equals("3.0")))
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
                        || (feature.equalsIgnoreCase("XML")
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
                    && (anyVersion
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
                        || version.equals("1.0")
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
                        || version.equals("2.0")
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
                        || version.equals("3.0")))
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
                        || (feature.equalsIgnoreCase("LS")
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
                    && (anyVersion || version.equals("3.0")));
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
        } // hasFeature(String,String):boolean
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
        /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
         * Introduced in DOM Level 2. <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
         *
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
         * Creates an empty DocumentType node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
         *
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
         * @param qualifiedName The qualified name of the document type to be created.
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
         * @param publicID The document type public identifier.
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
         * @param systemID The document type system identifier.
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
         * @since WD-DOM-Level-2-19990923
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
         */
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
        public DocumentType createDocumentType( String qualifiedName,
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
                                    String publicID, String systemID) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
                // REVISIT: this might allow creation of invalid name for DOCTYPE
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
                //          xmlns prefix.
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
                //          also there is no way for a user to turn off error checking.
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
                checkQName(qualifiedName);
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
                return new DocumentTypeImpl(null, qualifiedName, publicID, systemID);
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
    final void checkQName(String qname){
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
        int index = qname.indexOf(':');
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
        int lastIndex = qname.lastIndexOf(':');
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
        int length = qname.length();
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
        // it is an error for NCName to have more than one ':'
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
        // check if it is valid QName [Namespace in XML production 6]
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
        if (index == 0 || index == length - 1 || lastIndex != index) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   157
            String msg =
7f561c08de6b Initial load
duke
parents:
diff changeset
   158
                DOMMessageFormatter.formatMessage(
7f561c08de6b Initial load
duke
parents:
diff changeset
   159
                    DOMMessageFormatter.DOM_DOMAIN,
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
                    "NAMESPACE_ERR",
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
                    null);
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
            throw new DOMException(DOMException.NAMESPACE_ERR, msg);
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
        int start = 0;
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
        // Namespace in XML production [6]
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
        if (index > 0) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
            // check that prefix is NCName
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
            if (!XMLChar.isNCNameStart(qname.charAt(start))) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
                String msg =
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
                    DOMMessageFormatter.formatMessage(
7f561c08de6b Initial load
duke
parents:
diff changeset
   171
                        DOMMessageFormatter.DOM_DOMAIN,
7f561c08de6b Initial load
duke
parents:
diff changeset
   172
                        "INVALID_CHARACTER_ERR",
7f561c08de6b Initial load
duke
parents:
diff changeset
   173
                        null);
7f561c08de6b Initial load
duke
parents:
diff changeset
   174
                throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
7f561c08de6b Initial load
duke
parents:
diff changeset
   175
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
   176
            for (int i = 1; i < index; i++) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   177
                if (!XMLChar.isNCName(qname.charAt(i))) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   178
                    String msg =
7f561c08de6b Initial load
duke
parents:
diff changeset
   179
                        DOMMessageFormatter.formatMessage(
7f561c08de6b Initial load
duke
parents:
diff changeset
   180
                            DOMMessageFormatter.DOM_DOMAIN,
7f561c08de6b Initial load
duke
parents:
diff changeset
   181
                            "INVALID_CHARACTER_ERR",
7f561c08de6b Initial load
duke
parents:
diff changeset
   182
                            null);
7f561c08de6b Initial load
duke
parents:
diff changeset
   183
                    throw new DOMException(
7f561c08de6b Initial load
duke
parents:
diff changeset
   184
                        DOMException.INVALID_CHARACTER_ERR,
7f561c08de6b Initial load
duke
parents:
diff changeset
   185
                        msg);
7f561c08de6b Initial load
duke
parents:
diff changeset
   186
                }
7f561c08de6b Initial load
duke
parents:
diff changeset
   187
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
   188
            start = index + 1;
7f561c08de6b Initial load
duke
parents:
diff changeset
   189
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   190
7f561c08de6b Initial load
duke
parents:
diff changeset
   191
        // check local part
7f561c08de6b Initial load
duke
parents:
diff changeset
   192
        if (!XMLChar.isNCNameStart(qname.charAt(start))) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   193
            // REVISIT: add qname parameter to the message
7f561c08de6b Initial load
duke
parents:
diff changeset
   194
            String msg =
7f561c08de6b Initial load
duke
parents:
diff changeset
   195
                DOMMessageFormatter.formatMessage(
7f561c08de6b Initial load
duke
parents:
diff changeset
   196
                    DOMMessageFormatter.DOM_DOMAIN,
7f561c08de6b Initial load
duke
parents:
diff changeset
   197
                    "INVALID_CHARACTER_ERR",
7f561c08de6b Initial load
duke
parents:
diff changeset
   198
                    null);
7f561c08de6b Initial load
duke
parents:
diff changeset
   199
            throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
7f561c08de6b Initial load
duke
parents:
diff changeset
   200
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   201
        for (int i = start + 1; i < length; i++) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   202
            if (!XMLChar.isNCName(qname.charAt(i))) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   203
                String msg =
7f561c08de6b Initial load
duke
parents:
diff changeset
   204
                    DOMMessageFormatter.formatMessage(
7f561c08de6b Initial load
duke
parents:
diff changeset
   205
                        DOMMessageFormatter.DOM_DOMAIN,
7f561c08de6b Initial load
duke
parents:
diff changeset
   206
                        "INVALID_CHARACTER_ERR",
7f561c08de6b Initial load
duke
parents:
diff changeset
   207
                        null);
7f561c08de6b Initial load
duke
parents:
diff changeset
   208
                throw new DOMException(DOMException.INVALID_CHARACTER_ERR, msg);
7f561c08de6b Initial load
duke
parents:
diff changeset
   209
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
   210
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   211
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   212
7f561c08de6b Initial load
duke
parents:
diff changeset
   213
7f561c08de6b Initial load
duke
parents:
diff changeset
   214
        /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   215
         * Introduced in DOM Level 2. <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   216
         *
7f561c08de6b Initial load
duke
parents:
diff changeset
   217
         * Creates an XML Document object of the specified type with its document
7f561c08de6b Initial load
duke
parents:
diff changeset
   218
         * element.
7f561c08de6b Initial load
duke
parents:
diff changeset
   219
         *
7f561c08de6b Initial load
duke
parents:
diff changeset
   220
         * @param namespaceURI     The namespace URI of the document
7f561c08de6b Initial load
duke
parents:
diff changeset
   221
         *                         element to create, or null.
7f561c08de6b Initial load
duke
parents:
diff changeset
   222
         * @param qualifiedName    The qualified name of the document
7f561c08de6b Initial load
duke
parents:
diff changeset
   223
         *                         element to create.
7f561c08de6b Initial load
duke
parents:
diff changeset
   224
         * @param doctype          The type of document to be created or null.<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   225
         *
7f561c08de6b Initial load
duke
parents:
diff changeset
   226
         *                         When doctype is not null, its
7f561c08de6b Initial load
duke
parents:
diff changeset
   227
         *                         Node.ownerDocument attribute is set to
7f561c08de6b Initial load
duke
parents:
diff changeset
   228
         *                         the document being created.
7f561c08de6b Initial load
duke
parents:
diff changeset
   229
         * @return Document        A new Document object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   230
         * @throws DOMException    WRONG_DOCUMENT_ERR: Raised if doctype has
7f561c08de6b Initial load
duke
parents:
diff changeset
   231
         *                         already been used with a different document.
7f561c08de6b Initial load
duke
parents:
diff changeset
   232
         * @since WD-DOM-Level-2-19990923
7f561c08de6b Initial load
duke
parents:
diff changeset
   233
         */
7f561c08de6b Initial load
duke
parents:
diff changeset
   234
        public Document createDocument(
7f561c08de6b Initial load
duke
parents:
diff changeset
   235
                String namespaceURI,
7f561c08de6b Initial load
duke
parents:
diff changeset
   236
                String qualifiedName,
7f561c08de6b Initial load
duke
parents:
diff changeset
   237
                DocumentType doctype)
7f561c08de6b Initial load
duke
parents:
diff changeset
   238
                throws DOMException {
7f561c08de6b Initial load
duke
parents:
diff changeset
   239
                if (doctype != null && doctype.getOwnerDocument() != null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   240
                        String msg =
7f561c08de6b Initial load
duke
parents:
diff changeset
   241
                                DOMMessageFormatter.formatMessage(
7f561c08de6b Initial load
duke
parents:
diff changeset
   242
                                        DOMMessageFormatter.DOM_DOMAIN,
7f561c08de6b Initial load
duke
parents:
diff changeset
   243
                                        "WRONG_DOCUMENT_ERR",
7f561c08de6b Initial load
duke
parents:
diff changeset
   244
                                        null);
7f561c08de6b Initial load
duke
parents:
diff changeset
   245
                        throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
7f561c08de6b Initial load
duke
parents:
diff changeset
   246
                }
7f561c08de6b Initial load
duke
parents:
diff changeset
   247
                CoreDocumentImpl doc = new CoreDocumentImpl(doctype);
7f561c08de6b Initial load
duke
parents:
diff changeset
   248
                Element e = doc.createElementNS(namespaceURI, qualifiedName);
7f561c08de6b Initial load
duke
parents:
diff changeset
   249
                doc.appendChild(e);
7f561c08de6b Initial load
duke
parents:
diff changeset
   250
                return doc;
7f561c08de6b Initial load
duke
parents:
diff changeset
   251
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   252
7f561c08de6b Initial load
duke
parents:
diff changeset
   253
        /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   254
         * DOM Level 3 WD - Experimental.
7f561c08de6b Initial load
duke
parents:
diff changeset
   255
         */
7f561c08de6b Initial load
duke
parents:
diff changeset
   256
        public Object getFeature(String feature, String version) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   257
            if (singleton.hasFeature(feature, version)) {
29948
2cd0c0d1ecff 8042244: Re-examine the supportedness of non-SE org.w3c.dom.** API
joehw
parents: 25868
diff changeset
   258
                return singleton;
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   259
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
   260
            return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
   261
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   262
7f561c08de6b Initial load
duke
parents:
diff changeset
   263
        // DOM L3 LS
7f561c08de6b Initial load
duke
parents:
diff changeset
   264
7f561c08de6b Initial load
duke
parents:
diff changeset
   265
        /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   266
         * DOM Level 3 LS CR - Experimental.
7f561c08de6b Initial load
duke
parents:
diff changeset
   267
     * Create a new <code>LSParser</code>. The newly constructed parser may
7f561c08de6b Initial load
duke
parents:
diff changeset
   268
     * then be configured by means of its <code>DOMConfiguration</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   269
     * object, and used to parse documents by means of its <code>parse</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   270
     *  method.
7f561c08de6b Initial load
duke
parents:
diff changeset
   271
     * @param mode  The <code>mode</code> argument is either
7f561c08de6b Initial load
duke
parents:
diff changeset
   272
     *   <code>MODE_SYNCHRONOUS</code> or <code>MODE_ASYNCHRONOUS</code>, if
7f561c08de6b Initial load
duke
parents:
diff changeset
   273
     *   <code>mode</code> is <code>MODE_SYNCHRONOUS</code> then the
7f561c08de6b Initial load
duke
parents:
diff changeset
   274
     *   <code>LSParser</code> that is created will operate in synchronous
7f561c08de6b Initial load
duke
parents:
diff changeset
   275
     *   mode, if it's <code>MODE_ASYNCHRONOUS</code> then the
7f561c08de6b Initial load
duke
parents:
diff changeset
   276
     *   <code>LSParser</code> that is created will operate in asynchronous
7f561c08de6b Initial load
duke
parents:
diff changeset
   277
     *   mode.
7f561c08de6b Initial load
duke
parents:
diff changeset
   278
     * @param schemaType  An absolute URI representing the type of the schema
7f561c08de6b Initial load
duke
parents:
diff changeset
   279
     *   language used during the load of a <code>Document</code> using the
7f561c08de6b Initial load
duke
parents:
diff changeset
   280
     *   newly created <code>LSParser</code>. Note that no lexical checking
7f561c08de6b Initial load
duke
parents:
diff changeset
   281
     *   is done on the absolute URI. In order to create a
7f561c08de6b Initial load
duke
parents:
diff changeset
   282
     *   <code>LSParser</code> for any kind of schema types (i.e. the
7f561c08de6b Initial load
duke
parents:
diff changeset
   283
     *   LSParser will be free to use any schema found), use the value
7f561c08de6b Initial load
duke
parents:
diff changeset
   284
     *   <code>null</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   285
     * <p ><b>Note:</b>    For W3C XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
7f561c08de6b Initial load
duke
parents:
diff changeset
   286
     *   , applications must use the value
7f561c08de6b Initial load
duke
parents:
diff changeset
   287
     *   <code>"http://www.w3.org/2001/XMLSchema"</code>. For XML DTD [<a href='http://www.w3.org/TR/2000/REC-xml-20001006'>XML 1.0</a>],
7f561c08de6b Initial load
duke
parents:
diff changeset
   288
     *   applications must use the value
7f561c08de6b Initial load
duke
parents:
diff changeset
   289
     *   <code>"http://www.w3.org/TR/REC-xml"</code>. Other Schema languages
7f561c08de6b Initial load
duke
parents:
diff changeset
   290
     *   are outside the scope of the W3C and therefore should recommend an
7f561c08de6b Initial load
duke
parents:
diff changeset
   291
     *   absolute URI in order to use this method.
7f561c08de6b Initial load
duke
parents:
diff changeset
   292
     * @return  The newly created <code>LSParser</code> object. This
7f561c08de6b Initial load
duke
parents:
diff changeset
   293
     *   <code>LSParser</code> is either synchronous or asynchronous
7f561c08de6b Initial load
duke
parents:
diff changeset
   294
     *   depending on the value of the <code>mode</code> argument.
7f561c08de6b Initial load
duke
parents:
diff changeset
   295
     * <p ><b>Note:</b>    By default, the newly created <code>LSParser</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   296
     *    does not contain a <code>DOMErrorHandler</code>, i.e. the value of
7f561c08de6b Initial load
duke
parents:
diff changeset
   297
     *   the "<a href='http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030609/core.html#parameter-error-handler'>
7f561c08de6b Initial load
duke
parents:
diff changeset
   298
     *   error-handler</a>" configuration parameter is <code>null</code>. However, implementations
7f561c08de6b Initial load
duke
parents:
diff changeset
   299
     *   may provide a default error handler at creation time. In that case,
7f561c08de6b Initial load
duke
parents:
diff changeset
   300
     *   the initial value of the <code>"error-handler"</code> configuration
7f561c08de6b Initial load
duke
parents:
diff changeset
   301
     *   parameter on the new created <code>LSParser</code> contains a
7f561c08de6b Initial load
duke
parents:
diff changeset
   302
     *   reference to the default error handler.
7f561c08de6b Initial load
duke
parents:
diff changeset
   303
     * @exception DOMException
7f561c08de6b Initial load
duke
parents:
diff changeset
   304
     *    NOT_SUPPORTED_ERR: Raised if the requested mode or schema type is
7f561c08de6b Initial load
duke
parents:
diff changeset
   305
     *   not supported.
7f561c08de6b Initial load
duke
parents:
diff changeset
   306
         */
7f561c08de6b Initial load
duke
parents:
diff changeset
   307
        public LSParser createLSParser(short mode, String schemaType)
7f561c08de6b Initial load
duke
parents:
diff changeset
   308
                throws DOMException {
7f561c08de6b Initial load
duke
parents:
diff changeset
   309
                if (mode != DOMImplementationLS.MODE_SYNCHRONOUS || (schemaType !=null &&
7f561c08de6b Initial load
duke
parents:
diff changeset
   310
                   !"http://www.w3.org/2001/XMLSchema".equals(schemaType) &&
7f561c08de6b Initial load
duke
parents:
diff changeset
   311
                        !"http://www.w3.org/TR/REC-xml".equals(schemaType))) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   312
                        String msg =
7f561c08de6b Initial load
duke
parents:
diff changeset
   313
                                DOMMessageFormatter.formatMessage(
7f561c08de6b Initial load
duke
parents:
diff changeset
   314
                                        DOMMessageFormatter.DOM_DOMAIN,
7f561c08de6b Initial load
duke
parents:
diff changeset
   315
                                        "NOT_SUPPORTED_ERR",
7f561c08de6b Initial load
duke
parents:
diff changeset
   316
                                        null);
7f561c08de6b Initial load
duke
parents:
diff changeset
   317
                        throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
7f561c08de6b Initial load
duke
parents:
diff changeset
   318
                }
7f561c08de6b Initial load
duke
parents:
diff changeset
   319
                if (schemaType != null
7f561c08de6b Initial load
duke
parents:
diff changeset
   320
                        && schemaType.equals("http://www.w3.org/TR/REC-xml")) {
12458
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   321
                        return new DOMParserImpl(new DTDConfiguration(),
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   322
                                schemaType);
7f561c08de6b Initial load
duke
parents:
diff changeset
   323
                }
7f561c08de6b Initial load
duke
parents:
diff changeset
   324
                else {
7f561c08de6b Initial load
duke
parents:
diff changeset
   325
                        // create default parser configuration validating against XMLSchemas
12458
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   326
                        return new DOMParserImpl(new XIncludeAwareParserConfiguration(),
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   327
                                schemaType);
7f561c08de6b Initial load
duke
parents:
diff changeset
   328
                }
7f561c08de6b Initial load
duke
parents:
diff changeset
   329
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   330
7f561c08de6b Initial load
duke
parents:
diff changeset
   331
        /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   332
         * DOM Level 3 LS CR - Experimental.
7f561c08de6b Initial load
duke
parents:
diff changeset
   333
         * Create a new <code>LSSerializer</code> object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   334
         * @return The newly created <code>LSSerializer</code> object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   335
         * <p ><b>Note:</b>    By default, the newly created
7f561c08de6b Initial load
duke
parents:
diff changeset
   336
         * <code>LSSerializer</code> has no <code>DOMErrorHandler</code>,
7f561c08de6b Initial load
duke
parents:
diff changeset
   337
         * i.e. the value of the <code>"error-handler"</code> configuration
7f561c08de6b Initial load
duke
parents:
diff changeset
   338
         * parameter is <code>null</code>. However, implementations may
7f561c08de6b Initial load
duke
parents:
diff changeset
   339
         * provide a default error handler at creation time. In that case, the
7f561c08de6b Initial load
duke
parents:
diff changeset
   340
         * initial value of the <code>"error-handler"</code> configuration
7f561c08de6b Initial load
duke
parents:
diff changeset
   341
         * parameter on the new created <code>LSSerializer</code> contains a
7f561c08de6b Initial load
duke
parents:
diff changeset
   342
         * reference to the default error handler.
7f561c08de6b Initial load
duke
parents:
diff changeset
   343
         */
7f561c08de6b Initial load
duke
parents:
diff changeset
   344
        public LSSerializer createLSSerializer() {
25834
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 25264
diff changeset
   345
            try {
31286
4c6b605ceb9f 8080266: Failed to create CharInfo due to ResourceBundle update for modules
fyuan
parents: 29948
diff changeset
   346
                return new com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl();
25834
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 25264
diff changeset
   347
            }
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 25264
diff changeset
   348
            catch (Exception e) {}
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 25264
diff changeset
   349
            // Fall back to Xerces' deprecated serializer if
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 25264
diff changeset
   350
            // the Xalan based serializer is unavailable.
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 25264
diff changeset
   351
            return new DOMSerializerImpl();
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 25264
diff changeset
   352
        }
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 25264
diff changeset
   353
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   354
        /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   355
         * DOM Level 3 LS CR - Experimental.
7f561c08de6b Initial load
duke
parents:
diff changeset
   356
         * Create a new empty input source.
7f561c08de6b Initial load
duke
parents:
diff changeset
   357
         * @return  The newly created input object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   358
         */
7f561c08de6b Initial load
duke
parents:
diff changeset
   359
        public LSInput createLSInput() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   360
                return new DOMInputImpl();
7f561c08de6b Initial load
duke
parents:
diff changeset
   361
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   362
7f561c08de6b Initial load
duke
parents:
diff changeset
   363
        //
7f561c08de6b Initial load
duke
parents:
diff changeset
   364
        // Protected methods
7f561c08de6b Initial load
duke
parents:
diff changeset
   365
        //
7f561c08de6b Initial load
duke
parents:
diff changeset
   366
        /** NON-DOM: retrieve validator. */
7f561c08de6b Initial load
duke
parents:
diff changeset
   367
        synchronized RevalidationHandler getValidator(String schemaType) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   368
                // REVISIT: implement retrieving DTD validator
7f561c08de6b Initial load
duke
parents:
diff changeset
   369
        if (schemaType == XMLGrammarDescription.XML_SCHEMA) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   370
            // create new validator - we should not attempt
7f561c08de6b Initial load
duke
parents:
diff changeset
   371
            // to restrict the number of validation handlers being
7f561c08de6b Initial load
duke
parents:
diff changeset
   372
            // requested
7f561c08de6b Initial load
duke
parents:
diff changeset
   373
            if(freeValidatorIndex < 0) {
31497
4a6b2e733c0d 8130051: Cleanup usage of reflection in jaxp
dfuchs
parents: 31286
diff changeset
   374
                return new com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator();
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   375
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
   376
            // return first available validator
7f561c08de6b Initial load
duke
parents:
diff changeset
   377
            RevalidationHandler val = validators[freeValidatorIndex];
7f561c08de6b Initial load
duke
parents:
diff changeset
   378
            validators[freeValidatorIndex--] = null;
7f561c08de6b Initial load
duke
parents:
diff changeset
   379
            return val;
7f561c08de6b Initial load
duke
parents:
diff changeset
   380
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   381
        else if(schemaType == XMLGrammarDescription.XML_DTD) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   382
            if(freeDTDValidatorIndex < 0) {
31497
4a6b2e733c0d 8130051: Cleanup usage of reflection in jaxp
dfuchs
parents: 31286
diff changeset
   383
                return new com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator();
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   384
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
   385
            // return first available validator
7f561c08de6b Initial load
duke
parents:
diff changeset
   386
            RevalidationHandler val = dtdValidators[freeDTDValidatorIndex];
7f561c08de6b Initial load
duke
parents:
diff changeset
   387
            dtdValidators[freeDTDValidatorIndex--] = null;
7f561c08de6b Initial load
duke
parents:
diff changeset
   388
            return val;
7f561c08de6b Initial load
duke
parents:
diff changeset
   389
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   390
        return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
   391
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   392
7f561c08de6b Initial load
duke
parents:
diff changeset
   393
        /** NON-DOM: release validator */
7f561c08de6b Initial load
duke
parents:
diff changeset
   394
        synchronized void releaseValidator(String schemaType,
7f561c08de6b Initial load
duke
parents:
diff changeset
   395
                                         RevalidationHandler validator) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   396
       // REVISIT: implement support for DTD validators as well
7f561c08de6b Initial load
duke
parents:
diff changeset
   397
       if(schemaType == XMLGrammarDescription.XML_SCHEMA) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   398
           ++freeValidatorIndex;
7f561c08de6b Initial load
duke
parents:
diff changeset
   399
           if (validators.length == freeValidatorIndex ){
7f561c08de6b Initial load
duke
parents:
diff changeset
   400
                // resize size of the validators
7f561c08de6b Initial load
duke
parents:
diff changeset
   401
                currentSize+=SIZE;
7f561c08de6b Initial load
duke
parents:
diff changeset
   402
                RevalidationHandler newarray[] =  new RevalidationHandler[currentSize];
7f561c08de6b Initial load
duke
parents:
diff changeset
   403
                System.arraycopy(validators, 0, newarray, 0, validators.length);
7f561c08de6b Initial load
duke
parents:
diff changeset
   404
                validators = newarray;
7f561c08de6b Initial load
duke
parents:
diff changeset
   405
           }
7f561c08de6b Initial load
duke
parents:
diff changeset
   406
           validators[freeValidatorIndex]=validator;
7f561c08de6b Initial load
duke
parents:
diff changeset
   407
       }
7f561c08de6b Initial load
duke
parents:
diff changeset
   408
       else if(schemaType == XMLGrammarDescription.XML_DTD) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   409
           ++freeDTDValidatorIndex;
7f561c08de6b Initial load
duke
parents:
diff changeset
   410
           if (dtdValidators.length == freeDTDValidatorIndex ){
7f561c08de6b Initial load
duke
parents:
diff changeset
   411
                // resize size of the validators
7f561c08de6b Initial load
duke
parents:
diff changeset
   412
                currentSize+=SIZE;
7f561c08de6b Initial load
duke
parents:
diff changeset
   413
                RevalidationHandler newarray[] =  new RevalidationHandler[currentSize];
7f561c08de6b Initial load
duke
parents:
diff changeset
   414
                System.arraycopy(dtdValidators, 0, newarray, 0, dtdValidators.length);
7f561c08de6b Initial load
duke
parents:
diff changeset
   415
                dtdValidators = newarray;
7f561c08de6b Initial load
duke
parents:
diff changeset
   416
           }
7f561c08de6b Initial load
duke
parents:
diff changeset
   417
           dtdValidators[freeDTDValidatorIndex]=validator;
7f561c08de6b Initial load
duke
parents:
diff changeset
   418
       }
7f561c08de6b Initial load
duke
parents:
diff changeset
   419
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   420
7f561c08de6b Initial load
duke
parents:
diff changeset
   421
       /** NON-DOM:  increment document/doctype counter */
7f561c08de6b Initial load
duke
parents:
diff changeset
   422
       protected synchronized int assignDocumentNumber() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   423
            return ++docAndDoctypeCounter;
7f561c08de6b Initial load
duke
parents:
diff changeset
   424
       }
7f561c08de6b Initial load
duke
parents:
diff changeset
   425
       /** NON-DOM:  increment document/doctype counter */
7f561c08de6b Initial load
duke
parents:
diff changeset
   426
       protected synchronized int assignDocTypeNumber() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   427
            return ++docAndDoctypeCounter;
7f561c08de6b Initial load
duke
parents:
diff changeset
   428
       }
7f561c08de6b Initial load
duke
parents:
diff changeset
   429
7f561c08de6b Initial load
duke
parents:
diff changeset
   430
    /* DOM Level 3 LS CR - Experimental.
7f561c08de6b Initial load
duke
parents:
diff changeset
   431
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   432
     * Create a new empty output destination object where
7f561c08de6b Initial load
duke
parents:
diff changeset
   433
     * <code>LSOutput.characterStream</code>,
7f561c08de6b Initial load
duke
parents:
diff changeset
   434
     * <code>LSOutput.byteStream</code>, <code>LSOutput.systemId</code>,
7f561c08de6b Initial load
duke
parents:
diff changeset
   435
     * <code>LSOutput.encoding</code> are null.
7f561c08de6b Initial load
duke
parents:
diff changeset
   436
7f561c08de6b Initial load
duke
parents:
diff changeset
   437
     * @return  The newly created output object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   438
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   439
       public LSOutput createLSOutput() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   440
           return new DOMOutputImpl();
7f561c08de6b Initial load
duke
parents:
diff changeset
   441
       }
7f561c08de6b Initial load
duke
parents:
diff changeset
   442
7f561c08de6b Initial load
duke
parents:
diff changeset
   443
} // class DOMImplementationImpl