You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by jo...@apache.org on 2004/03/09 01:57:27 UTC

cvs commit: cocoon-2.2/src/java/org/apache/cocoon/transformation FilterTransformer.java

joerg       2004/03/08 16:57:27

  Modified:    .        status.xml
               src/java/org/apache/cocoon/transformation
                        FilterTransformer.java
  Log:
  fixed bug 27301: Fix namespace handling in FilterTransformer.
  
  Revision  Changes    Path
  1.188     +7 -1      cocoon-2.2/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/status.xml,v
  retrieving revision 1.187
  retrieving revision 1.188
  diff -u -r1.187 -r1.188
  --- status.xml	8 Mar 2004 23:34:12 -0000	1.187
  +++ status.xml	9 Mar 2004 00:57:27 -0000	1.188
  @@ -189,6 +189,12 @@
   
     <changes>
    <release version="@version@" date="@date@">
  +   <action dev="JH" type="fix" fixes-bug="13904" due-to="Bernhard Huber" due-to-email="huber@apache.org">
  +     Ported fix from 2.1 to FilterTransformer.
  +   </action>
  +   <action dev="JH" type="fix" fixes-bug="27301">
  +     Fix namespace handling in FilterTransformer.
  +   </action>
      <action dev="JH" type="add" fixes-bug="27020" due-to="Peter Horsfield" due-to-email="peter@xml.grumpykitty.biz">
        Added grayscaling and color transformation to the ImageReader.
      </action>
  
  
  
  1.4       +11 -6     cocoon-2.2/src/java/org/apache/cocoon/transformation/FilterTransformer.java
  
  Index: FilterTransformer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/transformation/FilterTransformer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FilterTransformer.java	8 Mar 2004 14:03:31 -0000	1.3
  +++ FilterTransformer.java	9 Mar 2004 00:57:27 -0000	1.4
  @@ -127,12 +127,17 @@
               if (this.currentBlocknr != (int)Math.ceil((float)this.counter/this.count)) {
                   this.currentBlocknr = (int)Math.ceil((float)this.counter/this.count);
                   AttributesImpl attr = new AttributesImpl();
  -                attr.addAttribute(uri, BLOCKID, BLOCKID,"CDATA",String.valueOf(this.currentBlocknr));
  +                attr.addAttribute("", BLOCKID, BLOCKID, "CDATA", String.valueOf(this.currentBlocknr));
                   if (this.counter < this.count)  {
  -                    super.contentHandler.startElement(uri, BLOCK, BLOCK, attr);
  +                    super.contentHandler.startElement("", BLOCK, BLOCK, attr);
                   } else  {
  -                    super.contentHandler.endElement(uri, BLOCK, BLOCK);
  -                    super.contentHandler.startElement(uri, BLOCK, BLOCK, attr);
  +                    // fix Bugzilla Bug 13904, check if counter == 1
  +                    // in this case there is no startElement( uri, BLOCK, BLOCK)
  +                    // written, yet
  +                    if (this.counter > 1) {
  +                        super.contentHandler.endElement(uri, BLOCK, BLOCK);
  +                    }
  +                    super.contentHandler.startElement("", BLOCK, BLOCK, attr);
                   }
               }
           } else if (!this.foundIt)  {
  @@ -150,7 +155,7 @@
               // <parent>
               //   <element>
               //     <parent>
  -            super.contentHandler.endElement(uri, BLOCK, BLOCK);
  +            super.contentHandler.endElement("", BLOCK, BLOCK);
               super.contentHandler.endElement(uri, name, raw);
               this.foundIt = false;
               this.skip = false;