cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcu...@apache.org
Subject cvs commit: cocoon-2.1 status.xml
Date Thu, 08 Jul 2004 07:22:35 GMT
tcurdt      2004/07/08 00:22:35

  Modified:    src/java/org/apache/cocoon/transformation
                        CIncludeTransformer.java
               .        status.xml
  Log:
  fixes bug 29935 due to Leszek Gawron (ouzo@wlkp.org)
  added support for stripping root elements in the CIncludeTransformer
  
  Revision  Changes    Path
  1.13      +12 -2     cocoon-2.1/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java
  
  Index: CIncludeTransformer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- CIncludeTransformer.java	17 Jun 2004 14:55:24 -0000	1.12
  +++ CIncludeTransformer.java	8 Jul 2004 07:22:33 -0000	1.13
  @@ -31,6 +31,7 @@
   import org.apache.cocoon.xml.IncludeXMLConsumer;
   import org.apache.cocoon.xml.XMLConsumer;
   import org.apache.cocoon.xml.XMLUtils;
  +import org.apache.commons.lang.StringUtils;
   import org.apache.excalibur.source.Source;
   import org.apache.excalibur.source.SourceException;
   import org.apache.excalibur.source.SourceParameters;
  @@ -134,6 +135,7 @@
       public static final String CINCLUDE_INCLUDE_ELEMENT_SELECT_ATTRIBUTE = "select";
       public static final String CINCLUDE_INCLUDE_ELEMENT_NS_ATTRIBUTE = "ns";
       public static final String CINCLUDE_INCLUDE_ELEMENT_PREFIX_ATTRIBUTE = "prefix";
  +    public static final String CINCLUDE_INCLUDE_ELEMENT_STRIP_ROOT_ATTRIBUTE = "strip-root";
   
       public static final String CINCLUDE_INCLUDEXML_ELEMENT    = "includexml";
       public static final String CINCLUDE_INCLUDEXML_ELEMENT_IGNORE_ERRORS_ATTRIBUTE = "ignoreErrors";
  @@ -253,11 +255,15 @@
       throws ProcessingException ,IOException, SAXException {
           if (name.equals(CINCLUDE_INCLUDE_ELEMENT)) {
   
  +            String stripRootValue = attr.getValue("",CINCLUDE_INCLUDE_ELEMENT_STRIP_ROOT_ATTRIBUTE);

  +            boolean stripRoot = StringUtils.equals( stripRootValue, "true" );
  +            
               this.processCIncludeElement(attr.getValue("",CINCLUDE_INCLUDE_ELEMENT_SRC_ATTRIBUTE),
                                           attr.getValue("",CINCLUDE_INCLUDE_ELEMENT_ELEMENT_ATTRIBUTE),
                                           attr.getValue("",CINCLUDE_INCLUDE_ELEMENT_SELECT_ATTRIBUTE),
                                           attr.getValue("",CINCLUDE_INCLUDE_ELEMENT_NS_ATTRIBUTE),
                                           attr.getValue("",CINCLUDE_INCLUDE_ELEMENT_PREFIX_ATTRIBUTE),
  +                                        stripRoot, 
                                           false);
   
           // Element: include
  @@ -311,6 +317,7 @@
                                                       null,
                                                       null,
                                                       null,
  +                                                    false,
                                                       this.cacheManager != null);
              if (this.compiling) {
                  this.srcAttributes.addAttribute("", CINCLUDE_INCLUDE_ELEMENT_SRC_ATTRIBUTE,
CINCLUDE_SRC_ELEMENT, "CDATA", src);
  @@ -458,7 +465,8 @@
   
       protected String processCIncludeElement(String src, String element,
                                               String select, String ns, String prefix,
  -                                            boolean cache)
  +                                            boolean stripRoot,
  +                                            boolean cache )
       throws SAXException, IOException {
   
           if (src == null) {
  @@ -476,6 +484,7 @@
                             + ", select=" + select
                             + ", ns=" + ns
                             + ", prefix=" + prefix
  +                          + ", stripRoot=" + stripRoot
                             + ", caching="+cache);
           }
   
  @@ -542,6 +551,7 @@
                   if ( this.compiling ) {
                       SourceUtil.toSAX(source, mimeType, new IncludeXMLConsumer(this.contentHandler,
this.lexicalHandler));
                   } else {
  +                    this.filter.setIgnoreRootElement( stripRoot );
                       SourceUtil.toSAX(source, mimeType, this.filter);
                   }
               }
  
  
  
  1.388     +4 -1      cocoon-2.1/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/status.xml,v
  retrieving revision 1.387
  retrieving revision 1.388
  diff -u -r1.387 -r1.388
  --- status.xml	7 Jul 2004 07:58:47 -0000	1.387
  +++ status.xml	8 Jul 2004 07:22:34 -0000	1.388
  @@ -204,6 +204,9 @@
   
     <changes>
    <release version="@version@" date="@date@">
  +   <action dev="TC" type="add" fixes-bug="29935" due-to="Leszek Gawron" due-to-email="ouzo@wlkp.org">
  +    added support for stripping root elements in the CIncludeTransformer
  +   <action>
      <action dev="CZ" type="add">
        New getSitemapPath() method on the Request object to get the path to the
        current sitemap even if you are in a sub sitemap. Added an abstract request
  
  
  

Mime
View raw message