cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp XSPMarkupLanguage.java
Date Sat, 20 Apr 2002 03:36:11 GMT
vgritsenko    02/04/19 20:36:11

  Modified:    src/java/org/apache/cocoon/components/language/markup Tag:
                        cocoon_2_0_3_branch CocoonMarkupLanguage.java
                        LogicsheetCodeGenerator.java
               src/java/org/apache/cocoon/components/language/markup/xsp
                        Tag: cocoon_2_0_3_branch XSPMarkupLanguage.java
  Log:
  Do not enclose characters with xsp:text right after xsp:page element.
  Allows to position xsp:logicsheet element anywhere after xsp:page and
  before first document tag.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.1   +14 -19    xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/CocoonMarkupLanguage.java
  
  Index: CocoonMarkupLanguage.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/CocoonMarkupLanguage.java,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- CocoonMarkupLanguage.java	15 Mar 2002 16:32:54 -0000	1.4
  +++ CocoonMarkupLanguage.java	20 Apr 2002 03:36:11 -0000	1.4.2.1
  @@ -53,29 +53,23 @@
   import org.apache.avalon.framework.logger.Loggable;
   
   import org.apache.cocoon.ProcessingException;
  -import org.apache.cocoon.environment.SourceResolver;
   import org.apache.cocoon.components.language.programming.ProgrammingLanguage;
  +import org.apache.cocoon.environment.SourceResolver;
   
  +import org.apache.log.Logger;
   import org.xml.sax.Attributes;
  -import org.xml.sax.InputSource;
   import org.xml.sax.SAXException;
   import org.xml.sax.XMLFilter;
  -import org.xml.sax.XMLReader;
  -import org.xml.sax.helpers.XMLFilterImpl;
  -import org.xml.sax.helpers.XMLReaderFactory;
   import org.xml.sax.helpers.AttributesImpl;
  -import org.apache.log.Logger;
  +import org.xml.sax.helpers.XMLFilterImpl;
   
  -import java.util.Map;
  -import java.util.Stack;
  -import java.util.List;
  +import java.io.File;
  +import java.io.IOException;
   import java.util.ArrayList;
  -import java.util.Iterator;
  -import java.util.HashMap;
   import java.util.HashSet;
  +import java.util.Iterator;
  +import java.util.List;
   import java.util.Set;
  -import java.io.File;
  -import java.io.IOException;
   
   /**
    * Base implementation of <code>MarkupLanguage</code>. This class uses
  @@ -87,7 +81,7 @@
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
    * @author <a href="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
    * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
  - * @version CVS $Id: CocoonMarkupLanguage.java,v 1.4 2002/03/15 16:32:54 haul Exp $
  + * @version CVS $Id: CocoonMarkupLanguage.java,v 1.4.2.1 2002/04/20 03:36:11 vgritsenko
Exp $
    */
   public abstract class CocoonMarkupLanguage extends AbstractMarkupLanguage
   {
  @@ -139,7 +133,6 @@
        * the input document.
        *
        * @param logicsheetMarkupGenerator the logicsheet markup generator
  -     * @param language the language descriptor
        * @param resolver the entity resolver
        * @return XMLFilter the filter that build on the fly the transformer chain
        */
  @@ -219,7 +212,7 @@
   
           /**
            * @param filename the filename
  -         * @param the programming language
  +         * @param language the programming language
            */
           public PreProcessFilter (String filename, ProgrammingLanguage language) {
               super ();
  @@ -443,7 +436,9 @@
   
                           // Send cached characters
                           char[] ch = rootChars.toString().toCharArray();
  -                        super.characters( ch, 0, ch.length);
  +                        if (ch.length > 0) {
  +                            super.characters(ch, 0, ch.length);
  +                        }
   
                           // Send the events dealing with dependencies.
                           // If some dependencies exist, then creates
  @@ -452,11 +447,11 @@
                           Iterator iter = CocoonMarkupLanguage.this.dependencies.iterator();
                           while(iter.hasNext()) {
                               super.startElement(
  -                                namespaceURI, "dependency", localPrefix + ":dependency",
new AttributesImpl()
  +                                (String)rootElement[0], "dependency", localPrefix + ":dependency",
new AttributesImpl()
                               );
                               locationChars = ((String) iter.next()).toCharArray();
                               super.characters(locationChars, 0 , locationChars.length);
  -                            super.endElement(namespaceURI, "dependency", localPrefix +
":dependency");
  +                            super.endElement((String)rootElement[0], "dependency", localPrefix
+ ":dependency");
                           }
   
                           // And finally forward current Element.
  
  
  
  1.11.2.1  +1 -3      xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/LogicsheetCodeGenerator.java
  
  Index: LogicsheetCodeGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/LogicsheetCodeGenerator.java,v
  retrieving revision 1.11
  retrieving revision 1.11.2.1
  diff -u -r1.11 -r1.11.2.1
  --- LogicsheetCodeGenerator.java	7 Mar 2002 16:49:53 -0000	1.11
  +++ LogicsheetCodeGenerator.java	20 Apr 2002 03:36:11 -0000	1.11.2.1
  @@ -75,11 +75,9 @@
    *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
  - * @version CVS $Id: LogicsheetCodeGenerator.java,v 1.11 2002/03/07 16:49:53 vgritsenko
Exp $
  + * @version CVS $Id: LogicsheetCodeGenerator.java,v 1.11.2.1 2002/04/20 03:36:11 vgritsenko
Exp $
    */
   public class LogicsheetCodeGenerator extends AbstractLoggable implements MarkupCodeGenerator
{
  -
  -    private Logicsheet corelogicsheet;
   
       private ContentHandler serializerContentHandler;
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.11.2.1  +9 -19     xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/XSPMarkupLanguage.java
  
  Index: XSPMarkupLanguage.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/XSPMarkupLanguage.java,v
  retrieving revision 1.11
  retrieving revision 1.11.2.1
  diff -u -r1.11 -r1.11.2.1
  --- XSPMarkupLanguage.java	22 Feb 2002 07:00:08 -0000	1.11
  +++ XSPMarkupLanguage.java	20 Apr 2002 03:36:11 -0000	1.11.2.1
  @@ -50,30 +50,15 @@
   */
   package org.apache.cocoon.components.language.markup.xsp;
   
  -import org.apache.avalon.framework.logger.Loggable;
  -
  -import org.apache.cocoon.Constants;
  -import org.apache.cocoon.ProcessingException;
  -import org.apache.cocoon.components.language.markup.LogicsheetCodeGenerator;
   import org.apache.cocoon.components.language.markup.CocoonMarkupLanguage;
   import org.apache.cocoon.components.language.programming.ProgrammingLanguage;
  -import org.apache.cocoon.environment.SourceResolver;
   
  -import org.apache.log.Logger;
   import org.xml.sax.Attributes;
   import org.xml.sax.SAXException;
   import org.xml.sax.XMLFilter;
   import org.xml.sax.helpers.AttributesImpl;
  -import org.xml.sax.helpers.XMLFilterImpl;
   
  -import java.io.File;
  -import java.io.IOException;
  -import java.util.Set;
  -import java.util.HashSet;
   import java.util.Stack;
  -import java.util.List;
  -import java.util.ArrayList;
  -import java.util.Iterator;
   
   /**
    * This class implements <code>MarkupLanguage</code> for Cocoon's
  @@ -82,7 +67,7 @@
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
    * @author <a href="mailto:ssahuc@apache.org">Sebastien Sahuc</a>
    * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
  - * @version CVS $Id: XSPMarkupLanguage.java,v 1.11 2002/02/22 07:00:08 cziegeler Exp $
  + * @version CVS $Id: XSPMarkupLanguage.java,v 1.11.2.1 2002/04/20 03:36:11 vgritsenko Exp
$
    */
   public class XSPMarkupLanguage extends CocoonMarkupLanguage {
   
  @@ -151,9 +136,14 @@
               String[] tag = (String[]) stack.peek();
               String tagURI = tag[0];
               String tagLName = tag[1];
  -            if (XSPMarkupLanguage.this.getURI().equals(tagURI) && (
  -                    tagLName.equals("expr") || tagLName.equals("logic") ||
  -                    tagLName.equals("structure") || tagLName.equals("include"))) {
  +
  +            boolean flag = XSPMarkupLanguage.this.getURI().equals(tagURI);
  +            if (flag && tagLName.equals("page")) {
  +                // Characters after xsp:page and before first element.
  +                super.characters(ch, start, length);
  +            } else if (flag && (tagLName.equals("expr") ||
  +                    tagLName.equals("logic") || tagLName.equals("structure") ||
  +                    tagLName.equals("include"))) {
                   super.characters(ch, start, length);
               } else {
                   // Quote the string depending on the programming language
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message