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/tools/src blocks-build.xsl
Date Mon, 26 May 2003 08:44:30 GMT
stephan     2003/05/26 01:44:30

  Modified:    src/test/org/apache/cocoon/xml WhitespaceFilter.java
               tools/src blocks-build.xsl
  Log:
  Correct normalization of the CDATA sections for the testcases.
  
  Revision  Changes    Path
  1.4       +14 -4     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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- WhitespaceFilter.java	17 Apr 2003 07:32:02 -0000	1.3
  +++ WhitespaceFilter.java	26 May 2003 08:44:30 -0000	1.4
  @@ -149,9 +149,19 @@
           if (buffer!=null) {
               String text = buffer.toString();
   
  -            text = text.replace('\n', ' ');
  -            text = text.replace('\r', ' ');
  -            text = text.trim();
  +            StringBuffer normalized = new StringBuffer();
  +
  +            for(int i=0; i<text.length(); i++) {
  +                if (Character.isWhitespace(text.charAt(i))) {
  +                    normalized.append(' ');
  +                    while (((i+1)<text.length()) && (Character.isWhitespace(text.charAt(i+1))))
  +                        i++;
  +                } else {
  +                    normalized.append(text.charAt(i));
  +                }
  +            }
  +
  +            text = normalized.toString().trim();
   
               if (text.length()>0) {
                   contentHandler.characters(text.toCharArray(), 0,
  
  
  
  1.21      +0 -2      cocoon-2.1/tools/src/blocks-build.xsl
  
  Index: blocks-build.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/tools/src/blocks-build.xsl,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- blocks-build.xsl	23 May 2003 11:59:30 -0000	1.20
  +++ blocks-build.xsl	26 May 2003 08:44:30 -0000	1.21
  @@ -25,8 +25,6 @@
               </fileset>
               <path location="{string('${build.mocks}')}"/>
               <path location="{string('${build.dest}')}"/>
  -            <path location="{string('${build.deprecated.dest}')}"/>
  -            <path location="{string('${build.scratchpad.dest}')}"/>
            </path>
   
            <path id="test.classpath">
  
  
  

Mime
View raw message