< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/SerializerBase.java

Print this page

        

*** 91,103 **** * from the SAX attributes in a startElement() call. */ protected AttributesImplSerializer m_attributes = new AttributesImplSerializer(); /** ! * Tells if we're in an EntityRef event. */ ! protected boolean m_inEntityRef = false; /** This flag is set while receiving events from the external DTD */ protected boolean m_inExternalDTD = false; /** --- 91,105 ---- * from the SAX attributes in a startElement() call. */ protected AttributesImplSerializer m_attributes = new AttributesImplSerializer(); /** ! * Tells if we're in an EntityRef event, true if it's greater than 0. Use ! * integer type to handle nested entity reference, increase m_inEntityRef in ! * startEntity, decrease m_inEntityRef in endEntity. */ ! protected int m_inEntityRef = 0; /** This flag is set while receiving events from the external DTD */ protected boolean m_inExternalDTD = false; /**
*** 142,152 **** protected boolean m_doIndent = false; /** * Amount to indent. */ ! protected int m_indentAmount = 0; /** * Tells the XML version, for writing out to the XML decl. */ protected String m_version = null; --- 144,154 ---- protected boolean m_doIndent = false; /** * Amount to indent. */ ! protected int m_indentAmount = 4; /** * Tells the XML version, for writing out to the XML decl. */ protected String m_version = null;
*** 442,458 **** * @see #startEntity */ public void endEntity(String name) throws org.xml.sax.SAXException { if (name.equals("[dtd]")) m_inExternalDTD = false; ! m_inEntityRef = false; if (m_tracer != null) this.fireEndEntity(name); } /** * Flush and close the underlying java.io.Writer. This method applies to * ToStream serializers, not ToSAXHandler serializers. * @see ToStream */ public void close() { --- 444,472 ---- * @see #startEntity */ public void endEntity(String name) throws org.xml.sax.SAXException { if (name.equals("[dtd]")) m_inExternalDTD = false; ! ! if (!m_inExternalDTD) ! m_inEntityRef--; if (m_tracer != null) this.fireEndEntity(name); } /** + * This method checks if current node is in entity reference. + * + * @return True if current node is in entity reference. + */ + protected boolean isInEntityRef() + { + return m_inEntityRef > 0; + } + + /** * Flush and close the underlying java.io.Writer. This method applies to * ToStream serializers, not ToSAXHandler serializers. * @see ToStream */ public void close() {
*** 1137,1148 **** this.m_StringOfCDATASections = null; this.m_elemContext = new ElemContext(); this.m_doctypePublic = null; this.m_doctypeSystem = null; this.m_doIndent = false; ! this.m_indentAmount = 0; ! this.m_inEntityRef = false; this.m_inExternalDTD = false; this.m_mediatype = null; this.m_needToCallStartDocument = true; this.m_needToOutputDocTypeDecl = false; if (this.m_prefixMap != null) --- 1151,1162 ---- this.m_StringOfCDATASections = null; this.m_elemContext = new ElemContext(); this.m_doctypePublic = null; this.m_doctypeSystem = null; this.m_doIndent = false; ! this.m_indentAmount = 4; ! this.m_inEntityRef = 0; this.m_inExternalDTD = false; this.m_mediatype = null; this.m_needToCallStartDocument = true; this.m_needToOutputDocTypeDecl = false; if (this.m_prefixMap != null)
< prev index next >