You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by sa...@apache.org on 2002/06/20 20:46:35 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/serialize SerializerToXML.java

santiagopg    2002/06/20 11:46:35

  Modified:    java/src/org/apache/xalan/serialize Tag:
                        jaxp-ri-1_2_0-fcs-branch SerializerToXML.java
  Log:
  Avoid inlining the external subset of a DTD when using the built-in
  identity transform.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.12.8.1  +16 -2     xml-xalan/java/src/org/apache/xalan/serialize/SerializerToXML.java
  
  Index: SerializerToXML.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/serialize/SerializerToXML.java,v
  retrieving revision 1.12
  retrieving revision 1.12.8.1
  diff -u -r1.12 -r1.12.8.1
  --- SerializerToXML.java	5 Nov 2001 20:29:52 -0000	1.12
  +++ SerializerToXML.java	20 Jun 2002 18:46:35 -0000	1.12.8.1
  @@ -323,6 +323,9 @@
     /** Indicate whether running in Debug mode */
     private static final boolean DEBUG = false;
   
  +  /** This flag is set while receiving events from the external DTD */
  +  private boolean m_inExternalDTD = false;
  +
     /**
      * Default constructor.
      */
  @@ -1864,6 +1867,8 @@
      */
     public void startEntity(String name) throws org.xml.sax.SAXException
     {
  +    if (name.equals("[dtd]"))
  +      m_inExternalDTD = true;	
       m_inEntityRef = true;
     }
   
  @@ -1876,7 +1881,9 @@
      */
     public void endEntity(String name) throws org.xml.sax.SAXException
     {
  -    m_inEntityRef = false;
  +    if (name.equals("[dtd]")) 
  +      m_inExternalDTD = false;
  +     m_inEntityRef = false;
     }
   
     /**
  @@ -1925,7 +1932,10 @@
      */
     public void elementDecl(String name, String model) throws SAXException
     {
  -    try
  +    // Do not inline external DTD
  +    if (m_inExternalDTD) return; 
  +
  +     try
       {
         final Writer writer = m_writer;
         if (m_inDoctype)
  @@ -1975,6 +1985,8 @@
             String eName, String aName, String type, String valueDefault, String value)
               throws SAXException
     {
  +    // Do not inline external DTD
  +    if (m_inExternalDTD) return; 
   
       try
       {
  @@ -2035,6 +2047,8 @@
     public void internalEntityDecl(String name, String value)
             throws SAXException
     {
  +    // Do not inline external DTD
  +    if (m_inExternalDTD) return; 
   
       try
       {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org