jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/ToXMLStream.java
--- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/ToXMLStream.java Fri Dec 16 08:18:05 2016 +0000
+++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/ToXMLStream.java Mon Dec 19 11:13:32 2016 +0800
@@ -1,15 +1,15 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2014, 2016 Oracle and/or its affiliates. All rights reserved.
*/
/*
- * Copyright 2001-2004 The Apache Software Foundation.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,9 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/*
- * $Id: ToXMLStream.java,v 1.2.4.2 2005/09/15 12:01:25 suresh_emailid Exp $
- */
+
package com.sun.org.apache.xml.internal.serializer;
import java.io.IOException;
@@ -92,6 +90,12 @@
m_ispreserve = xmlListener.m_ispreserve;
m_preserves = xmlListener.m_preserves;
+ m_ispreserveSpace = xmlListener.m_ispreserveSpace;
+ m_preserveSpaces = xmlListener.m_preserveSpaces;
+ m_childNodeNum = xmlListener.m_childNodeNum;
+ m_childNodeNumStack = xmlListener.m_childNodeNumStack;
+ m_charactersBuffer = xmlListener.m_charactersBuffer;
+ m_inEntityRef = xmlListener.m_inEntityRef;
m_isprevtext = xmlListener.m_isprevtext;
m_doIndent = xmlListener.m_doIndent;
setIndentAmount(xmlListener.getIndentAmount());
@@ -124,7 +128,7 @@
super.startDocumentInternal();
m_needToCallStartDocument = false;
- if (m_inEntityRef)
+ if (isInEntityRef())
return;
m_needToOutputDocTypeDecl = true;
@@ -197,6 +201,7 @@
*/
public void endDocument() throws org.xml.sax.SAXException
{
+ flushCharactersBuffer();
flushPending();
if (m_doIndent && !m_isprevtext)
{
@@ -265,9 +270,11 @@
public void processingInstruction(String target, String data)
throws org.xml.sax.SAXException
{
- if (m_inEntityRef)
+ if (isInEntityRef())
return;
+ m_childNodeNum++;
+ flushCharactersBuffer();
flushPending();
if (target.equals(Result.PI_DISABLE_OUTPUT_ESCAPING))