You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by sb...@apache.org on 2001/02/08 21:02:45 UTC
cvs commit: xml-xalan/java/src/org/apache/xalan/stree SourceTreeHandler.java
sboag 01/02/08 12:02:42
Modified: java/src/org/apache/xalan/stree SourceTreeHandler.java
Log:
Fix bug reported by Jason Harrop <jh...@bigpond.net.au>
02/07/2001 08:12 PM
Don't process comment or whitespace events if inside a startDTD/endDTD
event.
Revision Changes Path
1.34 +12 -0 xml-xalan/java/src/org/apache/xalan/stree/SourceTreeHandler.java
Index: SourceTreeHandler.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/stree/SourceTreeHandler.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- SourceTreeHandler.java 2001/01/29 11:49:07 1.33
+++ SourceTreeHandler.java 2001/02/08 20:02:34 1.34
@@ -330,6 +330,7 @@
synchronized (m_root)
{
+ m_inDTD = false;
m_root.setSourceTreeHandler(this);
m_root.setUid(1);
m_root.setLevel(new Integer(1).shortValue());
@@ -599,6 +600,9 @@
*/
public void characters(char ch[], int start, int length) throws org.xml.sax.SAXException
{
+ if(m_inDTD)
+ return;
+
if(DEBUG)
{
System.out.print("SourceTreeHandler#characters: ");
@@ -657,6 +661,8 @@
public void ignorableWhitespace(char ch[], int start, int length)
throws org.xml.sax.SAXException
{
+ if(m_inDTD)
+ return;
synchronized (m_root)
{
@@ -703,6 +709,8 @@
*/
public void comment(char ch[], int start, int length) throws org.xml.sax.SAXException
{
+ if(m_inDTD)
+ return;
synchronized (m_root)
{
@@ -758,6 +766,8 @@
notifyWaiters();
}
+
+ private boolean m_inDTD = false;
/**
* Report the start of DTD declarations, if any.
@@ -779,6 +789,7 @@
public void startDTD(String name, String publicId, String systemId)
throws org.xml.sax.SAXException
{
+ m_inDTD = true;
if (m_root instanceof DocumentImpl)
{
DocumentImpl doc = ((DocumentImpl)m_root);
@@ -795,6 +806,7 @@
*/
public void endDTD() throws org.xml.sax.SAXException
{
+ m_inDTD = false;
}
/**