garyp       01/08/12 22:28:50

  Modified:    java/src/org/apache/xml/dtm/ref/sax2dtm SAX2DTM.java
  Log:
  Fix bugzilla bug 3056 
(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3056).  SAX2DTM now keeps 
track if it is receiving events inside a DTD and ignores comment events when 
inside the DTD.
  
  Revision  Changes    Path
  1.16      +8 -2      
xml-xalan/java/src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
  
  Index: SAX2DTM.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- SAX2DTM.java      2001/08/09 17:13:15     1.15
  +++ SAX2DTM.java      2001/08/13 05:28:50     1.16
  @@ -142,6 +142,9 @@
     /** The SAX Document locator */
     transient private Locator m_locator = null;
   
  +  /** We are inside the DTD.  This is used for ignoring comments.  */
  +  transient private boolean m_insideDTD = false;
  +
     /** Tree Walker for dispatchToEvents. */
     protected DTMTreeWalker m_walker = new DTMTreeWalker();
   
  @@ -2096,7 +2099,7 @@
             throws SAXException
     {
   
  -    // no op
  +    m_insideDTD = true;
     }
   
     /**
  @@ -2108,7 +2111,7 @@
     public void endDTD() throws SAXException
     {
   
  -    // no op
  +    m_insideDTD = false;
     }
   
     /**
  @@ -2192,6 +2195,9 @@
      */
     public void comment(char ch[], int start, int length) throws SAXException
     {
  +
  +    if (m_insideDTD)      // ignore comments if we're inside the DTD
  +      return;
   
       charactersFlush();
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to