You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Vadim Gritsenko <va...@verizon.net> on 2002/07/09 15:03:17 UTC

RE: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/xml IncludeXMLConsumer.java

> From: stephan@apache.org [mailto:stephan@apache.org]
> 
> stephan     2002/07/02 15:01:45
> 
>   Modified:    src/java/org/apache/cocoon/xml IncludeXMLConsumer.java
>   Log:
>   Patch applied from Sven Kitschke <ki...@web.de>, which
>   prevents comments from a DTD.

How about applying this to the 2.0.3 branch?

Does this patch solve some bug from the bugzilla? If so, entry in
changes.xml will be great.


Vadim


>   Revision  Changes    Path
>   1.8       +5 -2      xml-
> cocoon2/src/java/org/apache/cocoon/xml/IncludeXMLConsumer.java
> 
>   Index: IncludeXMLConsumer.java
>   ===================================================================
>   RCS file: /home/cvs/xml-
> cocoon2/src/java/org/apache/cocoon/xml/IncludeXMLConsumer.java,v
>   retrieving revision 1.7
>   retrieving revision 1.8
>   diff -u -r1.7 -r1.8
>   --- IncludeXMLConsumer.java	4 Jun 2002 09:27:21 -0000	1.7
>   +++ IncludeXMLConsumer.java	2 Jul 2002 22:01:45 -0000	1.8
>   @@ -82,6 +82,7 @@
>        private boolean ignoreEmptyCharacters = false;
>        private boolean ignoreRootElement = false;
>        private int     ignoreRootElementCount;
>   +    private boolean inDTD = false;
> 
>        /**
>         * Constructor
>   @@ -214,10 +215,12 @@
>        public void startDTD(String name, String public_id, String
system_id)
>        throws SAXException {
>            // Ignored
>   +        inDTD = true;
>        }
> 
>        public void endDTD() throws SAXException {
>            // Ignored
>   +        inDTD = false;
>        }
> 
>        public void startEntity(String name) throws SAXException {
>   @@ -242,7 +245,7 @@
> 
>        public void comment(char ary[], int start, int length)
>            throws SAXException {
>   -        if(lexicalHandler != null)
>   +        if(!inDTD && lexicalHandler != null)
>                lexicalHandler.comment(ary,start,length);
>        }
>    }


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


RE: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/xml IncludeXMLConsumer.java

Posted by Stephan Michels <st...@apache.org>.

On Tue, 9 Jul 2002, Vadim Gritsenko wrote:

> > From: stephan@apache.org [mailto:stephan@apache.org]
> >
> > stephan     2002/07/02 15:01:45
> >
> >   Modified:    src/java/org/apache/cocoon/xml IncludeXMLConsumer.java
> >   Log:
> >   Patch applied from Sven Kitschke <ki...@web.de>, which
> >   prevents comments from a DTD.
>
> How about applying this to the 2.0.3 branch?
>
> Does this patch solve some bug from the bugzilla? If so, entry in
> changes.xml will be great.

The patch doesn't solve my problem with the comments. I don't know why
they appear. If have more time I will look into the problem.

Stephan Michels.

>
> >   Revision  Changes    Path
> >   1.8       +5 -2      xml-
> > cocoon2/src/java/org/apache/cocoon/xml/IncludeXMLConsumer.java
> >
> >   Index: IncludeXMLConsumer.java
> >   ===================================================================
> >   RCS file: /home/cvs/xml-
> > cocoon2/src/java/org/apache/cocoon/xml/IncludeXMLConsumer.java,v
> >   retrieving revision 1.7
> >   retrieving revision 1.8
> >   diff -u -r1.7 -r1.8
> >   --- IncludeXMLConsumer.java	4 Jun 2002 09:27:21 -0000	1.7
> >   +++ IncludeXMLConsumer.java	2 Jul 2002 22:01:45 -0000	1.8
> >   @@ -82,6 +82,7 @@
> >        private boolean ignoreEmptyCharacters = false;
> >        private boolean ignoreRootElement = false;
> >        private int     ignoreRootElementCount;
> >   +    private boolean inDTD = false;
> >
> >        /**
> >         * Constructor
> >   @@ -214,10 +215,12 @@
> >        public void startDTD(String name, String public_id, String
> system_id)
> >        throws SAXException {
> >            // Ignored
> >   +        inDTD = true;
> >        }
> >
> >        public void endDTD() throws SAXException {
> >            // Ignored
> >   +        inDTD = false;
> >        }
> >
> >        public void startEntity(String name) throws SAXException {
> >   @@ -242,7 +245,7 @@
> >
> >        public void comment(char ary[], int start, int length)
> >            throws SAXException {
> >   -        if(lexicalHandler != null)
> >   +        if(!inDTD && lexicalHandler != null)
> >                lexicalHandler.comment(ary,start,length);
> >        }
> >    }
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org