cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From step...@apache.org
Subject cvs commit: cocoon-2.1/src/test/org/apache/cocoon/xml WhitespaceFilter.java
Date Thu, 17 Apr 2003 07:32:02 GMT
stephan     2003/04/17 00:32:02

  Modified:    src/test/org/apache/cocoon/xml WhitespaceFilter.java
  Log:
  Fixed wrong behaviour in non mixed content nodes.
  
  Revision  Changes    Path
  1.3       +45 -24    cocoon-2.1/src/test/org/apache/cocoon/xml/WhitespaceFilter.java
  
  Index: WhitespaceFilter.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/test/org/apache/cocoon/xml/WhitespaceFilter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- WhitespaceFilter.java	9 Apr 2003 11:12:20 -0000	1.2
  +++ WhitespaceFilter.java	17 Apr 2003 07:32:02 -0000	1.3
  @@ -77,12 +77,6 @@
   
       /**
        * Receive notification of character data.
  -     *
  -     * @param c The characters from the XML document.
  -     * @param start The start position in the array.
  -     * @param len The number of characters to read from the array.
  -     *
  -     * @throws SAXException
        */
       public void characters(char c[], int start, int len) throws SAXException {
           if (contentHandler==null) {
  @@ -98,12 +92,6 @@
   
       /**
        * Receive notification of ignorable whitespace in element content.
  -     *
  -     * @param c The characters from the XML document.
  -     * @param start The start position in the array.
  -     * @param len The number of characters to read from the array.
  -     *
  -     * @throws SAXException
        */
       public void ignorableWhitespace(char c[], int start,
                                       int len) throws SAXException {
  @@ -111,18 +99,53 @@
       }
   
       /**
  -   * Receive notification of the beginning of an element.
  -   *
  -   * @param namespaceURI
  -   * @param localName
  -   * @param qName
  -   * @param atts
  -   *
  -   * @throws SAXException
  -   */
  +     * Receive notification of the beginning of an element.
  +     */
       public void startElement(String namespaceURI, String localName,
                                String qName,
                                Attributes atts) throws SAXException {
  +
  +        pushText();      
  +        contentHandler.startElement(namespaceURI, localName, qName, atts);
  +    }
  +
  +    /**
  +     * Receive notification of the end of an element.
  +     */
  +    public void endElement(String uri, String loc, String raw)
  +        throws SAXException {
  +
  +        pushText();
  +        contentHandler.endElement(uri, loc, raw);        
  +    }
  +
  +    /**
  +     * Receive notification of a processing instruction.
  +     */
  +    public void processingInstruction(String target, String data)
  +        throws SAXException {
  +
  +        pushText();
  +        contentHandler.processingInstruction(target, data);
  +    }
  +
  +    /**
  +     * Report an XML comment anywhere in the document.
  +     *
  +     * @param ch An array holding the characters in the comment.
  +     * @param start The starting position in the array.
  +     * @param len The number of characters to use from the array.
  +     */
  +    public void comment(char ch[], int start, int len)
  +        throws SAXException {
  +  
  +        pushText();
  +        super.comment(ch, start, len);
  +    }
  +
  +
  +    public void pushText() throws SAXException {
  +
           if (buffer!=null) {
               String text = buffer.toString();
   
  @@ -137,7 +160,5 @@
   
               buffer = null;
           }
  -
  -        contentHandler.startElement(namespaceURI, localName, qName, atts);
       }
   }
  
  
  

Mime
View raw message