jaxp/src/com/sun/org/apache/xml/internal/serializer/ToXMLSAXHandler.java
author lana
Tue, 18 Mar 2014 17:49:48 -0700
changeset 23377 2af1ddf102a4
parent 12458 d601e4bba306
permissions -rw-r--r--
Merge
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
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     6
 * Copyright 2001-2004 The Apache Software Foundation.
7f561c08de6b Initial load
duke
parents:
diff changeset
     7
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
 * Licensed under the Apache License, Version 2.0 (the "License");
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
 * you may not use this file except in compliance with the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
 * You may obtain a copy of the License at
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 *     http://www.apache.org/licenses/LICENSE-2.0
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 * Unless required by applicable law or agreed to in writing, software
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 * distributed under the License is distributed on an "AS IS" BASIS,
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 * See the License for the specific language governing permissions and
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 * limitations under the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
 * $Id: ToXMLSAXHandler.java,v 1.3 2005/09/28 13:49:08 pvedula Exp $
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
 package com.sun.org.apache.xml.internal.serializer;
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
import java.io.IOException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
import java.io.OutputStream;
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
import java.io.Writer;
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
import java.util.Properties;
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
import javax.xml.transform.Result;
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
import org.w3c.dom.Node;
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
import org.xml.sax.Attributes;
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
import org.xml.sax.ContentHandler;
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
import org.xml.sax.Locator;
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
import org.xml.sax.SAXException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
import org.xml.sax.ext.LexicalHandler;
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 * This class receives notification of SAX-like events, and with gathered
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
 * information over these calls it will invoke the equivalent SAX methods
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
 * on a handler, the ultimate xsl:output method is known to be "xml".
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
 * This class is not a public API, it is only public because it is used by Xalan.
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
 * @xsl.usage internal
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
public final class ToXMLSAXHandler extends ToSAXHandler
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
{
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
     * Keeps track of whether output escaping is currently enabled
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
     */
12458
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
    53
    protected boolean m_escapeSetting = true;
6
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
    public ToXMLSAXHandler()
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
        // default constructor (need to set content handler ASAP !)
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
        m_prefixMap = new NamespaceMappings();
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
        initCDATA();
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
     * @see Serializer#getOutputFormat()
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
    public Properties getOutputFormat()
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
        return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
     * @see Serializer#getOutputStream()
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
    public OutputStream getOutputStream()
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
        return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
     * @see Serializer#getWriter()
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
    public Writer getWriter()
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
        return null;
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
     * Do nothing for SAX.
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
    public void indent(int n) throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
     * @see DOMSerializer#serialize(Node)
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
    public void serialize(Node node) throws IOException
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
     * @see SerializationHandler#setEscaping(boolean)
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
    public boolean setEscaping(boolean escape) throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
        boolean oldEscapeSetting = m_escapeSetting;
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
        m_escapeSetting = escape;
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
        if (escape) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
            processingInstruction(Result.PI_ENABLE_OUTPUT_ESCAPING, "");
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
        } else {
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
            processingInstruction(Result.PI_DISABLE_OUTPUT_ESCAPING, "");
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
        return oldEscapeSetting;
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
     * @see Serializer#setOutputFormat(Properties)
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
    public void setOutputFormat(Properties format)
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
     * @see Serializer#setOutputStream(OutputStream)
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
    public void setOutputStream(OutputStream output)
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
     * @see Serializer#setWriter(Writer)
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
    public void setWriter(Writer writer)
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
     * @see org.xml.sax.ext.DeclHandler#attributeDecl(String, String, String, String, String)
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
    public void attributeDecl(
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
        String arg0,
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
        String arg1,
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
        String arg2,
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
        String arg3,
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
        String arg4)
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
        throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
     * @see org.xml.sax.ext.DeclHandler#elementDecl(String, String)
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
    public void elementDecl(String arg0, String arg1) throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   157
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   158
7f561c08de6b Initial load
duke
parents:
diff changeset
   159
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
     * @see org.xml.sax.ext.DeclHandler#externalEntityDecl(String, String, String)
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
    public void externalEntityDecl(String arg0, String arg1, String arg2)
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
        throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
     * @see org.xml.sax.ext.DeclHandler#internalEntityDecl(String, String)
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
    public void internalEntityDecl(String arg0, String arg1)
7f561c08de6b Initial load
duke
parents:
diff changeset
   171
        throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   172
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   173
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   174
7f561c08de6b Initial load
duke
parents:
diff changeset
   175
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   176
     * Receives notification of the end of the document.
7f561c08de6b Initial load
duke
parents:
diff changeset
   177
     * @see org.xml.sax.ContentHandler#endDocument()
7f561c08de6b Initial load
duke
parents:
diff changeset
   178
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   179
    public void endDocument() throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   180
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   181
7f561c08de6b Initial load
duke
parents:
diff changeset
   182
        flushPending();
7f561c08de6b Initial load
duke
parents:
diff changeset
   183
7f561c08de6b Initial load
duke
parents:
diff changeset
   184
        // Close output document
7f561c08de6b Initial load
duke
parents:
diff changeset
   185
        m_saxHandler.endDocument();
7f561c08de6b Initial load
duke
parents:
diff changeset
   186
7f561c08de6b Initial load
duke
parents:
diff changeset
   187
        if (m_tracer != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   188
            super.fireEndDoc();
7f561c08de6b Initial load
duke
parents:
diff changeset
   189
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   190
7f561c08de6b Initial load
duke
parents:
diff changeset
   191
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   192
     * This method is called when all the data needed for a call to the
7f561c08de6b Initial load
duke
parents:
diff changeset
   193
     * SAX handler's startElement() method has been gathered.
7f561c08de6b Initial load
duke
parents:
diff changeset
   194
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   195
    protected void closeStartTag() throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   196
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   197
7f561c08de6b Initial load
duke
parents:
diff changeset
   198
        m_elemContext.m_startTagOpen = false;
7f561c08de6b Initial load
duke
parents:
diff changeset
   199
7f561c08de6b Initial load
duke
parents:
diff changeset
   200
        final String localName = getLocalName(m_elemContext.m_elementName);
7f561c08de6b Initial load
duke
parents:
diff changeset
   201
        final String uri = getNamespaceURI(m_elemContext.m_elementName, true);
7f561c08de6b Initial load
duke
parents:
diff changeset
   202
7f561c08de6b Initial load
duke
parents:
diff changeset
   203
        // Now is time to send the startElement event
7f561c08de6b Initial load
duke
parents:
diff changeset
   204
        if (m_needToCallStartDocument)
7f561c08de6b Initial load
duke
parents:
diff changeset
   205
        {
7f561c08de6b Initial load
duke
parents:
diff changeset
   206
            startDocumentInternal();
7f561c08de6b Initial load
duke
parents:
diff changeset
   207
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   208
        m_saxHandler.startElement(uri, localName, m_elemContext.m_elementName, m_attributes);
7f561c08de6b Initial load
duke
parents:
diff changeset
   209
        // we've sent the official SAX attributes on their way,
7f561c08de6b Initial load
duke
parents:
diff changeset
   210
        // now we don't need them anymore.
7f561c08de6b Initial load
duke
parents:
diff changeset
   211
        m_attributes.clear();
7f561c08de6b Initial load
duke
parents:
diff changeset
   212
7f561c08de6b Initial load
duke
parents:
diff changeset
   213
        if(m_state != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   214
          m_state.setCurrentNode(null);
7f561c08de6b Initial load
duke
parents:
diff changeset
   215
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   216
7f561c08de6b Initial load
duke
parents:
diff changeset
   217
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   218
     * Closes ane open cdata tag, and
7f561c08de6b Initial load
duke
parents:
diff changeset
   219
     * unlike the this.endCDATA() method (from the LexicalHandler) interface,
7f561c08de6b Initial load
duke
parents:
diff changeset
   220
     * this "internal" method will send the endCDATA() call to the wrapped
7f561c08de6b Initial load
duke
parents:
diff changeset
   221
     * handler.
7f561c08de6b Initial load
duke
parents:
diff changeset
   222
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   223
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   224
    public void closeCDATA() throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   225
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   226
7f561c08de6b Initial load
duke
parents:
diff changeset
   227
        // Output closing bracket - "]]>"
7f561c08de6b Initial load
duke
parents:
diff changeset
   228
        if (m_lexHandler != null && m_cdataTagOpen) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   229
            m_lexHandler.endCDATA();
7f561c08de6b Initial load
duke
parents:
diff changeset
   230
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   231
7f561c08de6b Initial load
duke
parents:
diff changeset
   232
7f561c08de6b Initial load
duke
parents:
diff changeset
   233
        // There are no longer any calls made to
7f561c08de6b Initial load
duke
parents:
diff changeset
   234
        // m_lexHandler.startCDATA() without a balancing call to
7f561c08de6b Initial load
duke
parents:
diff changeset
   235
        // m_lexHandler.endCDATA()
7f561c08de6b Initial load
duke
parents:
diff changeset
   236
        // so we set m_cdataTagOpen to false to remember this.
7f561c08de6b Initial load
duke
parents:
diff changeset
   237
        m_cdataTagOpen = false;
7f561c08de6b Initial load
duke
parents:
diff changeset
   238
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   239
7f561c08de6b Initial load
duke
parents:
diff changeset
   240
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   241
     * @see org.xml.sax.ContentHandler#endElement(String, String, String)
7f561c08de6b Initial load
duke
parents:
diff changeset
   242
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   243
    public void endElement(String namespaceURI, String localName, String qName)
7f561c08de6b Initial load
duke
parents:
diff changeset
   244
        throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   245
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   246
        // Close any open elements etc.
7f561c08de6b Initial load
duke
parents:
diff changeset
   247
        flushPending();
7f561c08de6b Initial load
duke
parents:
diff changeset
   248
7f561c08de6b Initial load
duke
parents:
diff changeset
   249
        if (namespaceURI == null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   250
        {
7f561c08de6b Initial load
duke
parents:
diff changeset
   251
            if (m_elemContext.m_elementURI != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   252
                namespaceURI = m_elemContext.m_elementURI;
7f561c08de6b Initial load
duke
parents:
diff changeset
   253
            else
7f561c08de6b Initial load
duke
parents:
diff changeset
   254
                namespaceURI = getNamespaceURI(qName, true);
7f561c08de6b Initial load
duke
parents:
diff changeset
   255
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   256
7f561c08de6b Initial load
duke
parents:
diff changeset
   257
        if (localName == null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   258
        {
7f561c08de6b Initial load
duke
parents:
diff changeset
   259
            if (m_elemContext.m_elementLocalName != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   260
                localName = m_elemContext.m_elementLocalName;
7f561c08de6b Initial load
duke
parents:
diff changeset
   261
            else
7f561c08de6b Initial load
duke
parents:
diff changeset
   262
                localName = getLocalName(qName);
7f561c08de6b Initial load
duke
parents:
diff changeset
   263
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   264
7f561c08de6b Initial load
duke
parents:
diff changeset
   265
        m_saxHandler.endElement(namespaceURI, localName, qName);
7f561c08de6b Initial load
duke
parents:
diff changeset
   266
7f561c08de6b Initial load
duke
parents:
diff changeset
   267
        if (m_tracer != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   268
            super.fireEndElem(qName);
7f561c08de6b Initial load
duke
parents:
diff changeset
   269
7f561c08de6b Initial load
duke
parents:
diff changeset
   270
        /* Pop all namespaces at the current element depth.
7f561c08de6b Initial load
duke
parents:
diff changeset
   271
         * We are not waiting for official endPrefixMapping() calls.
7f561c08de6b Initial load
duke
parents:
diff changeset
   272
         */
7f561c08de6b Initial load
duke
parents:
diff changeset
   273
        m_prefixMap.popNamespaces(m_elemContext.m_currentElemDepth,
7f561c08de6b Initial load
duke
parents:
diff changeset
   274
            m_saxHandler);
7f561c08de6b Initial load
duke
parents:
diff changeset
   275
        m_elemContext = m_elemContext.m_prev;
7f561c08de6b Initial load
duke
parents:
diff changeset
   276
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   277
7f561c08de6b Initial load
duke
parents:
diff changeset
   278
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   279
     * @see org.xml.sax.ContentHandler#endPrefixMapping(String)
7f561c08de6b Initial load
duke
parents:
diff changeset
   280
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   281
    public void endPrefixMapping(String prefix) throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   282
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   283
        /* poping all prefix mappings should have been done
7f561c08de6b Initial load
duke
parents:
diff changeset
   284
         * in endElement() already
7f561c08de6b Initial load
duke
parents:
diff changeset
   285
         */
7f561c08de6b Initial load
duke
parents:
diff changeset
   286
         return;
7f561c08de6b Initial load
duke
parents:
diff changeset
   287
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   288
7f561c08de6b Initial load
duke
parents:
diff changeset
   289
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   290
     * @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int)
7f561c08de6b Initial load
duke
parents:
diff changeset
   291
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   292
    public void ignorableWhitespace(char[] arg0, int arg1, int arg2)
7f561c08de6b Initial load
duke
parents:
diff changeset
   293
        throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   294
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   295
        m_saxHandler.ignorableWhitespace(arg0,arg1,arg2);
7f561c08de6b Initial load
duke
parents:
diff changeset
   296
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   297
7f561c08de6b Initial load
duke
parents:
diff changeset
   298
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   299
     * @see org.xml.sax.ContentHandler#setDocumentLocator(Locator)
7f561c08de6b Initial load
duke
parents:
diff changeset
   300
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   301
    public void setDocumentLocator(Locator arg0)
7f561c08de6b Initial load
duke
parents:
diff changeset
   302
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   303
        super.setDocumentLocator(arg0);
7f561c08de6b Initial load
duke
parents:
diff changeset
   304
        m_saxHandler.setDocumentLocator(arg0);
7f561c08de6b Initial load
duke
parents:
diff changeset
   305
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   306
7f561c08de6b Initial load
duke
parents:
diff changeset
   307
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   308
     * @see org.xml.sax.ContentHandler#skippedEntity(String)
7f561c08de6b Initial load
duke
parents:
diff changeset
   309
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   310
    public void skippedEntity(String arg0) throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   311
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   312
        m_saxHandler.skippedEntity(arg0);
7f561c08de6b Initial load
duke
parents:
diff changeset
   313
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   314
7f561c08de6b Initial load
duke
parents:
diff changeset
   315
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   316
     * @see org.xml.sax.ContentHandler#startPrefixMapping(String, String)
7f561c08de6b Initial load
duke
parents:
diff changeset
   317
     * @param prefix The prefix that maps to the URI
7f561c08de6b Initial load
duke
parents:
diff changeset
   318
     * @param uri The URI for the namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
   319
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   320
    public void startPrefixMapping(String prefix, String uri)
7f561c08de6b Initial load
duke
parents:
diff changeset
   321
        throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   322
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   323
       startPrefixMapping(prefix, uri, true);
7f561c08de6b Initial load
duke
parents:
diff changeset
   324
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   325
7f561c08de6b Initial load
duke
parents:
diff changeset
   326
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   327
     * Remember the prefix/uri mapping at the current nested element depth.
7f561c08de6b Initial load
duke
parents:
diff changeset
   328
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   329
     * @see org.xml.sax.ContentHandler#startPrefixMapping(String, String)
7f561c08de6b Initial load
duke
parents:
diff changeset
   330
     * @param prefix The prefix that maps to the URI
7f561c08de6b Initial load
duke
parents:
diff changeset
   331
     * @param uri The URI for the namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
   332
     * @param shouldFlush a flag indicating if the mapping applies to the
7f561c08de6b Initial load
duke
parents:
diff changeset
   333
     * current element or an up coming child (not used).
7f561c08de6b Initial load
duke
parents:
diff changeset
   334
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   335
7f561c08de6b Initial load
duke
parents:
diff changeset
   336
    public boolean startPrefixMapping(
7f561c08de6b Initial load
duke
parents:
diff changeset
   337
        String prefix,
7f561c08de6b Initial load
duke
parents:
diff changeset
   338
        String uri,
7f561c08de6b Initial load
duke
parents:
diff changeset
   339
        boolean shouldFlush)
7f561c08de6b Initial load
duke
parents:
diff changeset
   340
        throws org.xml.sax.SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   341
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   342
7f561c08de6b Initial load
duke
parents:
diff changeset
   343
        /* Remember the mapping, and at what depth it was declared
7f561c08de6b Initial load
duke
parents:
diff changeset
   344
         * This is one greater than the current depth because these
7f561c08de6b Initial load
duke
parents:
diff changeset
   345
         * mappings will apply to the next depth. This is in
7f561c08de6b Initial load
duke
parents:
diff changeset
   346
         * consideration that startElement() will soon be called
7f561c08de6b Initial load
duke
parents:
diff changeset
   347
         */
7f561c08de6b Initial load
duke
parents:
diff changeset
   348
7f561c08de6b Initial load
duke
parents:
diff changeset
   349
        boolean pushed;
7f561c08de6b Initial load
duke
parents:
diff changeset
   350
        int pushDepth;
7f561c08de6b Initial load
duke
parents:
diff changeset
   351
        if (shouldFlush)
7f561c08de6b Initial load
duke
parents:
diff changeset
   352
        {
7f561c08de6b Initial load
duke
parents:
diff changeset
   353
            flushPending();
7f561c08de6b Initial load
duke
parents:
diff changeset
   354
            // the prefix mapping applies to the child element (one deeper)
7f561c08de6b Initial load
duke
parents:
diff changeset
   355
            pushDepth = m_elemContext.m_currentElemDepth + 1;
7f561c08de6b Initial load
duke
parents:
diff changeset
   356
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   357
        else
7f561c08de6b Initial load
duke
parents:
diff changeset
   358
        {
7f561c08de6b Initial load
duke
parents:
diff changeset
   359
            // the prefix mapping applies to the current element
7f561c08de6b Initial load
duke
parents:
diff changeset
   360
            pushDepth = m_elemContext.m_currentElemDepth;
7f561c08de6b Initial load
duke
parents:
diff changeset
   361
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   362
        pushed = m_prefixMap.pushNamespace(prefix, uri, pushDepth);
7f561c08de6b Initial load
duke
parents:
diff changeset
   363
7f561c08de6b Initial load
duke
parents:
diff changeset
   364
        if (pushed)
7f561c08de6b Initial load
duke
parents:
diff changeset
   365
        {
7f561c08de6b Initial load
duke
parents:
diff changeset
   366
            m_saxHandler.startPrefixMapping(prefix,uri);
7f561c08de6b Initial load
duke
parents:
diff changeset
   367
7f561c08de6b Initial load
duke
parents:
diff changeset
   368
            if (getShouldOutputNSAttr())
7f561c08de6b Initial load
duke
parents:
diff changeset
   369
            {
7f561c08de6b Initial load
duke
parents:
diff changeset
   370
7f561c08de6b Initial load
duke
parents:
diff changeset
   371
                      /* Brian M.: don't know if we really needto do this. The
7f561c08de6b Initial load
duke
parents:
diff changeset
   372
                       * callers of this object should have injected both
7f561c08de6b Initial load
duke
parents:
diff changeset
   373
                       * startPrefixMapping and the attributes.  We are
7f561c08de6b Initial load
duke
parents:
diff changeset
   374
                       * just covering our butt here.
7f561c08de6b Initial load
duke
parents:
diff changeset
   375
                       */
7f561c08de6b Initial load
duke
parents:
diff changeset
   376
                      String name;
7f561c08de6b Initial load
duke
parents:
diff changeset
   377
                    if (EMPTYSTRING.equals(prefix))
7f561c08de6b Initial load
duke
parents:
diff changeset
   378
                    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   379
                        name = "xmlns";
7f561c08de6b Initial load
duke
parents:
diff changeset
   380
                        addAttributeAlways(XMLNS_URI, name, name,"CDATA",uri, false);
7f561c08de6b Initial load
duke
parents:
diff changeset
   381
                    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   382
                    else
7f561c08de6b Initial load
duke
parents:
diff changeset
   383
                {
7f561c08de6b Initial load
duke
parents:
diff changeset
   384
                        if (!EMPTYSTRING.equals(uri)) // hack for XSLTC attribset16 test
7f561c08de6b Initial load
duke
parents:
diff changeset
   385
                        {                             // that maps ns1 prefix to "" URI
7f561c08de6b Initial load
duke
parents:
diff changeset
   386
                            name = "xmlns:" + prefix;
7f561c08de6b Initial load
duke
parents:
diff changeset
   387
7f561c08de6b Initial load
duke
parents:
diff changeset
   388
                            /* for something like xmlns:abc="w3.pretend.org"
7f561c08de6b Initial load
duke
parents:
diff changeset
   389
                                     *  the uri is the value, that is why we pass it in the
7f561c08de6b Initial load
duke
parents:
diff changeset
   390
                                     * value, or 5th slot of addAttributeAlways()
7f561c08de6b Initial load
duke
parents:
diff changeset
   391
                                   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   392
                            addAttributeAlways(XMLNS_URI, prefix, name,"CDATA",uri, false );
7f561c08de6b Initial load
duke
parents:
diff changeset
   393
                        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   394
                    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   395
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
   396
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   397
        return pushed;
7f561c08de6b Initial load
duke
parents:
diff changeset
   398
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   399
7f561c08de6b Initial load
duke
parents:
diff changeset
   400
7f561c08de6b Initial load
duke
parents:
diff changeset
   401
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   402
     * @see org.xml.sax.ext.LexicalHandler#comment(char[], int, int)
7f561c08de6b Initial load
duke
parents:
diff changeset
   403
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   404
    public void comment(char[] arg0, int arg1, int arg2) throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   405
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   406
        flushPending();
7f561c08de6b Initial load
duke
parents:
diff changeset
   407
        if (m_lexHandler != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   408
            m_lexHandler.comment(arg0, arg1, arg2);
7f561c08de6b Initial load
duke
parents:
diff changeset
   409
7f561c08de6b Initial load
duke
parents:
diff changeset
   410
        if (m_tracer != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   411
            super.fireCommentEvent(arg0, arg1, arg2);
7f561c08de6b Initial load
duke
parents:
diff changeset
   412
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   413
7f561c08de6b Initial load
duke
parents:
diff changeset
   414
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   415
     * @see org.xml.sax.ext.LexicalHandler#endCDATA()
7f561c08de6b Initial load
duke
parents:
diff changeset
   416
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   417
    public void endCDATA() throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   418
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   419
        /* Normally we would do somthing with this but we ignore it.
7f561c08de6b Initial load
duke
parents:
diff changeset
   420
         * The neccessary call to m_lexHandler.endCDATA() will be made
7f561c08de6b Initial load
duke
parents:
diff changeset
   421
         * in flushPending().
7f561c08de6b Initial load
duke
parents:
diff changeset
   422
         *
7f561c08de6b Initial load
duke
parents:
diff changeset
   423
         * This is so that if we get calls like these:
7f561c08de6b Initial load
duke
parents:
diff changeset
   424
         *   this.startCDATA();
7f561c08de6b Initial load
duke
parents:
diff changeset
   425
         *   this.characters(chars1, off1, len1);
7f561c08de6b Initial load
duke
parents:
diff changeset
   426
         *   this.endCDATA();
7f561c08de6b Initial load
duke
parents:
diff changeset
   427
         *   this.startCDATA();
7f561c08de6b Initial load
duke
parents:
diff changeset
   428
         *   this.characters(chars2, off2, len2);
7f561c08de6b Initial load
duke
parents:
diff changeset
   429
         *   this.endCDATA();
7f561c08de6b Initial load
duke
parents:
diff changeset
   430
         *
7f561c08de6b Initial load
duke
parents:
diff changeset
   431
         * that we will only make these calls to the wrapped handlers:
7f561c08de6b Initial load
duke
parents:
diff changeset
   432
         *
7f561c08de6b Initial load
duke
parents:
diff changeset
   433
         *   m_lexHandler.startCDATA();
7f561c08de6b Initial load
duke
parents:
diff changeset
   434
         *   m_saxHandler.characters(chars1, off1, len1);
7f561c08de6b Initial load
duke
parents:
diff changeset
   435
         *   m_saxHandler.characters(chars1, off2, len2);
7f561c08de6b Initial load
duke
parents:
diff changeset
   436
         *   m_lexHandler.endCDATA();
7f561c08de6b Initial load
duke
parents:
diff changeset
   437
         *
7f561c08de6b Initial load
duke
parents:
diff changeset
   438
         * We will merge adjacent CDATA blocks.
7f561c08de6b Initial load
duke
parents:
diff changeset
   439
         */
7f561c08de6b Initial load
duke
parents:
diff changeset
   440
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   441
7f561c08de6b Initial load
duke
parents:
diff changeset
   442
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   443
     * @see org.xml.sax.ext.LexicalHandler#endDTD()
7f561c08de6b Initial load
duke
parents:
diff changeset
   444
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   445
    public void endDTD() throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   446
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   447
        if (m_lexHandler != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   448
            m_lexHandler.endDTD();
7f561c08de6b Initial load
duke
parents:
diff changeset
   449
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   450
7f561c08de6b Initial load
duke
parents:
diff changeset
   451
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   452
     * @see org.xml.sax.ext.LexicalHandler#startEntity(String)
7f561c08de6b Initial load
duke
parents:
diff changeset
   453
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   454
    public void startEntity(String arg0) throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   455
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   456
        if (m_lexHandler != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   457
            m_lexHandler.startEntity(arg0);
7f561c08de6b Initial load
duke
parents:
diff changeset
   458
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   459
7f561c08de6b Initial load
duke
parents:
diff changeset
   460
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   461
     * @see ExtendedContentHandler#characters(String)
7f561c08de6b Initial load
duke
parents:
diff changeset
   462
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   463
    public void characters(String chars) throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   464
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   465
        final int length = chars.length();
7f561c08de6b Initial load
duke
parents:
diff changeset
   466
        if (length > m_charsBuff.length)
7f561c08de6b Initial load
duke
parents:
diff changeset
   467
        {
7f561c08de6b Initial load
duke
parents:
diff changeset
   468
            m_charsBuff = new char[length*2 + 1];
7f561c08de6b Initial load
duke
parents:
diff changeset
   469
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   470
        chars.getChars(0, length, m_charsBuff, 0);
7f561c08de6b Initial load
duke
parents:
diff changeset
   471
        this.characters(m_charsBuff, 0, length);
7f561c08de6b Initial load
duke
parents:
diff changeset
   472
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   473
7f561c08de6b Initial load
duke
parents:
diff changeset
   474
    /////////////////// from XSLTC //////////////
7f561c08de6b Initial load
duke
parents:
diff changeset
   475
    public ToXMLSAXHandler(ContentHandler handler, String encoding)
7f561c08de6b Initial load
duke
parents:
diff changeset
   476
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   477
        super(handler, encoding);
7f561c08de6b Initial load
duke
parents:
diff changeset
   478
7f561c08de6b Initial load
duke
parents:
diff changeset
   479
        initCDATA();
7f561c08de6b Initial load
duke
parents:
diff changeset
   480
        // initNamespaces();
7f561c08de6b Initial load
duke
parents:
diff changeset
   481
        m_prefixMap = new NamespaceMappings();
7f561c08de6b Initial load
duke
parents:
diff changeset
   482
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   483
7f561c08de6b Initial load
duke
parents:
diff changeset
   484
    public ToXMLSAXHandler(
7f561c08de6b Initial load
duke
parents:
diff changeset
   485
        ContentHandler handler,
7f561c08de6b Initial load
duke
parents:
diff changeset
   486
        LexicalHandler lex,
7f561c08de6b Initial load
duke
parents:
diff changeset
   487
        String encoding)
7f561c08de6b Initial load
duke
parents:
diff changeset
   488
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   489
        super(handler, lex, encoding);
7f561c08de6b Initial load
duke
parents:
diff changeset
   490
7f561c08de6b Initial load
duke
parents:
diff changeset
   491
        initCDATA();
7f561c08de6b Initial load
duke
parents:
diff changeset
   492
        //      initNamespaces();
7f561c08de6b Initial load
duke
parents:
diff changeset
   493
        m_prefixMap = new NamespaceMappings();
7f561c08de6b Initial load
duke
parents:
diff changeset
   494
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   495
7f561c08de6b Initial load
duke
parents:
diff changeset
   496
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   497
     * Start an element in the output document. This might be an XML element
7f561c08de6b Initial load
duke
parents:
diff changeset
   498
     * (<elem>data</elem> type) or a CDATA section.
7f561c08de6b Initial load
duke
parents:
diff changeset
   499
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   500
    public void startElement(
7f561c08de6b Initial load
duke
parents:
diff changeset
   501
    String elementNamespaceURI,
7f561c08de6b Initial load
duke
parents:
diff changeset
   502
    String elementLocalName,
7f561c08de6b Initial load
duke
parents:
diff changeset
   503
    String elementName) throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   504
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   505
        startElement(
7f561c08de6b Initial load
duke
parents:
diff changeset
   506
            elementNamespaceURI,elementLocalName,elementName, null);
7f561c08de6b Initial load
duke
parents:
diff changeset
   507
7f561c08de6b Initial load
duke
parents:
diff changeset
   508
7f561c08de6b Initial load
duke
parents:
diff changeset
   509
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   510
    public void startElement(String elementName) throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   511
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   512
        startElement(null, null, elementName, null);
7f561c08de6b Initial load
duke
parents:
diff changeset
   513
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   514
7f561c08de6b Initial load
duke
parents:
diff changeset
   515
7f561c08de6b Initial load
duke
parents:
diff changeset
   516
    public void characters(char[] ch, int off, int len) throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   517
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   518
        // We do the first two things in flushPending() but we don't
7f561c08de6b Initial load
duke
parents:
diff changeset
   519
        // close any open CDATA calls.
7f561c08de6b Initial load
duke
parents:
diff changeset
   520
        if (m_needToCallStartDocument)
7f561c08de6b Initial load
duke
parents:
diff changeset
   521
        {
7f561c08de6b Initial load
duke
parents:
diff changeset
   522
            startDocumentInternal();
7f561c08de6b Initial load
duke
parents:
diff changeset
   523
            m_needToCallStartDocument = false;
7f561c08de6b Initial load
duke
parents:
diff changeset
   524
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   525
7f561c08de6b Initial load
duke
parents:
diff changeset
   526
        if (m_elemContext.m_startTagOpen)
7f561c08de6b Initial load
duke
parents:
diff changeset
   527
        {
7f561c08de6b Initial load
duke
parents:
diff changeset
   528
            closeStartTag();
7f561c08de6b Initial load
duke
parents:
diff changeset
   529
            m_elemContext.m_startTagOpen = false;
7f561c08de6b Initial load
duke
parents:
diff changeset
   530
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   531
7f561c08de6b Initial load
duke
parents:
diff changeset
   532
        if (m_elemContext.m_isCdataSection && !m_cdataTagOpen
7f561c08de6b Initial load
duke
parents:
diff changeset
   533
        && m_lexHandler != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   534
        {
7f561c08de6b Initial load
duke
parents:
diff changeset
   535
            m_lexHandler.startCDATA();
7f561c08de6b Initial load
duke
parents:
diff changeset
   536
            // We have made a call to m_lexHandler.startCDATA() with
7f561c08de6b Initial load
duke
parents:
diff changeset
   537
            // no balancing call to m_lexHandler.endCDATA()
7f561c08de6b Initial load
duke
parents:
diff changeset
   538
            // so we set m_cdataTagOpen true to remember this.
7f561c08de6b Initial load
duke
parents:
diff changeset
   539
            m_cdataTagOpen = true;
7f561c08de6b Initial load
duke
parents:
diff changeset
   540
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   541
7f561c08de6b Initial load
duke
parents:
diff changeset
   542
        /* If there are any occurances of "]]>" in the character data
7f561c08de6b Initial load
duke
parents:
diff changeset
   543
         * let m_saxHandler worry about it, we've already warned them with
7f561c08de6b Initial load
duke
parents:
diff changeset
   544
         * the previous call of m_lexHandler.startCDATA();
7f561c08de6b Initial load
duke
parents:
diff changeset
   545
         */
7f561c08de6b Initial load
duke
parents:
diff changeset
   546
        m_saxHandler.characters(ch, off, len);
7f561c08de6b Initial load
duke
parents:
diff changeset
   547
7f561c08de6b Initial load
duke
parents:
diff changeset
   548
        // time to generate characters event
7f561c08de6b Initial load
duke
parents:
diff changeset
   549
        if (m_tracer != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   550
            fireCharEvent(ch, off, len);
7f561c08de6b Initial load
duke
parents:
diff changeset
   551
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   552
7f561c08de6b Initial load
duke
parents:
diff changeset
   553
7f561c08de6b Initial load
duke
parents:
diff changeset
   554
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   555
     * @see ExtendedContentHandler#endElement(String)
7f561c08de6b Initial load
duke
parents:
diff changeset
   556
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   557
    public void endElement(String elemName) throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   558
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   559
        endElement(null, null, elemName);
7f561c08de6b Initial load
duke
parents:
diff changeset
   560
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   561
7f561c08de6b Initial load
duke
parents:
diff changeset
   562
7f561c08de6b Initial load
duke
parents:
diff changeset
   563
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   564
     * Send a namespace declaration in the output document. The namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
   565
     * declaration will not be include if the namespace is already in scope
7f561c08de6b Initial load
duke
parents:
diff changeset
   566
     * with the same prefix.
7f561c08de6b Initial load
duke
parents:
diff changeset
   567
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   568
    public void namespaceAfterStartElement(
7f561c08de6b Initial load
duke
parents:
diff changeset
   569
        final String prefix,
7f561c08de6b Initial load
duke
parents:
diff changeset
   570
        final String uri)
7f561c08de6b Initial load
duke
parents:
diff changeset
   571
        throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   572
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   573
        startPrefixMapping(prefix,uri,false);
7f561c08de6b Initial load
duke
parents:
diff changeset
   574
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   575
7f561c08de6b Initial load
duke
parents:
diff changeset
   576
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   577
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   578
     * @see org.xml.sax.ContentHandler#processingInstruction(String, String)
7f561c08de6b Initial load
duke
parents:
diff changeset
   579
     * Send a processing instruction to the output document
7f561c08de6b Initial load
duke
parents:
diff changeset
   580
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   581
    public void processingInstruction(String target, String data)
7f561c08de6b Initial load
duke
parents:
diff changeset
   582
        throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   583
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   584
        flushPending();
7f561c08de6b Initial load
duke
parents:
diff changeset
   585
7f561c08de6b Initial load
duke
parents:
diff changeset
   586
        // Pass the processing instruction to the SAX handler
7f561c08de6b Initial load
duke
parents:
diff changeset
   587
        m_saxHandler.processingInstruction(target, data);
7f561c08de6b Initial load
duke
parents:
diff changeset
   588
7f561c08de6b Initial load
duke
parents:
diff changeset
   589
        // we don't want to leave serializer to fire off this event,
7f561c08de6b Initial load
duke
parents:
diff changeset
   590
        // so do it here.
7f561c08de6b Initial load
duke
parents:
diff changeset
   591
        if (m_tracer != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   592
            super.fireEscapingEvent(target, data);
7f561c08de6b Initial load
duke
parents:
diff changeset
   593
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   594
7f561c08de6b Initial load
duke
parents:
diff changeset
   595
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   596
     * Undeclare the namespace that is currently pointed to by a given
7f561c08de6b Initial load
duke
parents:
diff changeset
   597
     * prefix. Inform SAX handler if prefix was previously mapped.
7f561c08de6b Initial load
duke
parents:
diff changeset
   598
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   599
    protected boolean popNamespace(String prefix)
7f561c08de6b Initial load
duke
parents:
diff changeset
   600
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   601
        try
7f561c08de6b Initial load
duke
parents:
diff changeset
   602
        {
7f561c08de6b Initial load
duke
parents:
diff changeset
   603
            if (m_prefixMap.popNamespace(prefix))
7f561c08de6b Initial load
duke
parents:
diff changeset
   604
            {
7f561c08de6b Initial load
duke
parents:
diff changeset
   605
                m_saxHandler.endPrefixMapping(prefix);
7f561c08de6b Initial load
duke
parents:
diff changeset
   606
                return true;
7f561c08de6b Initial load
duke
parents:
diff changeset
   607
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
   608
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   609
        catch (SAXException e)
7f561c08de6b Initial load
duke
parents:
diff changeset
   610
        {
7f561c08de6b Initial load
duke
parents:
diff changeset
   611
            // falls through
7f561c08de6b Initial load
duke
parents:
diff changeset
   612
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   613
        return false;
7f561c08de6b Initial load
duke
parents:
diff changeset
   614
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   615
7f561c08de6b Initial load
duke
parents:
diff changeset
   616
    public void startCDATA() throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   617
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   618
        /* m_cdataTagOpen can only be true here if we have ignored the
7f561c08de6b Initial load
duke
parents:
diff changeset
   619
         * previous call to this.endCDATA() and the previous call
7f561c08de6b Initial load
duke
parents:
diff changeset
   620
         * this.startCDATA() before that is still "open". In this way
7f561c08de6b Initial load
duke
parents:
diff changeset
   621
         * we merge adjacent CDATA. If anything else happened after the
7f561c08de6b Initial load
duke
parents:
diff changeset
   622
         * ignored call to this.endCDATA() and this call then a call to
7f561c08de6b Initial load
duke
parents:
diff changeset
   623
         * flushPending() would have been made which would have
7f561c08de6b Initial load
duke
parents:
diff changeset
   624
         * closed the CDATA and set m_cdataTagOpen to false.
7f561c08de6b Initial load
duke
parents:
diff changeset
   625
         */
7f561c08de6b Initial load
duke
parents:
diff changeset
   626
        if (!m_cdataTagOpen )
7f561c08de6b Initial load
duke
parents:
diff changeset
   627
        {
7f561c08de6b Initial load
duke
parents:
diff changeset
   628
            flushPending();
7f561c08de6b Initial load
duke
parents:
diff changeset
   629
            if (m_lexHandler != null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   630
                m_lexHandler.startCDATA();
7f561c08de6b Initial load
duke
parents:
diff changeset
   631
7f561c08de6b Initial load
duke
parents:
diff changeset
   632
                // We have made a call to m_lexHandler.startCDATA() with
7f561c08de6b Initial load
duke
parents:
diff changeset
   633
                // no balancing call to m_lexHandler.endCDATA()
7f561c08de6b Initial load
duke
parents:
diff changeset
   634
                // so we set m_cdataTagOpen true to remember this.
7f561c08de6b Initial load
duke
parents:
diff changeset
   635
                m_cdataTagOpen = true;
7f561c08de6b Initial load
duke
parents:
diff changeset
   636
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
   637
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   638
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   639
7f561c08de6b Initial load
duke
parents:
diff changeset
   640
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   641
     * @see org.xml.sax.ContentHandler#startElement(String, String, String, Attributes)
7f561c08de6b Initial load
duke
parents:
diff changeset
   642
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   643
    public void startElement(
7f561c08de6b Initial load
duke
parents:
diff changeset
   644
    String namespaceURI,
7f561c08de6b Initial load
duke
parents:
diff changeset
   645
    String localName,
7f561c08de6b Initial load
duke
parents:
diff changeset
   646
    String name,
7f561c08de6b Initial load
duke
parents:
diff changeset
   647
    Attributes atts)
7f561c08de6b Initial load
duke
parents:
diff changeset
   648
        throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   649
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   650
        flushPending();
7f561c08de6b Initial load
duke
parents:
diff changeset
   651
        super.startElement(namespaceURI, localName, name, atts);
7f561c08de6b Initial load
duke
parents:
diff changeset
   652
7f561c08de6b Initial load
duke
parents:
diff changeset
   653
        // Handle document type declaration (for first element only)
7f561c08de6b Initial load
duke
parents:
diff changeset
   654
         if (m_needToOutputDocTypeDecl)
7f561c08de6b Initial load
duke
parents:
diff changeset
   655
         {
7f561c08de6b Initial load
duke
parents:
diff changeset
   656
             String doctypeSystem = getDoctypeSystem();
7f561c08de6b Initial load
duke
parents:
diff changeset
   657
             if (doctypeSystem != null && m_lexHandler != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   658
             {
7f561c08de6b Initial load
duke
parents:
diff changeset
   659
                 String doctypePublic = getDoctypePublic();
7f561c08de6b Initial load
duke
parents:
diff changeset
   660
                 if (doctypeSystem != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   661
                     m_lexHandler.startDTD(
7f561c08de6b Initial load
duke
parents:
diff changeset
   662
                         name,
7f561c08de6b Initial load
duke
parents:
diff changeset
   663
                         doctypePublic,
7f561c08de6b Initial load
duke
parents:
diff changeset
   664
                         doctypeSystem);
7f561c08de6b Initial load
duke
parents:
diff changeset
   665
             }
7f561c08de6b Initial load
duke
parents:
diff changeset
   666
             m_needToOutputDocTypeDecl = false;
7f561c08de6b Initial load
duke
parents:
diff changeset
   667
         }
7f561c08de6b Initial load
duke
parents:
diff changeset
   668
        m_elemContext = m_elemContext.push(namespaceURI, localName, name);
7f561c08de6b Initial load
duke
parents:
diff changeset
   669
7f561c08de6b Initial load
duke
parents:
diff changeset
   670
        // ensurePrefixIsDeclared depends on the current depth, so
7f561c08de6b Initial load
duke
parents:
diff changeset
   671
        // the previous increment is necessary where it is.
7f561c08de6b Initial load
duke
parents:
diff changeset
   672
        if (namespaceURI != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   673
            ensurePrefixIsDeclared(namespaceURI, name);
7f561c08de6b Initial load
duke
parents:
diff changeset
   674
7f561c08de6b Initial load
duke
parents:
diff changeset
   675
        // add the attributes to the collected ones
7f561c08de6b Initial load
duke
parents:
diff changeset
   676
        if (atts != null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   677
            addAttributes(atts);
7f561c08de6b Initial load
duke
parents:
diff changeset
   678
7f561c08de6b Initial load
duke
parents:
diff changeset
   679
7f561c08de6b Initial load
duke
parents:
diff changeset
   680
        // do we really need this CDATA section state?
7f561c08de6b Initial load
duke
parents:
diff changeset
   681
        m_elemContext.m_isCdataSection = isCdataSection();
7f561c08de6b Initial load
duke
parents:
diff changeset
   682
7f561c08de6b Initial load
duke
parents:
diff changeset
   683
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   684
7f561c08de6b Initial load
duke
parents:
diff changeset
   685
    private void ensurePrefixIsDeclared(String ns, String rawName)
7f561c08de6b Initial load
duke
parents:
diff changeset
   686
        throws org.xml.sax.SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   687
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   688
7f561c08de6b Initial load
duke
parents:
diff changeset
   689
        if (ns != null && ns.length() > 0)
7f561c08de6b Initial load
duke
parents:
diff changeset
   690
        {
7f561c08de6b Initial load
duke
parents:
diff changeset
   691
            int index;
7f561c08de6b Initial load
duke
parents:
diff changeset
   692
            final boolean no_prefix = ((index = rawName.indexOf(":")) < 0);
7f561c08de6b Initial load
duke
parents:
diff changeset
   693
            String prefix = (no_prefix) ? "" : rawName.substring(0, index);
7f561c08de6b Initial load
duke
parents:
diff changeset
   694
7f561c08de6b Initial load
duke
parents:
diff changeset
   695
7f561c08de6b Initial load
duke
parents:
diff changeset
   696
            if (null != prefix)
7f561c08de6b Initial load
duke
parents:
diff changeset
   697
            {
7f561c08de6b Initial load
duke
parents:
diff changeset
   698
                String foundURI = m_prefixMap.lookupNamespace(prefix);
7f561c08de6b Initial load
duke
parents:
diff changeset
   699
7f561c08de6b Initial load
duke
parents:
diff changeset
   700
                if ((null == foundURI) || !foundURI.equals(ns))
7f561c08de6b Initial load
duke
parents:
diff changeset
   701
                {
7f561c08de6b Initial load
duke
parents:
diff changeset
   702
                    this.startPrefixMapping(prefix, ns, false);
7f561c08de6b Initial load
duke
parents:
diff changeset
   703
7f561c08de6b Initial load
duke
parents:
diff changeset
   704
                    if (getShouldOutputNSAttr()) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   705
                        // Bugzilla1133: Generate attribute as well as namespace event.
7f561c08de6b Initial load
duke
parents:
diff changeset
   706
                        // SAX does expect both.
7f561c08de6b Initial load
duke
parents:
diff changeset
   707
                        this.addAttributeAlways(
7f561c08de6b Initial load
duke
parents:
diff changeset
   708
                            "http://www.w3.org/2000/xmlns/",
7f561c08de6b Initial load
duke
parents:
diff changeset
   709
                            no_prefix ? "xmlns" : prefix,  // local name
7f561c08de6b Initial load
duke
parents:
diff changeset
   710
                            no_prefix ? "xmlns" : ("xmlns:"+ prefix), // qname
7f561c08de6b Initial load
duke
parents:
diff changeset
   711
                            "CDATA",
7f561c08de6b Initial load
duke
parents:
diff changeset
   712
                            ns,
7f561c08de6b Initial load
duke
parents:
diff changeset
   713
                            false);
7f561c08de6b Initial load
duke
parents:
diff changeset
   714
                    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   715
                }
7f561c08de6b Initial load
duke
parents:
diff changeset
   716
7f561c08de6b Initial load
duke
parents:
diff changeset
   717
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
   718
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   719
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   720
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   721
     * Adds the given attribute to the set of attributes, and also makes sure
7f561c08de6b Initial load
duke
parents:
diff changeset
   722
     * that the needed prefix/uri mapping is declared, but only if there is a
7f561c08de6b Initial load
duke
parents:
diff changeset
   723
     * currently open element.
7f561c08de6b Initial load
duke
parents:
diff changeset
   724
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   725
     * @param uri the URI of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   726
     * @param localName the local name of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   727
     * @param rawName    the qualified name of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   728
     * @param type the type of the attribute (probably CDATA)
7f561c08de6b Initial load
duke
parents:
diff changeset
   729
     * @param value the value of the attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   730
     * @param XSLAttribute true if this attribute is coming from an xsl:attribute element
7f561c08de6b Initial load
duke
parents:
diff changeset
   731
     * @see ExtendedContentHandler#addAttribute(String, String, String, String, String)
7f561c08de6b Initial load
duke
parents:
diff changeset
   732
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   733
    public void addAttribute(
7f561c08de6b Initial load
duke
parents:
diff changeset
   734
        String uri,
7f561c08de6b Initial load
duke
parents:
diff changeset
   735
        String localName,
7f561c08de6b Initial load
duke
parents:
diff changeset
   736
        String rawName,
7f561c08de6b Initial load
duke
parents:
diff changeset
   737
        String type,
7f561c08de6b Initial load
duke
parents:
diff changeset
   738
        String value,
7f561c08de6b Initial load
duke
parents:
diff changeset
   739
        boolean XSLAttribute)
7f561c08de6b Initial load
duke
parents:
diff changeset
   740
        throws SAXException
7f561c08de6b Initial load
duke
parents:
diff changeset
   741
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   742
        if (m_elemContext.m_startTagOpen)
7f561c08de6b Initial load
duke
parents:
diff changeset
   743
        {
7f561c08de6b Initial load
duke
parents:
diff changeset
   744
            ensurePrefixIsDeclared(uri, rawName);
7f561c08de6b Initial load
duke
parents:
diff changeset
   745
            addAttributeAlways(uri, localName, rawName, type, value, false);
7f561c08de6b Initial load
duke
parents:
diff changeset
   746
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   747
7f561c08de6b Initial load
duke
parents:
diff changeset
   748
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   749
7f561c08de6b Initial load
duke
parents:
diff changeset
   750
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   751
     * Try's to reset the super class and reset this class for
7f561c08de6b Initial load
duke
parents:
diff changeset
   752
     * re-use, so that you don't need to create a new serializer
7f561c08de6b Initial load
duke
parents:
diff changeset
   753
     * (mostly for performance reasons).
7f561c08de6b Initial load
duke
parents:
diff changeset
   754
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   755
     * @return true if the class was successfuly reset.
7f561c08de6b Initial load
duke
parents:
diff changeset
   756
     * @see Serializer#reset()
7f561c08de6b Initial load
duke
parents:
diff changeset
   757
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   758
    public boolean reset()
7f561c08de6b Initial load
duke
parents:
diff changeset
   759
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   760
        boolean wasReset = false;
7f561c08de6b Initial load
duke
parents:
diff changeset
   761
        if (super.reset())
7f561c08de6b Initial load
duke
parents:
diff changeset
   762
        {
7f561c08de6b Initial load
duke
parents:
diff changeset
   763
            resetToXMLSAXHandler();
7f561c08de6b Initial load
duke
parents:
diff changeset
   764
            wasReset = true;
7f561c08de6b Initial load
duke
parents:
diff changeset
   765
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   766
        return wasReset;
7f561c08de6b Initial load
duke
parents:
diff changeset
   767
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   768
7f561c08de6b Initial load
duke
parents:
diff changeset
   769
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   770
     * Reset all of the fields owned by ToXMLSAXHandler class
7f561c08de6b Initial load
duke
parents:
diff changeset
   771
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   772
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   773
    private void resetToXMLSAXHandler()
7f561c08de6b Initial load
duke
parents:
diff changeset
   774
    {
12458
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   775
        this.m_escapeSetting = true;
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   776
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   777
7f561c08de6b Initial load
duke
parents:
diff changeset
   778
}