You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by ha...@apache.org on 2003/12/06 21:00:11 UTC

cvs commit: cocoon-2.1/src/java/org/apache/cocoon/transformation SimpleFormTransformer.java

haul        2003/12/06 12:00:11

  Modified:    src/java/org/apache/cocoon/transformation
                        SimpleFormTransformer.java
  Log:
  fix missing counting up for nested startElement events when skipping
  
  Revision  Changes    Path
  1.10      +15 -10    cocoon-2.1/src/java/org/apache/cocoon/transformation/SimpleFormTransformer.java
  
  Index: SimpleFormTransformer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/transformation/SimpleFormTransformer.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- SimpleFormTransformer.java	15 Nov 2003 04:21:30 -0000	1.9
  +++ SimpleFormTransformer.java	6 Dec 2003 20:00:10 -0000	1.10
  @@ -1171,7 +1171,7 @@
        * so that only the children are skipped.
        * 
        * @param skip
  -     * @param children 
  +     * @param skipChildrenOnly 
        * @param uri
        * @param name
        * @param raw
  @@ -1180,26 +1180,31 @@
        */
       protected void relayStartElement(
           boolean skip,
  -        boolean children,
  +        boolean skipChildrenOnly,
           String uri,
           String name,
           String raw,
           Attributes attr)
           throws SAXException {
   
  -        if (skip)
  -            this.skipChildrenOnly = children;
  -        if (skip && !children)
  -            this.ignoreEventsCount++;
           try {
  -            super.startTransformingElement(uri, name, raw, attr);
  +            if (this.ignoreEventsCount > 0) {
  +                this.ignoreEventsCount++;
  +                super.startTransformingElement(uri, name, raw, attr);
  +            } else {
  +                if (skip)
  +                    this.skipChildrenOnly = skipChildrenOnly;
  +                if (skip && !skipChildrenOnly)
  +                    this.ignoreEventsCount++;
  +                super.startTransformingElement(uri, name, raw, attr);
  +                if (skip && skipChildrenOnly)
  +                    this.ignoreEventsCount++;
  +            }
           } catch (ProcessingException e) {
               throw new SAXException(e);
           } catch (IOException e) {
               throw new SAXException(e);
           }
  -        if (skip && children)
  -            this.ignoreEventsCount++;
       }
   
       /**