You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by di...@apache.org on 2001/09/06 00:18:19 UTC

cvs commit: xml-cocoon2/xdocs catalog.xml directory-generator.xml docs-book.xml i18n-transformer.xml jsp-generator.xml site-book.xml status-generator.xml

dims        01/09/05 15:18:19

  Modified:    .        Tag: cocoon_20_branch build.xml
               lib      Tag: cocoon_20_branch batik-libs.jar
               skins/printer/stylesheets Tag: cocoon_20_branch
                        document2html.xsl
               src/org/apache/cocoon Tag: cocoon_20_branch Cocoon.java
                        Constants.java Main.java cocoon.roles
               src/org/apache/cocoon/acting Tag: cocoon_20_branch
                        AbstractComplementaryConfigurableAction.java
               src/org/apache/cocoon/components/language/generator Tag:
                        cocoon_20_branch GeneratorSelector.java
               src/org/apache/cocoon/components/language/markup Tag:
                        cocoon_20_branch AbstractMarkupLanguage.java
                        Logicsheet.java NamedLogicsheet.java
               src/org/apache/cocoon/components/language/markup/xsp Tag:
                        cocoon_20_branch XSPFormValidatorHelper.java
                        XSPObjectHelper.java
               src/org/apache/cocoon/components/language/markup/xsp/java
                        Tag: cocoon_20_branch log.xsl
               src/org/apache/cocoon/components/parser Tag:
                        cocoon_20_branch JaxpParser.java
               src/org/apache/cocoon/components/source Tag:
                        cocoon_20_branch SitemapSource.java URLSource.java
               src/org/apache/cocoon/components/store Tag: cocoon_20_branch
                        FilesystemStore.java MRUMemoryStore.java
                        MemoryStore.java Store.java
               src/org/apache/cocoon/environment Tag: cocoon_20_branch
                        AbstractEnvironment.java Environment.java
                        Source.java
               src/org/apache/cocoon/environment/http Tag: cocoon_20_branch
                        HttpRequest.java
               src/org/apache/cocoon/environment/wrapper Tag:
                        cocoon_20_branch EnvironmentWrapper.java
               src/org/apache/cocoon/generation Tag: cocoon_20_branch
                        DirectoryGenerator.java FileGenerator.java
               src/org/apache/cocoon/serialization Tag: cocoon_20_branch
                        FOPSerializer.java
               src/org/apache/cocoon/servlet Tag: cocoon_20_branch
                        CocoonServlet.java
               src/org/apache/cocoon/sitemap Tag: cocoon_20_branch
                        AbstractSitemap.java ContentAggregator.java
                        Handler.java Manager.java
               src/org/apache/cocoon/transformation Tag: cocoon_20_branch
                        CIncludeTransformer.java I18nTransformer.java
                        TraxTransformer.java
               src/org/apache/cocoon/util Tag: cocoon_20_branch
                        IOUtils.java
               src/org/apache/cocoon/xml Tag: cocoon_20_branch
                        NamespacesTable.java XMLFragment.java
               src/org/apache/cocoon/xml/dom Tag: cocoon_20_branch
                        DOMBuilder.java
               webapp   Tag: cocoon_20_branch cocoon.xconf sitemap.xmap
               webapp/WEB-INF Tag: cocoon_20_branch web.xml
               webapp/docs/samples Tag: cocoon_20_branch samples.xml
               webapp/docs/samples/fo Tag: cocoon_20_branch readme.fo
               webapp/i18n Tag: cocoon_20_branch simple.xml simple.xsp
                        sitemap.xmap
               xdocs    Tag: cocoon_20_branch directory-generator.xml
                        docs-book.xml i18n-transformer.xml
                        jsp-generator.xml site-book.xml
                        status-generator.xml
  Added:       lib      Tag: cocoon_20_branch avalon-excalibur-dev.jar
                        fop-0_20_1-dev.jar logkit-1.0b4-dev.jar
                        resolver.jar
               src/org/apache/cocoon/components Tag: cocoon_20_branch
                        ParentComponentManager.java
               src/org/apache/cocoon/components/jsp Tag: cocoon_20_branch
                        JSPEngineImplNamedDispatcherInclude.java
                        JSPEngineImplWLS.java
               src/org/apache/cocoon/components/renderer Tag:
                        cocoon_20_branch ExtendableRendererFactory.java
                        RendererFactory.java
               src/org/apache/cocoon/components/resolver Tag:
                        cocoon_20_branch Resolver.java ResolverImpl.java
               src/org/apache/cocoon/components/store Tag: cocoon_20_branch
                        StoreJanitor.java StoreJanitorImpl.java
               src/org/apache/cocoon/components/xslt Tag: cocoon_20_branch
                        XSLTProcessor.java XSLTProcessorImpl.java
               src/org/apache/cocoon/environment Tag: cocoon_20_branch
                        ModifiableSource.java URLFactorySourceResolver.java
               src/org/apache/cocoon/i18n Tag: cocoon_20_branch
                        XMLResourceBundle.java
                        XMLResourceBundleFactory.java
               src/org/apache/cocoon/util/log Tag: cocoon_20_branch
                        CocoonTargetFactory.java package.html
               src/org/apache/cocoon/xml Tag: cocoon_20_branch
                        XMLizable.java
               webapp/WEB-INF Tag: cocoon_20_branch logkit.xconf
               webapp/docs/samples/catalog Tag: cocoon_20_branch style.xsl
                        test.xml testovr.xml
               webapp/i18n/translations Tag: cocoon_20_branch convert.xsl
                        messages.xml messages_de.xml messages_en.xml
                        messages_es.xml messages_hy.xml messages_pl.xml
                        messages_ru.xml
               webapp/resources/entities Tag: cocoon_20_branch
                        CatalogManager.properties ISOdia.pen ISOgrk1.pen
                        ISOlat1.pen ISOnum.pen ISOpub.pen ISOtech.pen
                        README catalog
               webapp/resources/entities/catalog-demo Tag: cocoon_20_branch
                        catalog-demo-v10.dtd override.xml testpub.xml
                        testsys.xml
               webapp/stylesheets Tag: cocoon_20_branch
                        simple-page2html.xsl simple-xml2html.xsl
               xdocs    Tag: cocoon_20_branch catalog.xml
  Removed:     lib      Tag: cocoon_20_branch avalon-excalibur.jar
                        fop-0_19_0.jar logkit-1.0b4.jar
               src/org/apache/cocoon/serialization Tag: cocoon_20_branch
                        PCLSerializer.java PSSerializer.java
  Log:
  Final (Hopefully!!!!) Sync between C2.0 and C2.1 based on the results of the VOTE.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.8.2.31  +23 -11    xml-cocoon2/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/build.xml,v
  retrieving revision 1.8.2.30
  retrieving revision 1.8.2.31
  diff -u -r1.8.2.30 -r1.8.2.31
  --- build.xml	2001/08/25 13:28:48	1.8.2.30
  +++ build.xml	2001/09/05 22:18:01	1.8.2.31
  @@ -100,7 +100,7 @@
         
   - HTML Generator : Requires the JTidy package (included in the dist)
                      <map:generator  name="html" src="org.apache.cocoon.generation.HTMLGenerator" label="content"/>
  -
  +                  
   Transformers
   
   - XT transformer : Requires the XT package (included in the dist)
  @@ -115,9 +115,9 @@
   - fo2pdf serializer : Requires the FOP package (included in the dist)
                       <map:serializer name="fo2pdf" src="org.apache.cocoon.serialization.FOPSerializer" mime-type="application/pdf"/>
   - fo2ps serializer : Requires the FOP package (included in the dist)
  -                    <map:serializer name="fo2ps" src="org.apache.cocoon.serialization.PSSerializer" mime-type="application/ps"/>
  +                    <map:serializer name="fo2ps" src="org.apache.cocoon.serialization.FOPSerializer" mime-type="application/postscript"/>
   - fo2pcl serializer : Requires the FOP package (included in the dist)
  -                    <map:serializer name="fo2pdf" src="org.apache.cocoon.serialization.PCLSerializer" mime-type="application/vnd.hp-PCL"/>
  +                    <map:serializer name="fo2pcl" src="org.apache.cocoon.serialization.FOPSerializer" mime-type="application/vnd.hp-PCL"/>
   
   
                                 Happy hacking from the Apache Cocoon 2 Dev Team :)
  @@ -165,12 +165,13 @@
       <property name="release"  value="3rd"/>
       <property name="year"     value="1999-2001"/>
   
  +
       <echo message="------------------- ${fullname} ${version} [${year}] ----------------"/>
   
       <property name="debug"          value="on"/>
       <property name="optimize"       value="off"/>
       <property name="deprecation"    value="off"/>
  -    <property name="build.compiler" value="modern"/>
  +    <property name="build.compiler" value="classic"/>
       <property name="target.vm"      value="1.2"/>
   
       <property name="src.dir"      value="./src"/>
  @@ -224,6 +225,7 @@
       <filter token="date"    value="${TODAY}"/>
       <filter token="log"     value="true"/>
       <filter token="verbose" value="true"/>
  +    <filter token="install.war" value="${install.war}"/>
   
       <!-- Add filters for loading database information from database.properties file -->
       <property file="database.properties"/>
  @@ -272,6 +274,9 @@
       <available property="naming.present" classname="javax.naming.Context">
         <classpath refid="classpath"/>
       </available>
  +    <available property="weblogic.present" classname="weblogic.servlet.internal.ServletContextImpl">
  +      <classpath refid="classpath"/>
  +    </available>
       <available property="maybeupload.present" classname="uk.co.weft.maybeupload.MaybeUploadRequestWrapper">
         <classpath refid="classpath"/>
       </available>
  @@ -296,6 +301,7 @@
           <exclude name="**/Ora*.java" unless="ora.driver.present"/>
           <exclude name="**/Sendmail*.java" unless="mail.present"/>
           <exclude name="**/LDAPTransformer*.java" unless="naming.present"/>
  +        <exclude name="**/JSPEngineImplWLS.java" unless="weblogic.present"/>
           <exclude name="**/browser/*.x*"/>
         </fileset>
       </copy>
  @@ -393,8 +399,7 @@
         <exclude name="**/Javascript*"         unless="rhino.present"/>
         <exclude name="**/Jstyle*"             unless="jstyle.present"/>
         <exclude name="**/FOP*"                unless="fop.present"/>
  -      <exclude name="**/serialization/PCL*"  unless="fop.present"/>
  -      <exclude name="**/serialization/PS*"   unless="fop.present"/>
  +      <exclude name="**/renderer/*"          unless="fop.present"/>
         <exclude name="**/Php*"                unless="php.present"/>
         <exclude name="**/HTMLGenerator.java"  unless="tidy.present"/>
         <exclude name="**/J2eeDataSource.java" unless="j2ee.present"/>
  @@ -477,7 +482,6 @@
       </copy>
     </target>
   
  -
     <!-- =================================================================== -->
     <!-- Prepares the webapp sitemap if php is available                     -->
     <!-- =================================================================== -->
  @@ -507,23 +511,23 @@
     <!-- =================================================================== -->
     <target name="prepare-webapp-fop" depends="copy-webapp" if="fop.present">
       <java classname="st">
  -        <arg line="-i ${build.war}/sitemap.xmap -o ${build.war}/sitemap.xmap -m application/pdf -a serializers fo2pdf org.apache.cocoon.serialization.FOPSerializer"/>
  +        <arg line="-i ${build.war}/sitemap.xmap -o ${build.war}/sitemap.xmap -m application/pdf         -a serializers fo2pdf org.apache.cocoon.serialization.FOPSerializer"/>
           <classpath>
             <pathelement location="${bin.dir}"/>
           </classpath>
       </java>
       <java classname="st">
  -        <arg line="-i ${build.war}/sitemap.xmap -o ${build.war}/sitemap.xmap -m application/ps          -a serializers fo2ps  org.apache.cocoon.serialization.PSSerializer"/>
  +        <arg line="-i ${build.war}/sitemap.xmap -o ${build.war}/sitemap.xmap -m application/postscript          -a serializers fo2ps  org.apache.cocoon.serialization.FOPSerializer"/>
           <classpath>
             <pathelement location="${bin.dir}"/>
           </classpath>
       </java>
       <java classname="st">
  -        <arg line="-i ${build.war}/sitemap.xmap -o ${build.war}/sitemap.xmap -m 'application/vnd.hp-PCL' -a serializers fo2pcl org.apache.cocoon.serialization.PCLSerializer"/>
  +        <arg line="-i ${build.war}/sitemap.xmap -o ${build.war}/sitemap.xmap -m 'application/vnd.hp-PCL' -a serializers fo2pcl org.apache.cocoon.serialization.FOPSerializer"/>
           <classpath>
             <pathelement location="${bin.dir}"/>
           </classpath>
  -    </java>
  +    </java>    
     </target>
   
     <!-- =================================================================== -->
  @@ -585,6 +589,14 @@
           <exclude name="servlet*.jar"/>
         </fileset>
       </copy>
  +
  +    <mkdir dir="${build.war}/WEB-INF/classes"/>
  +
  +    <move todir="${build.war}/WEB-INF/classes">
  +      <fileset dir="${build.war}/resources/entities">
  +        <include name="CatalogManager.properties"/>
  +      </fileset>
  +    </move>
   
       <!-- NOTE: java.home is normally set by the JVM to the /jre directory -->
       <copy file="${tools.jar}" tofile="${build.war}/WEB-INF/lib/javac.jar"/>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +6726 -6927xml-cocoon2/lib/batik-libs.jar
  
  	<<Binary file>>
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +0 -0      xml-cocoon2/lib/avalon-excalibur-dev.jar
  
  	<<Binary file>>
  
  
  1.1.2.1   +0 -0      xml-cocoon2/lib/fop-0_20_1-dev.jar
  
  	<<Binary file>>
  
  
  1.1.2.1   +0 -0      xml-cocoon2/lib/logkit-1.0b4-dev.jar
  
  	<<Binary file>>
  
  
  1.1.2.1   +0 -0      xml-cocoon2/lib/resolver.jar
  
  	<<Binary file>>
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.1.1.2.2 +15 -3     xml-cocoon2/skins/printer/stylesheets/document2html.xsl
  
  Index: document2html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/skins/printer/stylesheets/document2html.xsl,v
  retrieving revision 1.1.1.1.2.1
  retrieving revision 1.1.1.1.2.2
  diff -u -r1.1.1.1.2.1 -r1.1.1.1.2.2
  --- document2html.xsl	2001/08/07 17:17:14	1.1.1.1.2.1
  +++ document2html.xsl	2001/09/05 22:18:10	1.1.1.1.2.2
  @@ -23,8 +23,20 @@
           <link rel="stylesheet" type="text/css" href="resources/simple.css" title="Simple Style"/>
         </head>
         <body>
  -        <xsl:apply-templates/><br/>
  -        <xsl:apply-templates select="document($stylebook.project)"/>
  +
  +        <!-- THE MAIN PANEL (SIDEBAR AND CONTENT) -->
  +        <table id="main-panel">
  +          <tr>
  +            <!-- THE SIDE BAR -->
  +            <td id="side-bar" valign="top">
  +              <xsl:apply-templates select="document($stylebook.project)"/>
  +            </td>
  +            <!-- THE CONTENT PANEL -->
  +            <td id="content-panel">
  +              <xsl:apply-templates/>
  +            </td>
  +          </tr>
  +        </table>
         </body>
       </html>
      </xsl:if>
  @@ -174,4 +186,4 @@
      <a name="{@id}"><xsl:comment>anchor</xsl:comment></a>
    </xsl:template>  
   
  -</xsl:stylesheet>
  +</xsl:stylesheet>
  \ No newline at end of file
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.9.2.16  +46 -4     xml-cocoon2/src/org/apache/cocoon/Cocoon.java
  
  Index: Cocoon.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/Cocoon.java,v
  retrieving revision 1.9.2.15
  retrieving revision 1.9.2.16
  diff -u -r1.9.2.15 -r1.9.2.16
  --- Cocoon.java	2001/08/29 17:55:51	1.9.2.15
  +++ Cocoon.java	2001/09/05 22:18:10	1.9.2.16
  @@ -9,9 +9,13 @@
   
   import org.apache.avalon.excalibur.component.DefaultRoleManager;
   import org.apache.avalon.excalibur.component.ExcaliburComponentManager;
  +import org.apache.avalon.excalibur.logger.LogKitManager;
  +import org.apache.avalon.excalibur.logger.LogKitManageable;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.component.Component;
  +import org.apache.avalon.framework.component.ComponentManager;
  +import org.apache.avalon.framework.component.Composable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.configuration.SAXConfigurationHandler;
  @@ -33,6 +37,7 @@
   import org.apache.cocoon.environment.Request;
   import org.apache.cocoon.environment.Session;
   import org.apache.cocoon.environment.Source;
  +import org.apache.cocoon.environment.ModifiableSource;
   import org.apache.cocoon.sitemap.AbstractSitemap;
   import org.apache.cocoon.sitemap.Manager;
   import org.apache.cocoon.util.ClassUtils;
  @@ -51,14 +56,25 @@
    *
    * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a> (Apache Software Foundation, Exoffice Technologies)
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.9.2.15 $ $Date: 2001/08/29 17:55:51 $
  + * @author <a href="mailto:leo.sutic@inspireinfrastructure.com">Leo Sutic</a>
  + * @version CVS $Revision: 1.9.2.16 $ $Date: 2001/09/05 22:18:10 $
    */
  -public class Cocoon extends AbstractLoggable implements ThreadSafe, Component, Initializable, Disposable, Modifiable, Processor, Contextualizable {
  +public class Cocoon 
  +        extends AbstractLoggable 
  +        implements ThreadSafe, 
  +                   Component, 
  +                   Initializable, 
  +                   Disposable, 
  +                   Modifiable, 
  +                   Processor, 
  +                   Contextualizable,
  +                   Composable,
  +                   LogKitManageable{
       /** The application context */
       private Context context;
   
       /** The configuration file */
  -    private Source configurationFile;
  +    private ModifiableSource configurationFile;
   
       /** The sitemap file */
       private String sitemapFileName;
  @@ -69,6 +85,9 @@
       /** The sitemap manager */
       private Manager sitemapManager;
   
  +    /** The logkit manager */
  +    private LogKitManager logKitManager;
  +
       /** The classpath (null if not available) */
       private String classpath;
   
  @@ -84,6 +103,9 @@
       /** The component manager. */
       public ExcaliburComponentManager componentManager;
   
  +    /** The parent component manager. */
  +    public ComponentManager parentComponentManager;
  +
       /** flag for disposed or not */
       private boolean disposed = false;
   
  @@ -93,6 +115,16 @@
           setSystemProperties();
       }
   
  +    /**
  +     * Get the parent component manager. For purposes of
  +     * avoiding extra method calls, the manager parameter may be null.
  +     *
  +     * @param manager the parent component manager. May be <code>null</code>
  +     */
  +    public void compose(ComponentManager manager) {
  +        this.parentComponentManager = manager;
  +    }
  +
       public void contextualize(Context context) throws ContextException {
           if (this.context == null) {
               this.context = context;
  @@ -108,8 +140,15 @@
           }
       }
   
  +    public void setLogKitManager(LogKitManager logKitManager) {
  +        this.logKitManager = logKitManager;
  +    }
  +
       public void initialize() throws Exception {
  -        this.componentManager = new ExcaliburComponentManager((ClassLoader)this.context.get(Constants.CONTEXT_CLASS_LOADER));
  +        if(parentComponentManager != null)
  +            this.componentManager = new ExcaliburComponentManager(parentComponentManager,(ClassLoader)this.context.get(Constants.CONTEXT_CLASS_LOADER));
  +        else
  +            this.componentManager = new ExcaliburComponentManager((ClassLoader)this.context.get(Constants.CONTEXT_CLASS_LOADER));
           this.componentManager.setLogger(getLogger());
           this.componentManager.contextualize(this.context);
   
  @@ -125,6 +164,7 @@
           ExcaliburComponentManager startupManager = new ExcaliburComponentManager((ClassLoader)this.context.get(Constants.CONTEXT_CLASS_LOADER));
           startupManager.setLogger(getLogger());
           startupManager.contextualize(this.context);
  +        startupManager.setLogKitManager(this.logKitManager);
   
           try {
               startupManager.addComponent(Parser.ROLE, ClassUtils.loadClass(parser), null);
  @@ -256,6 +296,7 @@
           Configuration conf = this.configuration;
   
           AbstractSitemap.setRoleManager(sitemapRoleManager, conf);
  +        AbstractSitemap.setLogKitManager(this.logKitManager);
   
           getLogger().debug("Root configuration: " + conf.getName());
           if (! "cocoon".equals(conf.getName())) {
  @@ -294,6 +335,7 @@
           }
   
           this.componentManager.setRoleManager(drm);
  +        this.componentManager.setLogKitManager(this.logKitManager);
   
           getLogger().debug("Setting up components...");
           this.componentManager.configure(conf);
  
  
  
  1.4.2.6   +1 -3      xml-cocoon2/src/org/apache/cocoon/Constants.java
  
  Index: Constants.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/Constants.java,v
  retrieving revision 1.4.2.5
  retrieving revision 1.4.2.6
  diff -u -r1.4.2.5 -r1.4.2.6
  --- Constants.java	2001/07/18 10:44:39	1.4.2.5
  +++ Constants.java	2001/09/05 22:18:10	1.4.2.6
  @@ -10,7 +10,7 @@
   
   /**
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.4.2.5 $ $Date: 2001/07/18 10:44:39 $
  + * @version CVS $Revision: 1.4.2.6 $ $Date: 2001/09/05 22:18:10 $
    */
   
   public interface Constants {
  @@ -70,8 +70,6 @@
       String CONTEXT_CACHE_DIR       = "cache-directory";
       String CONTEXT_CLASSPATH       = "classpath";
       String CONTEXT_CONFIG_URL      = "config-url";
  -    String CONTEXT_LOG_DIR         = "log-directory";
  -    String CONTEXT_LOG_FILE        = "log-file";
   
       boolean DESCRIPTOR_RELOADABLE_DEFAULT = true;
   
  
  
  
  1.4.2.13  +46 -35    xml-cocoon2/src/org/apache/cocoon/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/Main.java,v
  retrieving revision 1.4.2.12
  retrieving revision 1.4.2.13
  diff -u -r1.4.2.12 -r1.4.2.13
  --- Main.java	2001/08/23 02:49:05	1.4.2.12
  +++ Main.java	2001/09/05 22:18:10	1.4.2.13
  @@ -12,6 +12,10 @@
   import org.apache.avalon.excalibur.cli.CLOption;
   import org.apache.avalon.excalibur.cli.CLOptionDescriptor;
   import org.apache.avalon.excalibur.cli.CLUtil;
  +import org.apache.avalon.excalibur.logger.DefaultLogKitManager;
  +import org.apache.avalon.excalibur.logger.LogKitManager;
  +import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
  +import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.context.DefaultContext;
   import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.environment.commandline.CommandlineContext;
  @@ -31,6 +35,7 @@
   import java.io.BufferedReader;
   import java.io.File;
   import java.io.FileNotFoundException;
  +import java.io.FileInputStream;
   import java.io.FileOutputStream;
   import java.io.FileReader;
   import java.io.IOException;
  @@ -51,7 +56,7 @@
    * Command line entry point.
    *
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.4.2.12 $ $Date: 2001/08/23 02:49:05 $
  + * @version CVS $Revision: 1.4.2.13 $ $Date: 2001/09/05 22:18:10 $
    */
   
   public class Main {
  @@ -60,7 +65,8 @@
   
       protected static final int HELP_OPT =        'h';
       protected static final int VERSION_OPT =     'v';
  -    protected static final int LOG_URL_OPT =     'l';
  +    protected static final int LOG_KIT_OPT =     'k';
  +    protected static final int LOGGER_OPT =      'l';
       protected static final int LOG_LEVEL_OPT =   'u';
       protected static final int CONTEXT_DIR_OPT = 'c';
       protected static final int DEST_DIR_OPT =    'd';
  @@ -87,14 +93,18 @@
                                  CLOptionDescriptor.ARGUMENT_DISALLOWED,
                                  VERSION_OPT,
                                  "print the version information and exit"),
  -        new CLOptionDescriptor("logUrl",
  +        new CLOptionDescriptor("logKitconfig",
                                  CLOptionDescriptor.ARGUMENT_REQUIRED,
  -                               LOG_URL_OPT,
  -                               "use given file for log"),
  +                               LOG_KIT_OPT,
  +                               "use given file for LogKit Management configuration"),
  +        new CLOptionDescriptor("Logger",
  +                               CLOptionDescriptor.ARGUMENT_REQUIRED,
  +                               LOGGER_OPT,
  +                               "use given logger category as default logger for the Cocoon engine"),
           new CLOptionDescriptor("logLevel",
                                  CLOptionDescriptor.ARGUMENT_REQUIRED,
                                  LOG_LEVEL_OPT,
  -                               "choose the minimum log level for logging (DEBUG, INFO, WARN, ERROR, FATAL_ERROR)"),
  +                               "choose the minimum log level for logging (DEBUG, INFO, WARN, ERROR, FATAL_ERROR) for startup logging"),
           new CLOptionDescriptor("contextDir",
                                  CLOptionDescriptor.ARGUMENT_REQUIRED,
                                  CONTEXT_DIR_OPT,
  @@ -155,12 +165,12 @@
           String workDir = Constants.DEFAULT_WORK_DIR;
           List targets = new ArrayList();
           CLArgsParser parser = new CLArgsParser(args, options);
  -        String logUrl = null;
  +        String logKit = null;
  +        String logger = null;
           String logLevel = "DEBUG";
           boolean xspOnly = false;
           String userAgent = DEFAULT_USER_AGENT;
           String accept = DEFAULT_ACCEPT;
  -        String logDir = "", logFile = "";
           boolean followLinks = true;
   
           List clOptions = parser.getArguments();
  @@ -193,9 +203,13 @@
                   case Main.CONTEXT_DIR_OPT:
                       contextDir = option.getArgument();
                       break;
  +
  +                case Main.LOG_KIT_OPT:
  +                    logKit = option.getArgument();
  +                    break;
   
  -                case Main.LOG_URL_OPT:
  -                    logUrl = option.getArgument();
  +                case Main.LOGGER_OPT:
  +                    logger = option.getArgument();
                       break;
   
                   case Main.LOG_LEVEL_OPT:
  @@ -224,29 +238,9 @@
               }
           }
   
  -        try {
  -            final Priority priority = Priority.getPriorityForName(logLevel);
  -            log = Hierarchy.getDefaultHierarchy().getLoggerFor("cocoon");
  -            log.setPriority(priority);
  -
  -            // FIXME
  -            // The log dir and log file must be detected correct
  -            // This is only a simple hack to make the sitemap manager happy
  -            if(logUrl == null) {
  -                log.setLogTargets( new LogTarget[] {new DefaultOutputLogTarget(System.out)});
  -                logDir = "";
  -                logFile = "";
  -            } else {
  -                log.setLogTargets(new LogTarget[] {new FileOutputLogTarget(logUrl)});
  -                logFile = logUrl;
  -                logDir = "";
  -            }
  -        } catch (MalformedURLException mue) {
  -            String error = "Cannot write on the specified log file.  Please, make sure the path exists and you have write permissions.";
  -            Hierarchy.getDefaultHierarchy().log(error, mue);
  -            System.out.println(error);
  -            System.exit(1);
  -        }
  +        final Priority priority = Priority.getPriorityForName(logLevel);
  +        Hierarchy.getDefaultHierarchy().setDefaultPriority(priority);
  +        log = Hierarchy.getDefaultHierarchy().getLoggerFor("");
   
           if (destDir.equals("")) {
               String error = "Careful, you must specify a destination dir when using the -d/--destDir argument";
  @@ -288,17 +282,34 @@
               CommandlineContext clContext = new CommandlineContext(contextDir);
               clContext.setLogger(log);
               appContext.put(Constants.CONTEXT_ENVIRONMENT_CONTEXT, clContext);
  +            DefaultLogKitManager logKitManager = null;
  +            if(logKit != null) {
  +                final FileInputStream fis = new FileInputStream(logKit);
  +                final DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
  +                final Configuration logKitConf = builder.build(fis);
  +                logKitManager = new DefaultLogKitManager();
  +                logKitManager.setLogger(log);
  +                final DefaultContext subcontext = new DefaultContext(appContext);
  +                subcontext.put("context-root", contextDir);
  +                logKitManager.contextualize(subcontext);
  +                logKitManager.configure(logKitConf);
  +                logKitManager = logKitManager;
  +                if (logger != null) {
  +                    log = logKitManager.getLogger(logger);
  +                } else {
  +                    log = logKitManager.getLogger("cocoon");
  +                }
  +            }
               appContext.put(Constants.CONTEXT_CLASSPATH, getClassPath(contextDir));
               appContext.put(Constants.CONTEXT_WORK_DIR, work);
               appContext.put(Constants.CONTEXT_UPLOAD_DIR, contextDir + "image-dir");
               File cacheDir = getDir(workDir + File.separator + "cache-dir", "cache");
               appContext.put(Constants.CONTEXT_CACHE_DIR, cacheDir);
               appContext.put(Constants.CONTEXT_CONFIG_URL, conf.toURL());
  -            appContext.put(Constants.CONTEXT_LOG_DIR, logDir);
  -            appContext.put(Constants.CONTEXT_LOG_FILE, logFile);
               Cocoon c = new Cocoon();
               c.setLogger(log);
               c.contextualize(appContext);
  +            c.setLogKitManager(logKitManager);
               c.initialize();
               Main main = new Main(c, context, dest);
               main.userAgent = userAgent;
  
  
  
  1.6.2.14  +8 -0      xml-cocoon2/src/org/apache/cocoon/cocoon.roles
  
  Index: cocoon.roles
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/cocoon.roles,v
  retrieving revision 1.6.2.13
  retrieving revision 1.6.2.14
  diff -u -r1.6.2.13 -r1.6.2.14
  --- cocoon.roles	2001/08/20 14:07:24	1.6.2.13
  +++ cocoon.roles	2001/09/05 22:18:10	1.6.2.14
  @@ -5,6 +5,10 @@
          shorthand="parser"
          default-class="org.apache.cocoon.components.parser.JaxpParser"/>
   
  + <role name="org.apache.cocoon.components.xslt.XSLTProcessor"
  +       shorthand="xslt-processor"
  +       default-class="org.apache.cocoon.components.xslt.XSLTProcessorImpl"/>
  +
    <role name="org.apache.cocoon.components.browser.Browser"
          shorthand="browser"
          default-class="org.apache.cocoon.components.browser.BrowserImpl"/>
  @@ -87,5 +91,9 @@
    <role name="org.apache.cocoon.components.store.Store/StreamCache"
          shorthand="stream-cache"
          default-class="org.apache.cocoon.components.store.MRUMemoryStore"/>
  + 
  + <role name="org.apache.cocoon.components.store.StoreJanitor"
  +       shorthand="store-janitor"
  +       default-class="org.apache.cocoon.components.store.StoreJanitorImpl"/>
   
   </role-list>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.7   +2 -2      xml-cocoon2/src/org/apache/cocoon/acting/AbstractComplementaryConfigurableAction.java
  
  Index: AbstractComplementaryConfigurableAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/acting/AbstractComplementaryConfigurableAction.java,v
  retrieving revision 1.3.2.6
  retrieving revision 1.3.2.7
  diff -u -r1.3.2.6 -r1.3.2.7
  --- AbstractComplementaryConfigurableAction.java	2001/08/22 03:57:58	1.3.2.6
  +++ AbstractComplementaryConfigurableAction.java	2001/09/05 22:18:10	1.3.2.7
  @@ -26,7 +26,7 @@
    * effective.  The name of the root configuration element is irrelevant.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.3.2.6 $ $Date: 2001/08/22 03:57:58 $
  + * @version CVS $Revision: 1.3.2.7 $ $Date: 2001/09/05 22:18:10 $
    */
   public abstract class AbstractComplementaryConfigurableAction extends ConfigurableComposerAction {
       private static Map configurations = new HashMap();
  @@ -76,7 +76,7 @@
                               conf = new ConfigurationHelper();
   			
                           SAXConfigurationHandler builder = new SAXConfigurationHandler();
  -                        resource.stream(builder);
  +                        resource.toSAX(builder);
   			
                           conf.lastModified = resource.getLastModified();
                           conf.configuration = builder.getConfiguration();
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +0 -0      xml-cocoon2/src/org/apache/cocoon/components/ParentComponentManager.java
  
  Index: ParentComponentManager.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/ParentComponentManager.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +1 -1      xml-cocoon2/src/org/apache/cocoon/components/jsp/JSPEngineImplNamedDispatcherInclude.java
  
  Index: JSPEngineImplNamedDispatcherInclude.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/jsp/JSPEngineImplNamedDispatcherInclude.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- JSPEngineImplNamedDispatcherInclude.java	2001/08/20 13:55:10	1.2
  +++ JSPEngineImplNamedDispatcherInclude.java	2001/09/05 22:18:11	1.2.2.1
  @@ -49,7 +49,7 @@
    *
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
    * @author <a href="mailto:bh22351@i-one.at">Bernhard Huber</a>
  - * @version CVS $Revision: 1.2 $ $Date: 2001/08/20 13:55:10 $
  + * @version CVS $Revision: 1.2.2.1 $ $Date: 2001/09/05 22:18:11 $
    */
   public class JSPEngineImplNamedDispatcherInclude extends AbstractLoggable 
       implements JSPEngine, Contextualizable, Composable, Configurable, ThreadSafe, Disposable {
  
  
  
  1.2.2.1   +1 -1      xml-cocoon2/src/org/apache/cocoon/components/jsp/JSPEngineImplWLS.java
  
  Index: JSPEngineImplWLS.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/jsp/JSPEngineImplWLS.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- JSPEngineImplWLS.java	2001/08/20 13:55:10	1.2
  +++ JSPEngineImplWLS.java	2001/09/05 22:18:11	1.2.2.1
  @@ -41,7 +41,7 @@
    *
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
    * @author <a href="mailto:bh22351@i-one.at">Bernhard Huber</a>
  - * @version CVS $Revision: 1.2 $ $Date: 2001/08/20 13:55:10 $
  + * @version CVS $Revision: 1.2.2.1 $ $Date: 2001/09/05 22:18:11 $
    */
   public class JSPEngineImplWLS extends AbstractLoggable 
       implements JSPEngine, Contextualizable, Composable, Configurable, ThreadSafe, Disposable {
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.1.1.2.9 +14 -5     xml-cocoon2/src/org/apache/cocoon/components/language/generator/GeneratorSelector.java
  
  Index: GeneratorSelector.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/generator/GeneratorSelector.java,v
  retrieving revision 1.1.1.1.2.8
  retrieving revision 1.1.1.1.2.9
  diff -u -r1.1.1.1.2.8 -r1.1.1.1.2.9
  --- GeneratorSelector.java	2001/08/20 14:07:26	1.1.1.1.2.8
  +++ GeneratorSelector.java	2001/09/05 22:18:11	1.1.1.1.2.9
  @@ -10,6 +10,7 @@
   import org.apache.avalon.excalibur.component.ComponentHandler;
   import org.apache.avalon.excalibur.component.ExcaliburComponentSelector;
   import org.apache.avalon.excalibur.component.RoleManager;
  +import org.apache.avalon.excalibur.logger.LogKitManager;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.component.ComponentException;
  @@ -31,7 +32,7 @@
    * includes Sitemaps and XSP Pages
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.1.1.1.2.8 $ $Date: 2001/08/20 14:07:26 $
  + * @version CVS $Revision: 1.1.1.1.2.9 $ $Date: 2001/09/05 22:18:11 $
    */
   public class GeneratorSelector extends ExcaliburComponentSelector implements Disposable {
   
  @@ -40,12 +41,14 @@
       private ClassLoaderManager classManager;
   
       /** The component manager */
  -    protected ComponentManager manager = null;
  +    protected ComponentManager manager;
   
  -    protected Context context = null;
  +    private LogKitManager logKitManager;
   
  -    protected RoleManager roles = null;
  +    protected Context context;
   
  +    protected RoleManager roles;
  +
       protected Map componentHandlers = new HashMap();
   
       /** Dynamic component handlers mapping. */
  @@ -61,6 +64,11 @@
           this.roles = roleMgr;
       }
   
  +    public void setLogKitManager(LogKitManager logKitMgr) {
  +        super.setLogKitManager(logKitMgr);
  +        this.logKitManager = logKitMgr;
  +    }
  +
       public void compose (ComponentManager manager) throws ComponentException {
           super.compose(manager);
           this.manager = manager;
  @@ -128,7 +136,8 @@
                                                         new DefaultConfiguration("", "GeneratorSelector"),
                                                         newManager,
                                                         this.context,
  -                                                      this.roles );
  +                                                      this.roles,
  +                                                      this.logKitManager );
   
               handler.setLogger( getLogger() );
               handler.initialize();
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.5   +207 -260  xml-cocoon2/src/org/apache/cocoon/components/language/markup/AbstractMarkupLanguage.java
  
  Index: AbstractMarkupLanguage.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/markup/AbstractMarkupLanguage.java,v
  retrieving revision 1.4.2.4
  retrieving revision 1.4.2.5
  diff -u -r1.4.2.4 -r1.4.2.5
  --- AbstractMarkupLanguage.java	2001/08/22 03:57:58	1.4.2.4
  +++ AbstractMarkupLanguage.java	2001/09/05 22:18:11	1.4.2.5
  @@ -22,6 +22,7 @@
   import org.apache.cocoon.components.store.Store;
   import org.apache.cocoon.components.url.URLFactory;
   import org.apache.cocoon.environment.Source;
  +import org.apache.cocoon.components.source.URLSource;
   import org.apache.cocoon.environment.SourceResolver;
   import org.apache.cocoon.util.IOUtils;
   import org.xml.sax.Attributes;
  @@ -47,12 +48,20 @@
   
   /**
    * Base implementation of <code>MarkupLanguage</code>. This class uses
  - * logicsheets as the only means of code generation. Code generation should be decoupled from this context!!!
  + * logicsheets as the only means of code generation. Code generation
  + * should be decoupled from this context!!!
  + *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
  - * @version CVS $Revision: 1.4.2.4 $ $Date: 2001/08/22 03:57:58 $
  + * @author <a href="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
  + * @version CVS $Revision: 1.4.2.5 $ $Date: 2001/09/05 22:18:11 $
    */
  -public abstract class AbstractMarkupLanguage extends AbstractLoggable implements MarkupLanguage, Composable, Configurable {
  +public abstract class AbstractMarkupLanguage extends AbstractLoggable
  +  implements MarkupLanguage, Composable, Configurable
  +{
  +  /** The 'file' URL protocol. */
  +  private static final String FILE = "file:";
  +  
       /** The supported language table */
       protected Hashtable languages;
   
  @@ -67,6 +76,14 @@
   
       /** The component manager */
       protected ComponentManager manager;
  +    
  +    /** Prefix for cache keys to avoid name clash with the XSLTProcessor */
  +    private static final String CACHE_PREFIX = "logicsheet:";
  +
  +  /**
  +   * The URL factory used to resolve URIs.
  +   */
  +  URLFactory urlFactory;
   
       /**
        * Set the global component manager.
  @@ -77,6 +94,9 @@
   
           // Initialize logicsheet cache
           this.logicsheetCache = (Store) manager.lookup(Store.ROLE);
  +
  +        // Initialize the URL factory
  +        urlFactory = (URLFactory)this.manager.lookup(URLFactory.ROLE);
       }
   
       /** The default constructor. */
  @@ -95,140 +115,132 @@
           this.prefix = params.getParameter("prefix", null);
       }
   
  -    /**
  -     * Process additional configuration. Load supported programming language definitions
  -     *
  -     * @param conf The language configuration
  -     * @exception ConfigurationException If an error occurs loading logichseets
  -     */
  -    public void configure(Configuration conf) throws ConfigurationException {
  -        try {
  -            // Set up each target-language
  -            Configuration[] l = conf.getChildren("target-language");
  -            for (int i = 0; i < l.length; i++) {
  -                LanguageDescriptor language = new LanguageDescriptor();
  -                language.setName(l[i].getAttribute("name"));
  -                Parameters lcp = Parameters.fromConfiguration(l[i]);
  -
  -                // Create & Store the core logicsheet
  -                CachedURL entry = createLogicsheet(lcp, false);
  -                entry.setLogger(getLogger());
  -
  -                String logicsheetName = entry.getURL().toExternalForm();
  -
  -                this.logicsheetCache.store(logicsheetName, entry);
  -                language.setLogicsheet(logicsheetName);
  -
  -                // Set up each built-in logicsheet
  -                Configuration[] n = l[i].getChildren("builtin-logicsheet");
  -                for (int j = 0; j < n.length; j++) {
  -                    Parameters ncp = Parameters.fromConfiguration(n[j]);
  -
  -                    // Create & Store the named logicsheets
  -                    CachedURL namedEntry = createLogicsheet(ncp, true);
  -
  -                    String namedLogicsheetName = namedEntry.getURL().toExternalForm();
  -                    String namedLogicSheetPrefix = ((NamedLogicsheet) namedEntry.getLogicsheet()).getPrefix();
  -
  -                    this.logicsheetCache.store(namedLogicsheetName, namedEntry);
  -
  -                    // FIXME: Logicsheets should be found by uri--not prefix.
  -                    language.addNamedLogicsheet(namedLogicSheetPrefix, namedLogicsheetName);
  -                }
  -                this.languages.put(language.getName(), language);
  -            }
  -        } catch (Exception e) {
  -            getLogger().warn("Configuration Error: " + e.getMessage(), e);
  -            throw new ConfigurationException("AbstractMarkupLanguage: " + e.getMessage(), e);
  -        }
  -    }
  -
  -    /**
  -     * Abstract out the Logicsheet creation.  Handles both Named and regular logicsheets.
  -     */
  -    private CachedURL createLogicsheet(Parameters params, boolean named) throws Exception {
  -        String logicsheetLocation;
  -        URL logicsheetURL;
  -        Logicsheet logicsheet;
  -        CachedURL entry = null;
  -
  -        if (named) {
  -            logicsheetLocation = params.getParameter("href", null);
  -
  -            NamedLogicsheet namedLogicsheet = new NamedLogicsheet();
  -            namedLogicsheet.setLogger(getLogger());
  -            namedLogicsheet.setPrefix(params.getParameter("prefix", null));
  -            namedLogicsheet.setUri(params.getParameter("href", null));
  -
  -            logicsheet = namedLogicsheet;
  -        } else {
  -            logicsheetLocation = params.getParameter("core-logicsheet", null);
  -            logicsheet = new Logicsheet();
  -            logicsheet.setLogger(getLogger());
  -        }
  -
  -        URLFactory urlFactory = null;
  -        try {
  -            urlFactory = (URLFactory) this.manager.lookup(URLFactory.ROLE);
  -            logicsheetURL = urlFactory.getURL(logicsheetLocation);
  -        } catch (Exception e){
  -            getLogger().warn("URL Error: " + e.getMessage(), e);
  -            throw e;
  -        } finally {
  -            if (urlFactory!=null) this.manager.release((Component) urlFactory);
  -        }
  -
  -        InputSource is = new InputSource(logicsheetURL.openStream());
  -        is.setSystemId(logicsheetURL.toString());
  -        logicsheet.setInputSource(is);
  -
  -        entry = new CachedURL(logicsheetURL, logicsheet);
  -        entry.setLogger(getLogger());
  -
  -        return entry;
  -    }
  -
  -    /**
  -     * Return the source document's encoding. This can be <code>null</code> for
  -     * the platform's default encoding. The default implementation returns
  -     * <code>null, but derived classes may override it if encoding applies to
  -     * their concrete languages. FIXME: There should be a way to get the
  -     * XML document's encoding as seen by the parser; unfortunately, this
  -     * information is not returned by current DOM or SAX parsers...
  -     * @return The document-specified encoding
  -     */
  -    public String getEncoding() {
  -        return null;
  -    }
  +  /**
  +   * Process additional configuration. Load supported programming
  +   * language definitions
  +   *
  +   * @param conf The language configuration
  +   * @exception ConfigurationException If an error occurs loading logichseets
  +   */
  +  public void configure(Configuration conf) throws ConfigurationException {
  +    try {
  +      // Set up each target-language
  +      Configuration[] l = conf.getChildren("target-language");
  +      for (int i = 0; i < l.length; i++) {
  +        LanguageDescriptor language = new LanguageDescriptor();
  +        language.setName(l[i].getAttribute("name"));
  +        Parameters lcp = Parameters.fromConfiguration(l[i]);
  +
  +        // Create & Store the core logicsheet
  +        Logicsheet logicsheet = createLogicsheet(lcp, false);
  +        String logicsheetName = logicsheet.getSystemId();
  +        logicsheetCache.store(CACHE_PREFIX + logicsheetName, logicsheet);
  +        language.setLogicsheet(logicsheetName);
  +
  +        // Set up each built-in logicsheet
  +        Configuration[] n = l[i].getChildren("builtin-logicsheet");
  +        for (int j = 0; j < n.length; j++) {
  +          Parameters ncp = Parameters.fromConfiguration(n[j]);
  +
  +          // Create & Store the named logicsheets
  +          NamedLogicsheet namedLogicsheet
  +            = (NamedLogicsheet)createLogicsheet(ncp, true);
  +          logicsheetName = namedLogicsheet.getSystemId();
  +          String logicsheetPrefix = namedLogicsheet.getPrefix();
  +          logicsheetCache.store(CACHE_PREFIX + logicsheetName, namedLogicsheet);
  +                    
  +          // FIXME: Logicsheets should be found by uri--not prefix.
  +          language.addNamedLogicsheet(logicsheetPrefix, logicsheetName);
  +        }
  +        this.languages.put(language.getName(), language);
  +      }
  +    } catch (Exception e) {
  +      getLogger().warn("Configuration Error: " + e.getMessage(), e);
  +      throw new ConfigurationException("AbstractMarkupLanguage: "
  +                                       + e.getMessage(), e);
  +    }
  +  }
  +
  +  /**
  +   * Abstract out the Logicsheet creation.  Handles both Named and regular logicsheets.
  +   */
  +  private Logicsheet createLogicsheet(Parameters params, boolean named)
  +    throws Exception
  +  {
  +    String logicsheetLocation;
  +    Logicsheet logicsheet;
  +
  +    if (named) {
  +      logicsheetLocation = params.getParameter("href", null);
  +
  +      NamedLogicsheet namedLogicsheet = new NamedLogicsheet(logicsheetLocation,
  +                                                            urlFactory,
  +                                                            manager);
  +      namedLogicsheet.setLogger(getLogger());
  +      namedLogicsheet.setPrefix(params.getParameter("prefix", null));
  +      logicsheet = namedLogicsheet;
  +    } else {
  +      logicsheetLocation = params.getParameter("core-logicsheet", null);
  +      logicsheet = new Logicsheet(logicsheetLocation, urlFactory, manager);
  +      logicsheet.setLogger(getLogger());
  +    }
  +
  +    return logicsheet;
  +  }
  +
  +  /**
  +   * Return the source document's encoding. This can be <code>null</code> for
  +   * the platform's default encoding. The default implementation returns
  +   * <code>null, but derived classes may override it if encoding applies to
  +   * their concrete languages. FIXME: There should be a way to get the
  +   * XML document's encoding as seen by the parser; unfortunately, this
  +   * information is not returned by current DOM or SAX parsers...
  +   * @return The document-specified encoding
  +   */
  +  public String getEncoding() {
  +    return null;
  +  }
  +
  +  /**
  +   * Returns a filter that chains on the fly the requested
  +   * transformers for source code generation. This method scans the
  +   * input SAX events for built-in logicsheet declared as namespace
  +   * attribute on the root element. Derived class should overide
  +   * this method and the public inner class in order to add more
  +   * specif action and to build a more specific transformer chain.
  +   *
  +   * @param logicsheetMarkupGenerator the logicsheet markup generator
  +   * @param resolver the entity resolver
  +   * @return XMLFilter the filter that build on the fly the transformer chain
  +   */
  +  protected TransformerChainBuilderFilter getTranformerChainBuilder
  +    (LogicsheetCodeGenerator logicsheetMarkupGenerator,
  +     SourceResolver resolver)
  +  {
  +    return new TransformerChainBuilderFilter(logicsheetMarkupGenerator,
  +                                             resolver);
  +  }
  +
  +  /**
  +   * Prepare the input source for logicsheet processing and code
  +   * generation with a preprocess filter.  The return
  +   * <code>XMLFilter</code> object is the first filter on the
  +   * transformer chain.  The default implementation does nothing by
  +   * returning a identity filter, but derived classes should (at
  +   * least) use the passed programming language to quote
  +   * <code>Strings</code>
  +   *
  +   * @param filename The source filename
  +   * @param language The target programming language
  +   * @return The preprocess filter
  +   */
  +  protected XMLFilter getPreprocessFilter(String filename,
  +                                          ProgrammingLanguage language)
  +  {
  +    return new XMLFilterImpl();
  +  }
   
       /**
  -     * Returns a filter that chains on the fly the requested transformers for source
  -     * code generation. This method scans the input SAX events for built-in logicsheet
  -     * declared as namespace attribute on the root element. Derived class should overide this method and the public inner class in
  -     * order to add more specif action and to build a more specific transformer chain.
  -     * @param logicsheetMarkupGenerator the logicsheet markup generator
  -     * @param resolver the entity resolver
  -     * @return XMLFilter the filter that build on the fly the transformer chain
  -     */
  -    protected TransformerChainBuilderFilter getTranformerChainBuilder
  -        (LogicsheetCodeGenerator logicsheetMarkupGenerator, SourceResolver resolver) {
  -            return new TransformerChainBuilderFilter(logicsheetMarkupGenerator, resolver);
  -    }
  -
  -    /**
  -     * Prepare the input source for logicsheet processing and code generation with a preprocess filter.
  -     * The return <code>XMLFilter</code> object is the first filter on the transformer chain.
  -     * The default implementation does nothing by returning a identity filter, but
  -     * derived classes should (at least) use the passed programming language to quote <code>Strings</code>
  -     * @param filename The source filename
  -     * @param language The target programming language
  -     * @return The preprocess filter
  -     */
  -    protected XMLFilter getPreprocessFilter(String filename, ProgrammingLanguage language) {
  -        return new XMLFilterImpl();
  -    }
  -
  -    /**
        * Add a dependency on an external file to the document for inclusion in
        * generated code. This is used to populate a list of <code>File</code>'s
        * tested for change on each invocation; this information is used to assert whether regeneration is necessary.
  @@ -239,9 +251,16 @@
   
       /**
        * Generate source code from the input document for the target
  -     * <code>ProgrammingLanguage</code>. After preprocessing the input document,
  -     * this method applies logicsheets in the following order: <ul> <li>User-defined logicsheets</li>
  -     * <li>Namespace-mapped logicsheets</li> <li>Language-specific logicsheet</li> </ul>
  +     * <code>ProgrammingLanguage</code>. After preprocessing the input
  +     * document, this method applies logicsheets in the following
  +     * order:
  +     *
  +     * <ul>
  +     * <li>User-defined logicsheets</li>
  +     * <li>Namespace-mapped logicsheets</li>
  +     * <li>Language-specific logicsheet</li>
  +     * </ul>
  +     *
        * @param input The input source
        * @param filename The input document's original filename
        * @param programmingLanguage The target programming language
  @@ -310,55 +329,58 @@
        * @exception IOException IO Error
        * @exception SAXException Logicsheet parse error
        */
  -    protected void addLogicsheetToList(LanguageDescriptor language, String logicsheetLocation, SourceResolver resolver)
  -        throws MalformedURLException, IOException, SAXException, ProcessingException
  -    {
  -        Source inputSource = resolver.resolve(logicsheetLocation);
  -        try {
  -            URL url = new URL(inputSource.getSystemId());
  -            getLogger().debug("Logicsheet Used:" + url.toExternalForm());
  -
  -            String logicsheetName = inputSource.getSystemId();
  -            CachedURL entry = (CachedURL)this.logicsheetCache.get(logicsheetName);
  -            Logicsheet logicsheet = null;
  -            if (entry == null) {
  -                logicsheet = new Logicsheet();
  -                logicsheet.setLogger(getLogger());
  -                logicsheet.setInputSource(inputSource.getInputSource());
  -                entry = new CachedURL(url, logicsheet);
  -                entry.setLogger(getLogger());
  -                this.logicsheetCache.store(logicsheetName, entry);
  -            }
  -            logicsheet = entry.getLogicsheet();
  -            if (entry.hasChanged()) {
  -                logicsheet.setInputSource(inputSource.getInputSource());
  -            }
  -            if (entry.isFile()) {
  -                this.addDependency(IOUtils.getFullFilename(entry.getFile()));
  -            }
  -
  -            logicSheetList.add(logicsheet);
  -
  -            Map namespaces = logicsheet.getNamespaces();
  -            if(!logicsheetLocation.equals(language.getLogicsheet()))
  -            {
  -                if(namespaces != null && namespaces.size()>0) {
  -                    Iterator iter = namespaces.keySet().iterator();
  -                    while(iter.hasNext()) {
  -                        String namespace = (String) iter.next();
  -                        String namedLogicsheetName = language.getNamedLogicsheet(namespace);
  -                        if(namedLogicsheetName!= null && !logicsheetLocation.equals(namedLogicsheetName)) {
  -                            getLogger().debug("Adding embedded logic sheet for " + namespace + ":" + namedLogicsheetName);
  -                            // Add embedded logic sheets too.
  -                            addLogicsheetToList(language, namedLogicsheetName, resolver);
  -                        }
  -                    }
  -                }
  -            }
  -        } finally {
  -            inputSource.recycle();
  +  protected void addLogicsheetToList(LanguageDescriptor language,
  +                                     String logicsheetLocation,
  +                                     SourceResolver resolver)
  +    throws MalformedURLException, IOException, SAXException, ProcessingException
  +  {
  +    Logicsheet logicsheet = (Logicsheet)logicsheetCache.get(CACHE_PREFIX + logicsheetLocation);
  +    String logicsheetName;
  +
  +    getLogger().debug("AbstractMarkupLanguage addLogicsheetToList: "
  +                      + "logicsheetLocation " + logicsheetLocation
  +                      + ", logicsheet instance " + logicsheet);
  +
  +    if (logicsheet == null) {
  +      Source inputSource = resolver.resolve(logicsheetLocation);
  +      logicsheet = new Logicsheet(inputSource, manager, resolver);
  +      logicsheetName = logicsheet.getSystemId();
  +
  +      logicsheetCache.store(CACHE_PREFIX + logicsheetName, logicsheet);
  +    }
  +    else
  +      logicsheetName = logicsheet.getSystemId();
  +
  +    getLogger().debug("AbstractMarkupLanguage addLogicsheetToList: "
  +                      + "logicsheetName " + logicsheetName);
  +    
  +    if (logicsheetName.startsWith(FILE)) {
  +      String filename = logicsheetName.substring(FILE.length());
  +      addDependency(filename);
  +      getLogger().debug("AbstractMarkupLanguage addLogicsheetToList: "
  +                        + "adding dependency on file " + filename);
  +    }
  +
  +    logicSheetList.add(logicsheet);
  +
  +    Map namespaces = logicsheet.getNamespaces();
  +    if(!logicsheetLocation.equals(language.getLogicsheet())) {
  +      if(namespaces != null && namespaces.size()>0) {
  +        Iterator iter = namespaces.keySet().iterator();
  +        while(iter.hasNext()) {
  +          String namespace = (String) iter.next();
  +          String namedLogicsheetName = language.getNamedLogicsheet(namespace);
  +          if(namedLogicsheetName!= null
  +             && !logicsheetLocation.equals(namedLogicsheetName)) {
  +            getLogger().debug("Adding embedded logic sheet for "
  +                              + namespace + ":" + namedLogicsheetName);
  +            // Add embedded logic sheets too.
  +            addLogicsheetToList(language, namedLogicsheetName, resolver);
  +          }
           }
  +      }
       }
  +  }
       //
       // Inner classes
       //
  @@ -427,81 +449,6 @@
            */
           protected String getNamedLogicsheet(String prefix) {
               return (String)this.namedLogicsheets.get(prefix);
  -        }
  -    }
  -
  -
  -    /** This class holds a cached URL entry associated with a logicsheet */
  -    protected class CachedURL extends AbstractLoggable {
  -        /** The logicsheet URL */
  -        protected URL url;
  -
  -        /**
  -         * The logicsheet's <code>File</code> if it's actually a file.
  -         * This is used to provide last modification information not otherwise available for URL's in Java :-(
  -         */
  -        protected File file;
  -
  -        /** The cached logicsheet */
  -        protected Logicsheet logicsheet;
  -
  -        /** The las time this logicsheet was changed/loaded */
  -        protected long lastModified;
  -
  -        /** The constructor. */
  -        protected CachedURL(URL url, Logicsheet logicsheet) throws IOException {
  -            this.url = url;
  -            this.logicsheet = logicsheet;
  -            if (this.isFile()) {
  -                this.file = new File(url.getFile());
  -            }
  -            this.lastModified = (
  -                new Date()).getTime();
  -        }
  -
  -        /**
  -         * Return this entry's URL
  -         * @return The cached logicsheet's URL
  -         */
  -        protected URL getURL() {
  -            return this.url;
  -        }
  -
  -        protected boolean isFile() {
  -            return this.url.getProtocol().equals("file");
  -        }
  -
  -        /**
  -         * Return this entry's <code>File</code>
  -         * @return The cached logicsheet's <code>File</code>
  -         */
  -        protected File getFile() {
  -            return this.file;
  -        }
  -
  -        /**
  -         * Return this entry's cached logicsheet
  -         * @return The cached logicsheet
  -         */
  -        protected Logicsheet getLogicsheet() {
  -            return this.logicsheet;
  -        }
  -
  -        /**
  -         * Assert whether this entry's logicsheet should be reloaded
  -         * @return Whether the cached logicsheet has changed
  -         */
  -        protected boolean hasChanged() {
  -            boolean hasChanged = false;
  -            if (this.file == null) {
  -                return false;
  -            }
  -            try {
  -                hasChanged = this.lastModified < this.file.lastModified();
  -            } catch (SecurityException se) {
  -                super.getLogger().warn("SecurityException", se);
  -            }
  -            return hasChanged;
           }
       }
   
  
  
  
  1.3.2.2   +162 -119  xml-cocoon2/src/org/apache/cocoon/components/language/markup/Logicsheet.java
  
  Index: Logicsheet.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/markup/Logicsheet.java,v
  retrieving revision 1.3.2.1
  retrieving revision 1.3.2.2
  diff -u -r1.3.2.1 -r1.3.2.2
  --- Logicsheet.java	2001/08/20 14:07:26	1.3.2.1
  +++ Logicsheet.java	2001/09/05 22:18:11	1.3.2.2
  @@ -9,7 +9,17 @@
   package org.apache.cocoon.components.language.markup;
   
   import org.apache.avalon.framework.logger.AbstractLoggable;
  +import org.apache.avalon.framework.component.ComponentManager;
  +import org.apache.avalon.framework.component.ComponentException;
  +
  +import org.apache.cocoon.environment.Source;
  +import org.apache.cocoon.environment.SourceResolver;
  +import org.apache.cocoon.environment.URLFactorySourceResolver;
   import org.apache.cocoon.util.TraxErrorHandler;
  +import org.apache.cocoon.components.url.URLFactory;
  +import org.apache.cocoon.components.xslt.XSLTProcessor;
  +import org.apache.cocoon.components.source.URLSource;
  +
   import org.xml.sax.Attributes;
   import org.xml.sax.InputSource;
   import org.xml.sax.SAXException;
  @@ -25,149 +35,182 @@
   import java.io.IOException;
   import java.util.HashMap;
   import java.util.Map;
  +import java.io.InputStream;
  +import java.net.URL;
  +import java.net.MalformedURLException;
   
   /**
    * A code-generation logicsheet. This class is actually a wrapper for
  - * a "standard" XSLT stylesheet stored as <code>trax.Templates</code> object.
  - * Though this will change shortly: a new markup language will be used
  - * for logicsheet authoring; logicsheets written in this language will be
  - * transformed into an equivalent XSLT stylesheet anyway... This class should probably be based on an interface...
  + * a "standard" XSLT stylesheet stored as <code>trax.Templates</code>
  + * object.  Though this will change shortly: a new markup language
  + * will be used for logicsheet authoring; logicsheets written in this
  + * language will be transformed into an equivalent XSLT stylesheet
  + * anyway... This class should probably be based on an interface...
  + *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
  - * @version CVS $Revision: 1.3.2.1 $ $Date: 2001/08/20 14:07:26 $
  + * @author <a href="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
  + * @version CVS $Revision: 1.3.2.2 $ $Date: 2001/09/05 22:18:11 $
    */
  -public class Logicsheet extends AbstractLoggable {
  -    /** The trax TransformerFactory */
  -    protected SAXTransformerFactory tfactory;
  -
  -    /** The trax templates */
  -    protected Templates templates;
  -
  -    /**
  -    * the template namespace's list
  -    */
  -    protected Map namespaces = new HashMap();
  -
  +public class Logicsheet extends AbstractLoggable
  +{
  +  /**
  +   * The Source object for this logicsheet.
  +   */
  +  Source source;
  +  
  +  /**
  +   * the template namespace's list
  +   */
  +  protected Map namespaces = new HashMap();
  +
  +  /**
  +   * The {@link org.apache.cocoon.components.xslt.XSLTProcessor} component.
  +   */
  +  XSLTProcessor xsltProcessor;
  +
  +  /**
  +   * The ComponentManager of this instance.
  +   */
  +  ComponentManager manager;
  +
  +  public Logicsheet(Source source, ComponentManager manager, SourceResolver resolver)
  +  {
  +    this.source = source;
  +    this.manager = manager;
  +    try {
  +      xsltProcessor = (XSLTProcessor)manager.lookup(XSLTProcessor.ROLE);
  +      xsltProcessor.setSourceResolver(resolver);
  +    }
  +    catch (ComponentException e) {
  +      getLogger().error("Cannot obtain XSLTProcessor component: " + e);
  +    }
  +  }
  +  
  +  /**
  +   * Creates a new <code>Logicsheet</code> instance given an URL to
  +   * containing the logicsheet, the {@link
  +   * org.apache.cocoon.components.url.URLFactory}, and a
  +   * <code>ComponentManager</code>.
  +   *
  +   * @param url an <code>URL</code> value
  +   * @param urlFactory an <code>URLFactory</code> value
  +   * @exception MalformedURLException if an error occurs
  +   * @exception IOException if an error occurs
  +   */
  +  public Logicsheet(URL url, URLFactory urlFactory, ComponentManager manager)
  +    throws MalformedURLException, IOException
  +  {
  +    this(url.toString(), urlFactory, manager);
  +  }
  +
  +  public Logicsheet(String systemId, URLFactory urlFactory,
  +                    ComponentManager manager)
  +    throws MalformedURLException, IOException
  +  {
  +    this.manager = manager;
  +    URL url = urlFactory.getURL(systemId);
  +    this.source = new URLSource(url, manager);
  +    try {
  +      xsltProcessor = (XSLTProcessor)manager.lookup(XSLTProcessor.ROLE);
  +      xsltProcessor.setSourceResolver(new URLFactorySourceResolver(urlFactory, manager));
  +    }
  +    catch (ComponentException e) {
  +      getLogger().error("Cannot obtain XSLTProcessor component: " + e);
  +    }
  +  }
  +  
  +  public String getSystemId()
  +  {
  +    return source.getSystemId();
  +  }
  +  
  +  /**
  +   * This will return the list of namespaces in this logicsheet.
  +   */
  +  public Map getNamespaces()
  +  {
  +    // Force the parsing of the Source or, if nothing changed,
  +    // return the old content of namespaces.
  +    getTransformerHandler();
  +    return namespaces;
  +  }
  +
  +  /**
  +   * Obtain the TransformerHandler object that will perform the
  +   * transformation associated with this logicsheet.
  +   *
  +   * @return a <code>TransformerHandler</code> value
  +   */
  +  public TransformerHandler getTransformerHandler()
  +  {
  +    try {
  +      // If the Source object is not changed, the
  +      // getTransformerHandler() of XSLTProcessor will simply return
  +      // the old template object. If the Source is unchanged, the
  +      // namespaces are not modified either.
  +      XMLFilter saveNSFilter = new SaveNamespaceFilter(namespaces);
  +      return xsltProcessor.getTransformerHandler(source, saveNSFilter);
  +    } catch (Exception e) {
  +      getLogger().error("Logicsheet.getTransformerHandler: Exception ", e);
  +    }
  +    return null;
  +  }
   
  -    /**
  -     * This will return the list of namespaces in this logicsheet.
  +  /**
  +   * This filter listen for source SAX events, and register the declared
  +   * namespaces into a <code>Map</code> object.
  +   *
  +   */
  +  protected class SaveNamespaceFilter extends XMLFilterImpl
  +  {
  +    private Map originalNamepaces;
  +
  +    /**
  +     * The contructor needs an initialized <code>Map</code> object where it
  +     * can store the found namespace declarations.
  +     * @param originalNamepaces a initialized <code>Map</code> instance.
        */
  -    public Map getNamespaces()
  +    public SaveNamespaceFilter(Map originalNamepaces)
       {
  -        return namespaces;
  +      this.originalNamepaces = originalNamepaces;
       }
   
       /**
  -     * Helper for TransformerFactory.
  +     * @param reader the parent reader
  +     * @see XMLFilter
        */
  -    private SAXTransformerFactory getTransformerFactory()
  +    public void setParent(XMLReader reader)
       {
  -        if(tfactory == null)  {
  -            tfactory = (SAXTransformerFactory) TransformerFactory.newInstance();
  -            tfactory.setErrorListener(new TraxErrorHandler(getLogger()));
  -        }
  -        return tfactory;
  +      super.setParent(reader);
  +      reader.setContentHandler(this);
       }
   
       /**
  -     * The constructor. It does preserve the namespace from the stylesheet.
  -     * @param inputSource The stylesheet's input source
  -     * @exception IOException IOError processing input source
  -     * @exception SAXException Input source parse error
  +     * @see ContentHandler
        */
  -    public void setInputSource(InputSource inputSource) throws SAXException, IOException {
  -        try {
  -            // Create a Templates ContentHandler to handle parsing of the
  -            // stylesheet.
  -            javax.xml.transform.sax.TemplatesHandler templatesHandler =
  -                                                getTransformerFactory().newTemplatesHandler();
  -
  -            // Create an XMLReader and set its ContentHandler.
  -            org.xml.sax.XMLReader reader =
  -                           org.xml.sax.helpers.XMLReaderFactory.createXMLReader();
  -            reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
  -
  -            // Create a XMLFilter that save the namespace hold in the stylesheet
  -            XMLFilter saveNSFilter = new SaveNamespaceFilter(namespaces);
  -            saveNSFilter.setParent(reader);
  -
  -            saveNSFilter.setContentHandler(templatesHandler);
  -            //reader.setContentHandler(templatesHandler);
  -
  -            // Parse the stylesheet.
  -            reader.parse(inputSource);
  -
  -            // Get the Templates object (generated during the parsing of the stylesheet)
  -            // from the TemplatesHandler.
  -            templates = templatesHandler.getTemplates();
  -        } catch (TransformerConfigurationException e) {
  -            getLogger().error("Logicsheet.setInputSource", e);
  -        }
  +    public void startDocument ()
  +      throws SAXException
  +    {
  +      super.startDocument();
       }
   
       /**
  -     * Get the TransformerHandler that performs the stylesheet transformation.
  -     * @return The TransformerHandler for the associated stylesheet.
  +     * @see ContentHandler
        */
  -    public TransformerHandler getTransformerHandler() {
  -        try {
  -            TransformerHandler handler = getTransformerFactory().newTransformerHandler(templates);
  -            handler.getTransformer().setErrorListener(new TraxErrorHandler(getLogger()));
  -            return handler;
  -        } catch (TransformerConfigurationException e) {
  -            getLogger().error("Logicsheet.getTransformerHandler:TransformerConfigurationException", e);
  -        } catch (Exception e) {
  -            getLogger().error("Logicsheet.getTransformerHandler:Exception", e);
  -        }
  -        return null;
  +    public void startPrefixMapping(String prefix, String uri)
  +      throws SAXException
  +    {
  +      originalNamepaces.put(prefix,uri);
  +      super.startPrefixMapping(prefix, uri);
       }
   
  -    /**
  -     * This filter listen for source SAX events, and register the declared
  -     * namespaces into a <code>Map</code> object.
  -     *
  -     */
  -    protected class SaveNamespaceFilter extends XMLFilterImpl {
  -
  -        private Map originalNamepaces;
  -
  -        /**
  -         * The contructor needs an initialized <code>Map</code> object where it
  -         * can store the found namespace declarations.
  -         * @param originalNamepaces a initialized <code>Map</code> instance.
  -         */
  -        public SaveNamespaceFilter(Map originalNamepaces) {
  -            this.originalNamepaces = originalNamepaces;
  -        }
  -
  -        /**
  -         * @param reader the parent reader
  -         * @see XMLFilter
  -         */
  -        public void setParent(XMLReader reader) {
  -            super.setParent(reader);
  -            reader.setContentHandler(this);
  -        }
  -
  -        /**
  -         * @see ContentHandler
  -         */
  -        public void startDocument () throws SAXException {
  -            super.startDocument();
  -        }
  -
  -        /**
  -         * @see ContentHandler
  -         */
  -        public void startPrefixMapping(String prefix, String uri) throws SAXException {
  -            originalNamepaces.put(prefix,uri);
  -            super.startPrefixMapping(prefix, uri);
  -        }
  -
  -        public void startElement (String namespaceURI, String localName,
  -                          String qName, Attributes atts) throws SAXException {
  -            super.startElement(namespaceURI, localName, qName, atts);
  -        }
  +    public void startElement (String namespaceURI, String localName,
  +                              String qName, Attributes atts)
  +      throws SAXException
  +    {
  +      super.startElement(namespaceURI, localName, qName, atts);
       }
  +  }
   
   }
  
  
  
  1.1.1.1.2.2 +13 -19    xml-cocoon2/src/org/apache/cocoon/components/language/markup/NamedLogicsheet.java
  
  Index: NamedLogicsheet.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/markup/NamedLogicsheet.java,v
  retrieving revision 1.1.1.1.2.1
  retrieving revision 1.1.1.1.2.2
  diff -u -r1.1.1.1.2.1 -r1.1.1.1.2.2
  --- NamedLogicsheet.java	2001/08/20 14:07:26	1.1.1.1.2.1
  +++ NamedLogicsheet.java	2001/09/05 22:18:11	1.1.1.1.2.2
  @@ -7,7 +7,11 @@
    *****************************************************************************/
   package org.apache.cocoon.components.language.markup;
   
  +import java.net.MalformedURLException;
  +import java.io.IOException;
   
  +import org.apache.avalon.framework.component.ComponentManager;
  +import org.apache.cocoon.components.url.URLFactory;
   
   /**
    * An extension to <code>Logicsheet</code> that is associated with a namespace.
  @@ -16,7 +20,8 @@
    * namespace
    *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
  - * @version CVS $Revision: 1.1.1.1.2.1 $ $Date: 2001/08/20 14:07:26 $
  + * @author <a href="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
  + * @version CVS $Revision: 1.1.1.1.2.2 $ $Date: 2001/09/05 22:18:11 $
    */
   public class NamedLogicsheet extends Logicsheet {
       /**
  @@ -29,6 +34,13 @@
       */
       protected String prefix;
   
  +  public NamedLogicsheet(String systemId, URLFactory urlFactory,
  +                         ComponentManager manager)
  +    throws MalformedURLException, IOException
  +  {
  +    super(systemId, urlFactory, manager);
  +  }
  +  
       /**
       * Set the logichseet's namespace prefix
       *
  @@ -45,23 +57,5 @@
       */
       public String getPrefix() {
           return this.prefix;
  -    }
  -
  -    /**
  -    * Set the logichseet's namespace uri
  -    *
  -    * @param prefix The namespace uri
  -    */
  -    public void setUri(String uri) {
  -        this.uri = uri;
  -    }
  -
  -    /**
  -    * Return the logicsheet's namespace uri
  -    *
  -    * @return The logicsheet's namespace uri
  -    */
  -    public String getUri() {
  -        return this.uri;
       }
   }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.10  +2 -2      xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/XSPFormValidatorHelper.java
  
  Index: XSPFormValidatorHelper.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/XSPFormValidatorHelper.java,v
  retrieving revision 1.1.2.9
  retrieving revision 1.1.2.10
  diff -u -r1.1.2.9 -r1.1.2.10
  --- XSPFormValidatorHelper.java	2001/08/22 03:57:58	1.1.2.9
  +++ XSPFormValidatorHelper.java	2001/09/05 22:18:11	1.1.2.10
  @@ -27,7 +27,7 @@
    * The <code>ValidatorActionResult</code> object helper
    *
    * @author <a href="mailto:haul@informatik.tu-darmstadt.de">Christian Haul</a>
  - * @version CVS $Revision: 1.1.2.9 $ $Date: 2001/08/22 03:57:58 $
  + * @version CVS $Revision: 1.1.2.10 $ $Date: 2001/09/05 22:18:11 $
    */
   public class XSPFormValidatorHelper {
     /**
  @@ -464,7 +464,7 @@
                       conf = new ConfigurationHelper();
           
                       SAXConfigurationHandler builder = new SAXConfigurationHandler();
  -                            source.stream(builder);
  +                    source.toSAX(builder);
           
                       conf.lastModified = source.getLastModified();
                       conf.configuration = builder.getConfiguration();
  
  
  
  1.1.1.1.2.3 +32 -8     xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/XSPObjectHelper.java
  
  Index: XSPObjectHelper.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/XSPObjectHelper.java,v
  retrieving revision 1.1.1.1.2.2
  retrieving revision 1.1.1.1.2.3
  diff -u -r1.1.1.1.2.2 -r1.1.1.1.2.3
  --- XSPObjectHelper.java	2001/08/20 14:07:27	1.1.1.1.2.2
  +++ XSPObjectHelper.java	2001/09/05 22:18:11	1.1.1.1.2.3
  @@ -8,6 +8,7 @@
   package org.apache.cocoon.components.language.markup.xsp;
   
   import org.apache.cocoon.xml.XMLFragment;
  +import org.apache.cocoon.xml.XMLizable;
   import org.apache.cocoon.xml.dom.DOMStreamer;
   import org.w3c.dom.Node;
   import org.xml.sax.ContentHandler;
  @@ -23,7 +24,7 @@
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
    * @author <a href="sylvain.wallez@anyware-tech.com">Sylvain Wallez</a>
    *         (Cocoon1 <code>xspExpr()</code> methods port)
  - * @version CVS $Revision: 1.1.1.1.2.2 $ $Date: 2001/08/20 14:07:27 $
  + * @version CVS $Revision: 1.1.1.1.2.3 $ $Date: 2001/09/05 22:18:11 $
    */
   public class XSPObjectHelper {
     /**
  @@ -253,14 +254,30 @@
       }
     }
   
  +// Now handled by XMLizable
  +//  /**
  +//   * Implementation of &lt;xsp:expr&gt; for <code>XMLFragment</code> :
  +//   * outputs the value by calling <code>v.toSax(contentHandler)</code>.
  +//   *
  +//   * @param contentHandler the SAX content handler
  +//   * @param v the XML fragment
  +//   */
  +//  public static void xspExpr(ContentHandler contentHandler, XMLFragment v) throws SAXException
  +//  {
  +//    if (v != null)
  +//    {
  +//      v.toSAX(contentHandler);
  +//    }
  +//  }
  +
     /**
  -   * Implementation of &lt;xsp:expr&gt; for <code>XMLFragment</code> :
  +   * Implementation of &lt;xsp:expr&gt; for <code>XMLizable</code> :
      * outputs the value by calling <code>v.toSax(contentHandler)</code>.
      *
      * @param contentHandler the SAX content handler
      * @param v the XML fragment
      */
  -  public static void xspExpr(ContentHandler contentHandler, XMLFragment v) throws SAXException
  +  public static void xspExpr(ContentHandler contentHandler, XMLizable v) throws SAXException
     {
       if (v != null)
       {
  @@ -335,13 +352,20 @@
       }
   
       // Check handled object types in case they were not typed in the XSP
  -
  -    // XMLFragment
  -    if (v instanceof XMLFragment)
  +    
  +    // XMLizable
  +    if (v instanceof XMLizable)
       {
  -      xspExpr(contentHandler, (XMLFragment)v);
  -      return;
  +        xspExpr(contentHandler, (XMLizable)v);
       }
  +
  +// Now handled by XMLizable
  +//    // XMLFragment
  +//    if (v instanceof XMLFragment)
  +//    {
  +//      xspExpr(contentHandler, (XMLFragment)v);
  +//      return;
  +//    }
   
       // Node
       if (v instanceof Node)
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.1   +5 -1      xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/java/log.xsl
  
  Index: log.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/java/log.xsl,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- log.xsl	2001/05/23 12:32:17	1.3
  +++ log.xsl	2001/09/05 22:18:12	1.3.2.1
  @@ -11,7 +11,7 @@
   
   <!--
    * @author <a href="mailto:bloritsch@apache.org>Berin Loritsch</a>
  - * @version CVS $Revision: 1.3 $ $Date: 2001/05/23 12:32:17 $
  + * @version CVS $Revision: 1.3.2.1 $ $Date: 2001/09/05 22:18:12 $
   -->
   
   <!-- XSP Response logicsheet for the Java language -->
  @@ -36,6 +36,7 @@
         </xsl:choose>
       </xsl:variable>
   
  +<!-- Files are now under control of LogKitManager
       <xsl:variable name="filename">
         <xsl:choose>
           <xsl:when test="@filename">"<xsl:value-of select="@filename"/>"</xsl:when>
  @@ -47,6 +48,7 @@
           <xsl:otherwise>""</xsl:otherwise>
         </xsl:choose>
       </xsl:variable>
  +-->
   
       <xsl:variable name="level">
         <xsl:choose>
  @@ -65,6 +67,7 @@
             try {
               String category = <xsl:value-of select="$name"/>;
               org.apache.log.Logger logger = org.apache.log.Hierarchy.getDefaultHierarchy().getLoggerFor("cocoon" + (("".equals(category))? category : "." + category));
  +<!--
               if ("".equals(<xsl:value-of select="$filename"/>) == false) {
                   String file = this.avalonContext.get(org.apache.cocoon.Constants.CONTEXT_LOG_DIR) + <xsl:value-of select="$filename"/>;
                   org.apache.log.LogTarget[] targets = new org.apache.log.LogTarget[] {
  @@ -72,6 +75,7 @@
                   };
                   logger.setLogTargets(targets);
               }
  +-->
               logger.setPriority(org.apache.log.Priority.getPriorityForName(<xsl:value-of select="$level"/>));
               this.setLogger(logger);
             } catch (Exception e) {
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.3   +31 -2     xml-cocoon2/src/org/apache/cocoon/components/parser/JaxpParser.java
  
  Index: JaxpParser.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/parser/JaxpParser.java,v
  retrieving revision 1.3.2.2
  retrieving revision 1.3.2.3
  diff -u -r1.3.2.2 -r1.3.2.3
  --- JaxpParser.java	2001/08/20 14:07:28	1.3.2.2
  +++ JaxpParser.java	2001/09/05 22:18:12	1.3.2.3
  @@ -7,7 +7,11 @@
    *****************************************************************************/
   package org.apache.cocoon.components.parser;
   
  +import org.apache.avalon.framework.component.ComponentException;
  +import org.apache.avalon.framework.component.ComponentManager;
  +import org.apache.avalon.framework.component.Composable;
   import org.apache.avalon.framework.thread.SingleThreaded;
  +import org.apache.cocoon.components.resolver.Resolver;
   import org.apache.cocoon.util.ClassUtils;
   import org.apache.cocoon.xml.AbstractXMLProducer;
   import org.w3c.dom.DOMImplementation;
  @@ -30,14 +34,23 @@
    * If only we can get rid of the need for the Document...
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.3.2.2 $ $Date: 2001/08/20 14:07:28 $
  + * @version CVS $Revision: 1.3.2.3 $ $Date: 2001/09/05 22:18:12 $
    */
   public class JaxpParser extends AbstractXMLProducer
  -implements Parser, ErrorHandler, SingleThreaded {
  +implements Parser, ErrorHandler, Composable, SingleThreaded {
   
  +    /** the SAX Parser factory */
       final SAXParserFactory factory = SAXParserFactory.newInstance();
  +
  +    /** the Document Builder factory */
       final DocumentBuilderFactory docfactory = DocumentBuilderFactory.newInstance();
   
  +    /** the component manager */
  +    protected ComponentManager manager;
  +
  +    /** the Entity Resolver */
  +    protected Resolver resolver = null;
  +
       public JaxpParser ()
       throws SAXException, ParserConfigurationException {
           this.factory.setNamespaceAware(true);
  @@ -46,6 +59,20 @@
           this.docfactory.setValidating(false);
       }
   
  +    /**
  +     * Get the Entity Resolver from the component manager
  +     */
  +    public void compose(ComponentManager manager) throws ComponentException {
  +      try {
  +        this.manager = manager;
  +        getLogger().debug("Looking up " + Resolver.ROLE);
  +        this.resolver = (Resolver)manager.lookup(Resolver.ROLE);
  +      } catch(ComponentException e) {
  +		// This exception is ok during initialization/startup.
  +        getLogger().debug("Error in JaxpParser: Cannot find " + Resolver.ROLE);
  +      }
  +    }
  +
       public void parse(InputSource in)
       throws SAXException, IOException {
           SAXParser parser = null;
  @@ -69,6 +96,8 @@
   
           reader.setErrorHandler(this);
           reader.setContentHandler(super.contentHandler);
  +		if(this.resolver != null)
  +			reader.setEntityResolver(this.resolver);
           reader.parse(in);
       }
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +1 -1      xml-cocoon2/src/org/apache/cocoon/components/renderer/ExtendableRendererFactory.java
  
  Index: ExtendableRendererFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/renderer/ExtendableRendererFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- ExtendableRendererFactory.java	2001/08/20 13:55:12	1.2
  +++ ExtendableRendererFactory.java	2001/09/05 22:18:12	1.2.2.1
  @@ -21,7 +21,7 @@
    * type. This factory is extendable as new <code>Renderer</code>s can
    * be added at runtime.
    * @author Davanum Srinivas
  - * @version $Revision: 1.2 $, $Date: 2001/08/20 13:55:12 $
  + * @version $Revision: 1.2.2.1 $, $Date: 2001/09/05 22:18:12 $
    */
   public class ExtendableRendererFactory implements RendererFactory {
   
  
  
  
  1.1.2.1   +1 -1      xml-cocoon2/src/org/apache/cocoon/components/renderer/RendererFactory.java
  
  Index: RendererFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/renderer/RendererFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- RendererFactory.java	2001/08/14 14:44:33	1.1
  +++ RendererFactory.java	2001/09/05 22:18:12	1.1.2.1
  @@ -13,7 +13,7 @@
    * Apache FOP Renderer factory.
    * When given a MIME type, find a Renderer which supports that MIME type.
    * @author Davanum Srinivas
  - * @version $Revision: 1.1 $, $Date: 2001/08/14 14:44:33 $
  + * @version $Revision: 1.1.2.1 $, $Date: 2001/09/05 22:18:12 $
    */
   public interface RendererFactory {
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +1 -1      xml-cocoon2/src/org/apache/cocoon/components/resolver/Resolver.java
  
  Index: Resolver.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/resolver/Resolver.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- Resolver.java	2001/08/30 19:15:43	1.2
  +++ Resolver.java	2001/09/05 22:18:12	1.2.2.1
  @@ -18,7 +18,7 @@
    * A component that uses catalogs for resolving Entities.
    *
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
  - * @version CVS $Revision: 1.2 $ $Date: 2001/08/30 19:15:43 $
  + * @version CVS $Revision: 1.2.2.1 $ $Date: 2001/09/05 22:18:12 $
    */
   public interface Resolver extends Component, EntityResolver {
   
  
  
  
  1.2.2.1   +1 -1      xml-cocoon2/src/org/apache/cocoon/components/resolver/ResolverImpl.java
  
  Index: ResolverImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/resolver/ResolverImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- ResolverImpl.java	2001/09/05 12:40:41	1.2
  +++ ResolverImpl.java	2001/09/05 22:18:12	1.2.2.1
  @@ -37,7 +37,7 @@
    * http://www.oasis-open.org/committees/entity/spec.html
    *
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
  - * @version CVS $Revision: 1.2 $ $Date: 2001/09/05 12:40:41 $
  + * @version CVS $Revision: 1.2.2.1 $ $Date: 2001/09/05 22:18:12 $
    */
   public class ResolverImpl extends AbstractLoggable
           implements Resolver, Contextualizable, Composable, Configurable, ThreadSafe, Disposable {
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.16  +25 -31    xml-cocoon2/src/org/apache/cocoon/components/source/SitemapSource.java
  
  Index: SitemapSource.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/source/SitemapSource.java,v
  retrieving revision 1.1.2.15
  retrieving revision 1.1.2.16
  diff -u -r1.1.2.15 -r1.1.2.16
  --- SitemapSource.java	2001/08/22 03:57:58	1.1.2.15
  +++ SitemapSource.java	2001/09/05 22:18:12	1.1.2.16
  @@ -3,7 +3,7 @@
    * ------------------------------------------------------------------------- *
    * This software is published under the terms of the Apache Software License *
    * version 1.1, a copy of which has been included  with this distribution in *
  - * the LICENSE file.                                                         *
  + * the LICENSE file.                               s                          *
    *****************************************************************************/
   
   package org.apache.cocoon.components.source;
  @@ -20,6 +20,7 @@
   import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.environment.Request;
   import org.apache.cocoon.environment.Source;
  +import org.apache.cocoon.environment.ModifiableSource;
   import org.apache.cocoon.environment.wrapper.EnvironmentWrapper;
   import org.apache.cocoon.serialization.Serializer;
   import org.apache.cocoon.sitemap.Sitemap;
  @@ -33,6 +34,7 @@
   import org.xml.sax.ContentHandler;
   import org.xml.sax.InputSource;
   import org.xml.sax.SAXException;
  +import org.w3c.dom.Node;
   
   import java.io.ByteArrayInputStream;
   import java.io.ByteArrayOutputStream;
  @@ -45,12 +47,12 @@
    * Description of a source which is defined by a pipeline.
    *
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.1.2.15 $ $Date: 2001/08/22 03:57:58 $
  + * @version CVS $Revision: 1.1.2.16 $ $Date: 2001/09/05 22:18:12 $
    */
   
   public final class SitemapSource
   extends AbstractXMLConsumer
  -implements Source {
  +implements ModifiableSource {
   
       /** The last modification date or 0 */
       private long lastModificationDate;
  @@ -82,8 +84,8 @@
       /** The redirect <code>Source</code> */
       private Source redirectSource;
   
  -    /** The <code>ProcessingException</code> if unable to get resource */
  -    private ProcessingException exception;
  +    /** The <code>SAXException</code> if unable to get resource */
  +    private SAXException exception;
   
       /**
        * Construct a new object
  @@ -96,7 +98,7 @@
       throws IOException, ProcessingException {
   
           this.manager = manager;
  -
  +        this.setLogger(logger);
           // remove the protocol
           int protocolEnd = uri.indexOf(':');
           if (protocolEnd != -1) {
  @@ -141,7 +143,6 @@
               uri = uri.substring(0, queryStringPos);
           }
           this.uri = uri;
  -        this.environment.setURI(this.prefix, this.uri);
           this.refresh();
       }
   
  @@ -168,7 +169,7 @@
       throws ProcessingException, IOException {
           // VG: Why exception is not thrown in constructor?
           if (this.exception != null) {
  -            throw this.exception;
  +            throw new ProcessingException(this.exception);
           }
           SitemapComponentSelector serializerSelector = null;
           Serializer serializer = null;
  @@ -179,13 +180,11 @@
               ByteArrayOutputStream os = new ByteArrayOutputStream();
               serializer.setOutputStream(os);
   
  -            this.stream(serializer);
  +            this.toSAX(serializer);
   
               return new ByteArrayInputStream(os.toByteArray());
           } catch (ComponentException cme) {
               throw new ProcessingException("could not lookup pipeline components", cme);
  -        } catch (ProcessingException e) {
  -            throw e;
           } catch (Exception e) {
               throw new ProcessingException("Exception during processing of " + this.systemId, e);
           } finally {
  @@ -234,11 +233,11 @@
               ((XMLProducer)eventPipeline).setConsumer(this);
   
               this.environment.setURI(this.prefix, this.uri);
  -                this.processor.process(this.environment, pipeline, eventPipeline);
  +            this.processor.process(this.environment, pipeline, eventPipeline);
  +            this.environment.changeToLastContext();
                   String redirectURL = this.environment.getRedirectURL();
                   if (redirectURL == null) {
                       if (this.eventPipeline instanceof CacheableEventPipeline) {
  -                    this.environment.setURI(this.prefix, this.uri);
                           CacheableEventPipeline cep = (CacheableEventPipeline)this.eventPipeline;
                           PipelineCacheKey pck = cep.generateKey(this.environment);
                           Map validity = null;
  @@ -259,12 +258,10 @@
                       this.redirectSource = this.environment.resolve(redirectURL);
                       this.lastModificationDate = this.redirectSource.getLastModified();
                   }
  -        } catch (ProcessingException e) {
  -            reset();
  -            this.exception = e;
           } catch (Exception e) {
               reset();
  -            this.exception = new ProcessingException("Could not get sitemap source " + this.systemId, e);
  +            this.exception = new SAXException("Could not get sitemap source "
  +                                              + this.systemId, e);
           }
       }
   
  @@ -281,26 +278,23 @@
       /**
        * Stream content to the consumer
        */
  -    public void stream(XMLConsumer consumer)
  -    throws ProcessingException, SAXException, IOException {
  +    public void toSAX(XMLConsumer consumer)
  +    throws SAXException {
           if (this.exception != null) {
               throw this.exception;
           }
           try {
  -
               if (this.redirectSource != null) {
  -                this.redirectSource.stream(consumer);
  +                this.redirectSource.toSAX(consumer);
               } else {
  -                this.environment.setURI(this.prefix, this.uri);
  -                    ((XMLProducer)eventPipeline).setConsumer(consumer);
  -                    eventPipeline.process(this.environment);
  +                ((XMLProducer)eventPipeline).setConsumer(consumer);
  +                eventPipeline.process(this.environment);
               }
           } catch (ComponentException cme) {
  -            throw new ProcessingException("could not lookup pipeline components", cme);
  -        } catch (ProcessingException e) {
  -            throw e;
  +            throw new SAXException("could not lookup pipeline components", cme);
           } catch (Exception e) {
  -            throw new ProcessingException("Exception during processing of " + this.systemId, e);
  +            throw new SAXException("Exception during processing of "
  +                                   + this.systemId, e);
           } finally {
               reset();
           }
  @@ -309,9 +303,9 @@
       /**
        * Stream content to the content handler
        */
  -    public void stream(ContentHandler contentHandler)
  -    throws ProcessingException, SAXException, IOException {
  -        this.stream(new ContentHandlerWrapper(contentHandler));
  +    public void toSAX(ContentHandler contentHandler)
  +    throws SAXException {
  +        this.toSAX(new ContentHandlerWrapper(contentHandler));
       }
   
       private void reset() {
  
  
  
  1.1.2.9   +29 -61    xml-cocoon2/src/org/apache/cocoon/components/source/URLSource.java
  
  Index: URLSource.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/source/URLSource.java,v
  retrieving revision 1.1.2.8
  retrieving revision 1.1.2.9
  diff -u -r1.1.2.8 -r1.1.2.9
  --- URLSource.java	2001/08/22 03:57:58	1.1.2.8
  +++ URLSource.java	2001/09/05 22:18:12	1.1.2.9
  @@ -12,7 +12,7 @@
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.components.parser.Parser;
  -import org.apache.cocoon.environment.Source;
  +import org.apache.cocoon.environment.ModifiableSource;
   import org.apache.cocoon.xml.XMLConsumer;
   import org.xml.sax.ContentHandler;
   import org.xml.sax.InputSource;
  @@ -30,11 +30,10 @@
    * Description of a source which is described by an URL.
    *
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.1.2.8 $ $Date: 2001/08/22 03:57:58 $
  + * @version CVS $Revision: 1.1.2.9 $ $Date: 2001/09/05 22:18:12 $
    */
   
  -public final class URLSource
  -implements Source {
  +public final class URLSource implements ModifiableSource {
   
       /** Identifier for file urls */
       private final String FILE = "file:";
  @@ -187,25 +186,6 @@
       }
   
       /**
  -     * Is this a file, then the <code>getFile</code> method can
  -     * return a <code>File</code> object for this source.
  -     */
  -    public boolean isFile() {
  -        return this.isFile;
  -    }
  -
  -    /**
  -     * Return a <code>File</code> object if this is a local file
  -     * (if the <code>isFile</code> method returns true).
  -     */
  -    public File getFile() {
  -        if (this.isFile == true) {
  -            return new File(this.systemId.substring(FILE.length()));
  -        }
  -        return null;
  -    }
  -
  -    /**
        * Refresh this object and update the last modified date
        * and content length.
        */
  @@ -306,43 +286,31 @@
            return new String ( out );
        }
   
  -    /**
  -     * Stream content to the consumer
  -     */
  -    public void stream(XMLConsumer consumer)
  -    throws ProcessingException, SAXException, IOException {
  -        Parser parser = null;
  -        try {
  -            parser = (Parser)this.manager.lookup(Parser.ROLE);
  -
  -            parser.setConsumer(consumer);
  -            parser.parse(this.getInputSource());
  -        } catch (ComponentException e){
  -            throw new ProcessingException("Exception in URLSource.stream()", e);
  -        } finally {
  -            if (parser != null) this.manager.release(parser);
  -        }
  -    }
  -
  -    /**
  -     * Stream content to the content handler
  -     */
  -    public void stream(ContentHandler contentHandler)
  -    throws ProcessingException, SAXException, IOException {
  -        Parser parser = null;
  -        try {
  -            parser = (Parser)this.manager.lookup(Parser.ROLE);
  -
  -            parser.setContentHandler(contentHandler);
  -            parser.parse(this.getInputSource());
  -        } catch (ComponentException e){
  -            throw new ProcessingException("Exception in URLSource.stream()", e);
  -        } finally {
  -            if (parser != null) this.manager.release(parser);
  -        }
  -    }
  -
  -    public void recycle() {
  -    }
  +  /**
  +   * Stream content to a content handler or to an XMLConsumer
  +   */
  +  public void toSAX(ContentHandler handler)
  +    throws SAXException
  +  {
  +    Parser parser = null;
  +    try {
  +      parser = (Parser)this.manager.lookup(Parser.ROLE);
  +
  +      if (handler instanceof XMLConsumer)
  +        parser.setConsumer((XMLConsumer)handler);
  +      else
  +        parser.setContentHandler(handler);
  +
  +      parser.parse(this.getInputSource());
  +    } catch (Exception e){
  +      throw new SAXException("Exception in URLSource.stream()", e);
  +    } finally {
  +      if (parser != null) this.manager.release(parser);
  +    }
  +  }
  +
  +  public void recycle()
  +  {
  +  }
   }
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.1.1.2.4 +2 -0      xml-cocoon2/src/org/apache/cocoon/components/store/FilesystemStore.java
  
  Index: FilesystemStore.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/store/FilesystemStore.java,v
  retrieving revision 1.1.1.1.2.3
  retrieving revision 1.1.1.1.2.4
  diff -u -r1.1.1.1.2.3 -r1.1.1.1.2.4
  --- FilesystemStore.java	2001/08/20 14:07:29	1.1.1.1.2.3
  +++ FilesystemStore.java	2001/09/05 22:18:13	1.1.1.1.2.4
  @@ -180,6 +180,8 @@
       return null;
     }
   
  +  public void free() {}  
  +
     public Object getObject(Object key)
       throws IOException, ClassNotFoundException
     {
  
  
  
  1.2.2.16  +35 -133   xml-cocoon2/src/org/apache/cocoon/components/store/MRUMemoryStore.java
  
  Index: MRUMemoryStore.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/store/MRUMemoryStore.java,v
  retrieving revision 1.2.2.15
  retrieving revision 1.2.2.16
  diff -u -r1.2.2.15 -r1.2.2.16
  --- MRUMemoryStore.java	2001/08/28 13:31:32	1.2.2.15
  +++ MRUMemoryStore.java	2001/09/05 22:18:13	1.2.2.16
  @@ -48,29 +48,8 @@
   public class MRUMemoryStore extends AbstractLoggable implements Store, Configurable, 
                                                                   ThreadSafe, Runnable, 
                                                                   Composable, Contextualizable {
  + 
     /**
  -   * Indicates how much memory should be left free in the JVM for
  -   * normal operation.
  -   */
  -  private int freememory;
  -
  -  /**
  -   * Indicates how big the heap size can grow to before the cleanup thread kicks in.
  -   * The default value is based on the default maximum heap size of 64Mb.
  -   */
  -  private int heapsize;
  -
  -  /**
  -   * Indicates the time in seconds to sleep between memory checks.
  -   */
  -  private long cleanupthreadinterval;
  -
  -  /**
  -   * Indicates whether we use a cleanup thread or not.
  -   */
  -  private boolean usecleanupthread;
  -
  -  /**
      * Indicates the daemon thread priority.
      */
     private int priority;
  @@ -98,6 +77,7 @@
      */
     private File cachefile;
     private Store fsstore;
  +  private StoreJanitor storejanitor;
     private Stack writerstack;
     private Thread writer;
     private File cachedir;
  @@ -115,6 +95,8 @@
         this.manager = manager;
         getLogger().debug("Looking up " + Store.ROLE + "/Filesystem");
         this.fsstore = (Store)manager.lookup(Store.ROLE + "/Filesystem");
  +      getLogger().debug("Looking up " + StoreJanitor.ROLE);
  +      this.storejanitor = (StoreJanitor)manager.lookup(StoreJanitor.ROLE);
       } catch(ComponentException e) {
         getLogger().error("Error in compose()!", e);
       }
  @@ -144,24 +126,19 @@
      * Initialize the MRUMemoryStore.
      * A few options can be used :
      * <UL>
  -   *  <LI>freememory = How much memory to keep free for normal jvm operation. (Default: 1 Mb)</LI>
  -   *  <LI>heapsize = The size of the heap before cleanup starts. (Default: 60 Mb)</LI>
  -   *  <LI>cleanupthreadinterval = time in seconds to sleep between memory checks (Default: 10 seconds)</LI>
      *  <LI>maxobjects = how many objects will be stored in memory (Default: 10o objects)</LI>
      *  <LI>threadpriority = priority of the thread (1-10). (Default: 10)</LI>
      *  <LI>filesystem = use filesystem storage to keep object persistent (Default: false)</LI>
  -   *  <LI>usecleanupthread = use a cleanup daemon thread. (Default: true)</LI>     
      * </UL>
      */
     public void configure(Configuration conf) throws ConfigurationException {
       this.jvm         = Runtime.getRuntime();
       this.mrulist     = new LinkedList();
       this.writerstack = new Stack();
  +
  +    this.storejanitor.register(this);
     
       Parameters params = Parameters.fromConfiguration(conf);
  -    this.freememory            = params.getParameterAsInteger("freememory",1000000);
  -    this.heapsize              = params.getParameterAsInteger("heapsize",60000000);
  -    this.cleanupthreadinterval = params.getParameterAsInteger("cleanupthreadinterval",10);
       this.maxobjects            = params.getParameterAsInteger("maxobjects",100);
       this.cache                 = new HashMap((int)(this.maxobjects * 1.2));
       this.priority              = params.getParameterAsInteger("threadpriority",Thread.currentThread().getPriority());
  @@ -172,21 +149,7 @@
       if ((this.maxobjects < 1)) {
         throw new ConfigurationException("MRUMemoryStore maxobjects must be at least 1 milli second!");
       }
  -    if ((this.cleanupthreadinterval < 1)) {
  -      throw new ConfigurationException("MRUMemoryStore cleanup thread interval must be at least 1 second!");
  -    }
   
  -    this.usecleanupthread = params.getParameter("usecleanupthread","true").equals("true");
  -    
  -    if (this.usecleanupthread) {
  -      getLogger().debug("Intializing checker thread");
  -      Thread checker = new Thread(this);
  -      checker.setPriority(this.priority);
  -      checker.setDaemon(true);
  -      checker.setName("checker");
  -      checker.start();
  -    }
  -  
       if (this.filesystem) {
         getLogger().debug("Intializing writer thread");
         writer = new Thread(this);
  @@ -204,62 +167,28 @@
      * Thread writer writes objects from the writer stack onto the filesystem.
      */
     public void run() {
  -    if(Thread.currentThread().getName().equals("checker")) {
  -      while (true) {
  -        // amount of memory used is greater then heapsize
  -        if (memoryLow()) {
  -          getLogger().debug("Invoking garbage collection, total memory = "
  -              + this.jvm.totalMemory() + ", free memory = " 
  -              + this.jvm.freeMemory());
  -          this.jvm.runFinalization();
  -          this.jvm.gc();
  -          getLogger().debug("Garbage collection complete, total memory = "
  -              + this.jvm.totalMemory() + ", free memory = "
  -              + this.jvm.freeMemory());
  -          getLogger().debug("Store size BEFORE cleanup=" + this.cache.size());
  -          synchronized (this) {
  -            while ((this.cache.size() > 0) && memoryLow()) {
  -              this.free();
  -            }
  -          }
  -          getLogger().debug("Store size AFTER cleanup=" + this.cache.size());
  -        }
  -
  +    while (true) {
  +      getLogger().debug("Writerthread awake!");
  +      while(!writerstack.empty()) {
           try {
  -          Thread.currentThread().sleep(this.cleanupthreadinterval * 1000);
  -        } catch (InterruptedException ignore) {}
  -      }
  -    } else if(Thread.currentThread().getName().equals("writer")) {
  -      while (true) {
  -        getLogger().debug("Writerthread awake!");
  -        while(!writerstack.empty()) {
  -          try {
  -            TmpStackObject tmp = (TmpStackObject)this.writerstack.pop();
  -            this.fsstore.store(getFileName(tmp.getKey().toString()), tmp.getObject());
  -          } catch(IOException e) {  
  -            getLogger().error("Error in writer thread",e);
  -          } catch(Exception ex) {
  -            getLogger().error("Error in writer thread",ex);
  -          }
  +          TmpStackObject tmp = (TmpStackObject)this.writerstack.pop();
  +          this.fsstore.store(getFileName(tmp.getKey().toString()), tmp.getObject());
  +        } catch(IOException e) {  
  +          getLogger().error("Error in writer thread",e);
  +        } catch(Exception ex) {
  +          getLogger().error("Error in writer thread",ex);
           }
  +      }
   
  -        synchronized (this.writer) {
  -          try {
  -            writer.wait();
  -          } catch (InterruptedException ignored) {}
  -        }
  +      synchronized (this.writer) {
  +        try {
  +          writer.wait();
  +        } catch (InterruptedException ignored) {}
         }
       }
     }
  -  
  + 
     /**
  -   * Method to check if memory is running low in the jvm.
  -   */
  -  private boolean memoryLow() {
  -    return jvm.totalMemory() > heapsize && jvm.freeMemory() < freememory;
  -  }
  -
  -  /**
      * Store the given object in a persistent state. It is up to the
      * caller to ensure that the key has a persistent state across
      * different JVM executions.
  @@ -298,6 +227,7 @@
       this.cache.put(key, value);
       this.mrulist.remove(key);
       this.mrulist.addFirst(key);
  +    getLogger().debug("Cache size=" + cache.size());
     }
   
     /**
  @@ -336,7 +266,6 @@
           }
         }
       }
  -
       return null;
     }
   
  @@ -376,10 +305,12 @@
      */
     public void free() {
       try {
  -      this.cache.remove(this.mrulist.getLast());
  -      this.mrulist.removeLast();
  -      this.jvm.runFinalization();
  -      this.jvm.gc();
  +      if(this.cache.size() > 0) {
  +        this.getLogger().debug("Freeing cache");
  +        this.cache.remove(this.mrulist.getLast());
  +        this.mrulist.removeLast();
  +        getLogger().debug("Cache size=" + cache.size());
  +      }
       } catch (Exception e) {
         getLogger().error("Error in free()", e);
       }
  @@ -405,44 +336,15 @@
         return false;
       }
     }
  -
  -    private String getFileName(String key)
  -    {
  -        return new StringBuffer()
  -            .append(this.cachedirstr)
  -            .append(File.separator)
  -//            .append(HashUtil.hash(key.toString()) & 0x1F)
  -//            .append(File.separator)
  -            .append(URLEncoder.encode(key.toString()))
  -            .toString();
  -    }
   
  -  /**
  -   * Container object for the documents.
  -  class CacheObject {
  -    private long time = -1;
  -    private Object cacheObject;
  -    private boolean serialised;
  -
  -    public CacheObject(Object ToCacheObject, long lTime, boolean serialised) {
  -      this.cacheObject = ToCacheObject;
  -      this.time = lTime;
  -      this.serialised = serialised;
  -    }
  -
  -    public Object getCacheObject() {
  -      return this.cacheObject;
  -    }
  -
  -    public long getCreateTime() {
  -      return this.time;
  -    }
  -
  -    public boolean getSerialisedFlag() {
  -      return this.serialised;
  -    }
  +  private String getFileName(String key)
  +  {
  +      return new StringBuffer()
  +          .append(this.cachedirstr)
  +          .append(File.separator)
  +          .append(URLEncoder.encode(key.toString()))
  +          .toString();
     }
  -   */
   
     /**
      * Temporary container object for the writerstack
  
  
  
  1.1.1.1.2.2 +3 -1      xml-cocoon2/src/org/apache/cocoon/components/store/MemoryStore.java
  
  Index: MemoryStore.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/store/MemoryStore.java,v
  retrieving revision 1.1.1.1.2.1
  retrieving revision 1.1.1.1.2.2
  diff -u -r1.1.1.1.2.1 -r1.1.1.1.2.2
  --- MemoryStore.java	2001/08/20 14:07:29	1.1.1.1.2.1
  +++ MemoryStore.java	2001/09/05 22:18:13	1.1.1.1.2.2
  @@ -20,7 +20,7 @@
    *         (Apache Software Foundation)
    * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
    *         (Apache Software Foundation, Exoffice Technologies)
  - * @version CVS $Revision: 1.1.1.1.2.1 $ $Date: 2001/08/20 14:07:29 $
  + * @version CVS $Revision: 1.1.1.1.2.2 $ $Date: 2001/09/05 22:18:13 $
    */
   public class MemoryStore implements Store, ThreadSafe {
       /* WARNING: Hashtable is threadsafe, whereas HashMap is not.
  @@ -67,6 +67,8 @@
       public void remove(Object key) {
           table.remove(key);
       }
  +
  +    public void free() {}
   
       /**
        * Indicates if the given key is associated to a contained object.
  
  
  
  1.1.1.1.2.3 +3 -1      xml-cocoon2/src/org/apache/cocoon/components/store/Store.java
  
  Index: Store.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/store/Store.java,v
  retrieving revision 1.1.1.1.2.2
  retrieving revision 1.1.1.1.2.3
  diff -u -r1.1.1.1.2.2 -r1.1.1.1.2.3
  --- Store.java	2001/08/20 14:07:29	1.1.1.1.2.2
  +++ Store.java	2001/09/05 22:18:13	1.1.1.1.2.3
  @@ -20,7 +20,7 @@
    *         (Apache Software Foundation)
    * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
    *         (Apache Software Foundation, Exoffice Technologies)
  - * @version CVS $Revision: 1.1.1.1.2.2 $ $Date: 2001/08/20 14:07:29 $
  + * @version CVS $Revision: 1.1.1.1.2.3 $ $Date: 2001/09/05 22:18:13 $
    */
   public interface Store extends Component {
   
  @@ -44,6 +44,8 @@
        * virtual machine is restarted or some error happens.
        */
       void hold(Object key, Object value) throws IOException;
  +
  +    void free();
   
       /**
        * Remove the object associated to the given key.
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +0 -0      xml-cocoon2/src/org/apache/cocoon/components/store/StoreJanitor.java
  
  Index: StoreJanitor.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/store/StoreJanitor.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-cocoon2/src/org/apache/cocoon/components/store/StoreJanitorImpl.java
  
  Index: StoreJanitorImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/store/StoreJanitorImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.1   +0 -0      xml-cocoon2/src/org/apache/cocoon/components/xslt/XSLTProcessor.java
  
  Index: XSLTProcessor.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/xslt/XSLTProcessor.java,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  
  
  
  1.4.2.1   +0 -0      xml-cocoon2/src/org/apache/cocoon/components/xslt/XSLTProcessorImpl.java
  
  Index: XSLTProcessorImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/xslt/XSLTProcessorImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.6.2.12  +32 -8     xml-cocoon2/src/org/apache/cocoon/environment/AbstractEnvironment.java
  
  Index: AbstractEnvironment.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/environment/AbstractEnvironment.java,v
  retrieving revision 1.6.2.11
  retrieving revision 1.6.2.12
  diff -u -r1.6.2.11 -r1.6.2.12
  --- AbstractEnvironment.java	2001/08/20 21:49:14	1.6.2.11
  +++ AbstractEnvironment.java	2001/09/05 22:18:13	1.6.2.12
  @@ -24,7 +24,7 @@
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.6.2.11 $ $Date: 2001/08/20 21:49:14 $
  + * @version CVS $Revision: 1.6.2.12 $ $Date: 2001/09/05 22:18:13 $
    */
   public abstract class AbstractEnvironment extends AbstractLoggable implements Environment {
   
  @@ -100,8 +100,7 @@
       /**
        * Get the <code>SourceHandler</code> for the current request
        */
  -    public SourceHandler getSourceHandler()
  -    {
  +    public SourceHandler getSourceHandler() {
           return this.sourceHandler;
       }
   
  @@ -128,14 +127,13 @@
           return this.rootContext;
       }
   
  +    /**
  +     * Get the current Context
  +     */
       public URL getContext() {
           return this.context;
       }
   
  -    public void setContext(URL context) {
  -        this.context = context;
  -    }
  -
       /**
        * Get the prefix of the URI in progress
        */
  @@ -144,6 +142,32 @@
       }
   
       /**
  +     * Set the prefix of the URI in progress
  +     */
  +    protected void setURIPrefix(String prefix) {
  +        getLogger().debug("Set the URI Prefix (OLD=" + this.prefix.toString() + ", NEW=" +  prefix + ")");
  +        this.prefix = new StringBuffer(prefix);
  +    }
  +
  +    /**
  +     * Set the context.
  +     */
  +    protected void setContext(URL context) {
  +        this.context = context;
  +    }
  +
  +    /**
  +     * Set the context. This is similar to changeContext()
  +     * except that it is absolute.
  +     */
  +    public void setContext(String prefix, String uri) {
  +        this.setContext(getRootContext());
  +        this.setURIPrefix(prefix == null ? "" : prefix);
  +        this.uris = uri;
  +        getLogger().debug("Reset context to " + this.context);
  +    }
  +
  +    /**
        * Adds an prefix to the overall stripped off prefix from the request uri
        */
       public void changeContext(String prefix, String context)
  @@ -241,7 +265,7 @@
        */
       public Source resolve(String systemId)
       throws ProcessingException, SAXException, IOException {
  -        this.getLogger().debug("Resolving '"+systemId+"'");
  +        this.getLogger().debug("Resolving '"+systemId+"' in context '" + this.context + "'");
           if (systemId == null) throw new SAXException("Invalid System ID");
   
           Source source;
  
  
  
  1.2.2.9   +11 -7     xml-cocoon2/src/org/apache/cocoon/environment/Environment.java
  
  Index: Environment.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/environment/Environment.java,v
  retrieving revision 1.2.2.8
  retrieving revision 1.2.2.9
  diff -u -r1.2.2.8 -r1.2.2.9
  --- Environment.java	2001/08/20 21:49:14	1.2.2.8
  +++ Environment.java	2001/09/05 22:18:13	1.2.2.9
  @@ -20,7 +20,7 @@
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.2.2.8 $ $Date: 2001/08/20 21:49:14 $
  + * @version CVS $Revision: 1.2.2.9 $ $Date: 2001/09/05 22:18:13 $
    */
   
   public interface Environment extends SourceResolver {
  @@ -46,16 +46,14 @@
       String getURIPrefix();
   
       /**
  -     * Get current context
  +     * Get the Root Context
        */
  -    URL getContext();
  -
  -    void setContext(URL url);
  +    URL getRootContext();
   
       /**
  -     * Get the Root Context
  +     * Get current context
        */
  -    URL getRootContext();
  +    URL getContext();
   
       /**
        * Get the view to process
  @@ -66,6 +64,12 @@
        * Get the action to process
        */
       String getAction();
  +
  +    /**
  +     * Set the context. This is similar to changeContext()
  +     * except that it is absolute.
  +     */
  +    void setContext(String prefix, String uri);
   
       /**
        * Change the context from uriprefix to context
  
  
  
  1.6.2.5   +38 -64    xml-cocoon2/src/org/apache/cocoon/environment/Source.java
  
  Index: Source.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/environment/Source.java,v
  retrieving revision 1.6.2.4
  retrieving revision 1.6.2.5
  diff -u -r1.6.2.4 -r1.6.2.5
  --- Source.java	2001/08/22 03:57:58	1.6.2.4
  +++ Source.java	2001/09/05 22:18:13	1.6.2.5
  @@ -9,83 +9,57 @@
   package org.apache.cocoon.environment;
   
   import org.apache.avalon.excalibur.pool.Recyclable;
  +import org.apache.cocoon.xml.XMLizable;
   import org.apache.cocoon.ProcessingException;
  -import org.apache.cocoon.xml.XMLConsumer;
  -import org.xml.sax.ContentHandler;
   import org.xml.sax.InputSource;
  -import org.xml.sax.SAXException;
   
  -import java.io.File;
  -import java.io.IOException;
   import java.io.InputStream;
  +import java.io.IOException;
   
   /**
    * Description of a source. This interface provides a simple interface
  - * for accessing any resource (URL, local file etc).
  + * for accessing a source of data. The source of data is assumed to
  + * <b>not change</b> during the lifetime of the Source object. If you
  + * have a data source that can change its content and you want it to
  + * reflect in Cocoon, use a {@link ModifiableSource} object instead.
    *
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.6.2.4 $ $Date: 2001/08/22 03:57:58 $
  + * @author <a href="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
  + * @version CVS $Revision: 1.6.2.5 $ $Date: 2001/09/05 22:18:13 $
    */
   
  -public interface Source extends Recyclable {
  -    /**
  -     * Get the last modification date of the source or 0 if it
  -     * is not possible to determine the date.
  -     */
  -    long getLastModified();
  -
  -    /**
  -     * Get the content length of the source or -1 if it
  -     * is not possible to determine the length.
  -     */
  -    long getContentLength();
  -
  -    /**
  -     * Return an <code>InputStream</code> object to read from the source.
  -     */
  -    InputStream getInputStream()
  +public interface Source extends Recyclable, XMLizable {
  +  /**
  +   * Get the last modification date of the source or 0 if it
  +   * is not possible to determine the date.
  +   */
  +  long getLastModified();
  +
  +  /**
  +   * Get the content length of the source or -1 if it
  +   * is not possible to determine the length.
  +   */
  +  long getContentLength();
  +
  +  /**
  +   * Return an <code>InputStream</code> object to read from the source.
  +   */
  +  InputStream getInputStream()
       throws ProcessingException, IOException;
   
  -    /**
  -     * Return the unique identifer for this source
  -     */
  -    String getSystemId();
  -
  -    /**
  -     * Is this a file, then the <code>getFile</code> method can
  -     * return a <code>File</code> object for this source.
  -     */
  -    boolean isFile();
  -
  -    /**
  -     * Return a <code>File</code> object if this is a local file
  -     * (if the <code>isFile</code> method returns true).
  -     */
  -    File getFile();
  -
  -    /**
  -     * Refresh this object and update the last modified date
  -     * and content length.
  -     */
  -    void refresh();
  -
  -    /**
  -     * Return a new <code>InputSource</code> object
  -     */
  -    InputSource getInputSource()
  +  /**
  +   * Return an <code>InputSource</code> object to read the XML
  +   * content.
  +   *
  +   * @return an <code>InputSource</code> value
  +   * @exception ProcessingException if an error occurs
  +   * @exception IOException if an error occurs
  +   */
  +  InputSource getInputSource()
       throws ProcessingException, IOException;
   
  -    /**
  -     * Stream content to the consumer
  -     */
  -    void stream(XMLConsumer consumer)
  -    throws ProcessingException, SAXException, IOException;
  -
  -    /**
  -     * Stream content to the content handler
  -     */
  -    void stream(ContentHandler contentHandler)
  -    throws ProcessingException, SAXException, IOException;
  -
  +  /**
  +   * Return the unique identifer for this source
  +   */
  +  String getSystemId();
   }
  -
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +0 -0      xml-cocoon2/src/org/apache/cocoon/environment/ModifiableSource.java
  
  Index: ModifiableSource.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/environment/ModifiableSource.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +1 -1      xml-cocoon2/src/org/apache/cocoon/environment/URLFactorySourceResolver.java
  
  Index: URLFactorySourceResolver.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/environment/URLFactorySourceResolver.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- URLFactorySourceResolver.java	2001/08/31 13:48:57	1.1
  +++ URLFactorySourceResolver.java	2001/09/05 22:18:13	1.1.2.1
  @@ -24,7 +24,7 @@
    * A <code>SourceResolver</code> based on a <code>URLFactory</code>.
    *
    * @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
  - * @version CVS $Revision: 1.1 $ $Date: 2001/08/31 13:48:57 $
  + * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/09/05 22:18:13 $
    */
   
   public class URLFactorySourceResolver implements SourceResolver {
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.1.1.2.6 +20 -16    xml-cocoon2/src/org/apache/cocoon/environment/http/HttpRequest.java
  
  Index: HttpRequest.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/environment/http/HttpRequest.java,v
  retrieving revision 1.1.1.1.2.5
  retrieving revision 1.1.1.1.2.6
  diff -u -r1.1.1.1.2.5 -r1.1.1.1.2.6
  --- HttpRequest.java	2001/08/20 14:07:30	1.1.1.1.2.5
  +++ HttpRequest.java	2001/09/05 22:18:13	1.1.1.1.2.6
  @@ -27,7 +27,7 @@
    * to provide request information for HTTP servlets.
    *
    * @author <a href="mailto:giacomo@apache,org">Giacomo Pati</a>
  - * @version CVS $Id: HttpRequest.java,v 1.1.1.1.2.5 2001/08/20 14:07:30 dims Exp $
  + * @version CVS $Id: HttpRequest.java,v 1.1.1.1.2.6 2001/09/05 22:18:13 dims Exp $
    */
   
   public class HttpRequest implements Request {
  @@ -61,27 +61,31 @@
       private Map wrappedCookieMap = null;
   
       public Cookie[] getCookies() {
  -        if (this.wrappedCookies == null) {
  -            this.wrappedCookieMap = new HashMap();
  -            javax.servlet.http.Cookie[] cookies = this.req.getCookies();
  -            if (cookies != null) {
  -                this.wrappedCookies = new Cookie[cookies.length];
  -                for(int i=0; i<cookies.length;i++) {
  -                    HttpCookie cookie = new HttpCookie(cookies[i]);
  -                    this.wrappedCookies[i] = cookie;
  -                    this.wrappedCookieMap.put(cookie.getName(),cookie);
  -                }
  -            }
  +        if (this.wrappedCookieMap == null) {
  +            wrapCookies();
           }
           return this.wrappedCookies;
       }
   
       public Map getCookieMap() {
  -        if (this.wrappedCookieMap != null) {
  -            return Collections.unmodifiableMap(this.wrappedCookieMap);
  -        } else {
  -            return Collections.unmodifiableMap(new HashMap());
  +        if (this.wrappedCookieMap == null) {
  +            wrapCookies();
  +        }
  +        return this.wrappedCookieMap;
  +    }
  +
  +    private synchronized void wrapCookies() {
  +        this.wrappedCookieMap = new HashMap();
  +        javax.servlet.http.Cookie[] cookies = this.req.getCookies();
  +        if (cookies != null) {
  +            this.wrappedCookies = new Cookie[cookies.length];
  +            for(int i=0; i<cookies.length;i++) {
  +                HttpCookie cookie = new HttpCookie(cookies[i]);
  +                this.wrappedCookies[i] = cookie;
  +                this.wrappedCookieMap.put(cookie.getName(),cookie);
  +            }
           }
  +        this.wrappedCookieMap = Collections.unmodifiableMap(this.wrappedCookieMap);
       }
   
       public long getDateHeader(String name) {
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.7   +34 -5     xml-cocoon2/src/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
  
  Index: EnvironmentWrapper.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java,v
  retrieving revision 1.1.2.6
  retrieving revision 1.1.2.7
  diff -u -r1.1.2.6 -r1.1.2.7
  --- EnvironmentWrapper.java	2001/08/20 14:07:31	1.1.2.6
  +++ EnvironmentWrapper.java	2001/09/05 22:18:14	1.1.2.7
  @@ -18,6 +18,7 @@
   import java.io.IOException;
   import java.io.OutputStream;
   import java.net.MalformedURLException;
  +import java.net.URL;
   import java.util.HashMap;
   import java.util.Iterator;
   import java.util.Map;
  @@ -29,7 +30,7 @@
    * contains a <code>RequestWrapper</code> object.
    *
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version $Id: EnvironmentWrapper.java,v 1.1.2.6 2001/08/20 14:07:31 dims Exp $
  + * @version $Id: EnvironmentWrapper.java,v 1.1.2.7 2001/09/05 22:18:14 dims Exp $
    */
   public final class EnvironmentWrapper
   extends AbstractEnvironment
  @@ -47,6 +48,13 @@
       /** The request object */
       private Request request;
   
  +    /** The last context */
  +    private URL lastContext;
  +    /** The last prefix */
  +    private String lastPrefix;
  +    /** The last uri */
  +    private String lastURI;
  +
       /**
        * Constructs an EnvironmentWrapper object from a Request
        * and Response objects
  @@ -153,12 +161,33 @@
        * If the prefix is not null the context is changed to the root
        * context and the prefix is set.
        */
  -    public void setURI(String prefix, String uri) {
  +    public void setURI(String prefix, String uris) {
  +        getLogger().debug("Setting uri (prefix=" + prefix + ", uris=" + uris + ")");
           if (prefix != null) {
  -            this.context = this.rootContext;
  -            this.prefix = new StringBuffer(prefix);
  +            setContext(getRootContext());
  +            setURIPrefix(prefix);
           }
  -        this.uris = uri;
  +        this.uris = uris;
  +        this.lastURI = uris;
  +        this.lastContext = this.context;
  +        this.lastPrefix = this.prefix.toString();
  +    }
  +
  +    public void changeContext(String prefix, String context)
  +    throws MalformedURLException {
  +        super.changeContext(prefix, context);
  +        this.lastContext = this.context;
  +        this.lastPrefix  = this.prefix.toString();
  +        this.lastURI     = this.uris;
  +    }
  +
  +    /**
  +     * Change the current context to the last one set by changeContext()
  +     */
  +    public void changeToLastContext() {
  +        this.setContext(this.lastContext);
  +        this.setURIPrefix(this.lastPrefix);
  +        this.uris = this.lastURI;
       }
   }
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.6.2.6   +12 -9     xml-cocoon2/src/org/apache/cocoon/generation/DirectoryGenerator.java
  
  Index: DirectoryGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/generation/DirectoryGenerator.java,v
  retrieving revision 1.6.2.5
  retrieving revision 1.6.2.6
  diff -u -r1.6.2.5 -r1.6.2.6
  --- DirectoryGenerator.java	2001/08/22 03:57:58	1.6.2.5
  +++ DirectoryGenerator.java	2001/09/05 22:18:14	1.6.2.6
  @@ -21,6 +21,7 @@
   
   import java.io.File;
   import java.io.IOException;
  +import java.net.URL;
   import java.text.SimpleDateFormat;
   import java.util.Date;
   import java.util.Map;
  @@ -61,10 +62,11 @@
    *         (Apache Software Foundation, Exoffice Technologies)
    * @author <a href="mailto:conny@smb-tec.com">Conny Krappatsch</a>
    *         (SMB GmbH) for Virbus AG
  - * @version CVS $Revision: 1.6.2.5 $ $Date: 2001/08/22 03:57:58 $ */
  + * @version CVS $Revision: 1.6.2.6 $ $Date: 2001/09/05 22:18:14 $ */
   
   public class DirectoryGenerator extends ComposerGenerator implements Recyclable {
  -
  +  private static final String FILE = "file:";
  +  
       /** The URI of the namespace of this generator. */
       protected static final String URI =
       "http://apache.org/cocoon/directory/2.0";
  @@ -163,20 +165,21 @@
           Source inputSource = null;
           try {
               inputSource = this.resolver.resolve(directory);
  -            directory = inputSource.getSystemId();
  -            if (inputSource.isFile() == false) {
  -                throw new ResourceNotFoundException(directory + " is not a directory.");
  +            String systemId = inputSource.getSystemId();
  +            if (!systemId.startsWith(FILE)) {
  +              throw new ResourceNotFoundException(systemId + " does not denote a directory");
               }
  -            File path = inputSource.getFile();
  -            if (!path.isDirectory()) {
  +            // This relies on systemId being of the form "file://..."
  +            File directoryFile = new File(new URL(systemId).getFile());
  +            if (!directoryFile.isDirectory()) {
                   throw new ResourceNotFoundException(directory + " is not a directory.");
               }
   
               this.contentHandler.startDocument();
               this.contentHandler.startPrefixMapping(PREFIX,URI);
   
  -            Stack ancestors = getAncestors(path);
  -            addPathWithAncestors(path, ancestors);
  +            Stack ancestors = getAncestors(directoryFile);
  +            addPathWithAncestors(directoryFile, ancestors);
   
               this.contentHandler.endPrefixMapping(PREFIX);
               this.contentHandler.endDocument();
  
  
  
  1.9.2.11  +8 -12     xml-cocoon2/src/org/apache/cocoon/generation/FileGenerator.java
  
  Index: FileGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/generation/FileGenerator.java,v
  retrieving revision 1.9.2.10
  retrieving revision 1.9.2.11
  diff -u -r1.9.2.10 -r1.9.2.11
  --- FileGenerator.java	2001/08/22 03:57:58	1.9.2.10
  +++ FileGenerator.java	2001/09/05 22:18:14	1.9.2.11
  @@ -35,7 +35,7 @@
    * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
    *         (Apache Software Foundation, Exoffice Technologies)
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.9.2.10 $ $Date: 2001/08/22 03:57:58 $
  + * @version CVS $Revision: 1.9.2.11 $ $Date: 2001/09/05 22:18:14 $
    */
   public class FileGenerator extends ComposerGenerator
   implements Cacheable, Recyclable {
  @@ -101,21 +101,17 @@
        * Generate XML data.
        */
       public void generate()
  -    throws IOException, SAXException, ProcessingException {
  +    throws IOException, SAXException {
           try {
               getLogger().debug("processing file " + super.source);
               getLogger().debug("file resolved to " + this.inputSource.getSystemId());
   
  -            this.inputSource.stream(super.xmlConsumer);
  -
  -        } catch (FileNotFoundException e) {
  -            getLogger().warn("Could not find resource " + this.inputSource.getSystemId(), e);
  -            throw new ResourceNotFoundException("Could not find resource "
  -                + this.inputSource.getSystemId(), e);
  -        } catch (IOException e) {
  -            getLogger().error("Could not read resource " + this.inputSource.getSystemId(), e);
  -            throw new ResourceNotFoundException("Could not read resource "
  -                + this.inputSource.getSystemId(), e);
  +            this.inputSource.toSAX(super.xmlConsumer);
  +        } catch (Exception e) {
  +            getLogger().error("Could not read resource "
  +                              + this.inputSource.getSystemId(), e);
  +            throw new SAXException("Could not read resource "
  +                                   + this.inputSource.getSystemId(), e);
           }
       }
   }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +1 -1      xml-cocoon2/src/org/apache/cocoon/i18n/XMLResourceBundle.java
  
  Index: XMLResourceBundle.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/i18n/XMLResourceBundle.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- XMLResourceBundle.java	2001/08/20 13:55:16	1.2
  +++ XMLResourceBundle.java	2001/09/05 22:18:14	1.2.2.1
  @@ -35,7 +35,7 @@
    * @author <a href="mailto:mengelhart@earthtrip.com">Mike Engelhart</a>
    * @author <a href="mailto:neeme@one.lv">Neeme Praks</a>
    * @author <a href="mailto:oleg@one.lv">Oleg Podolsky</a>
  - * @version $Id: XMLResourceBundle.java,v 1.2 2001/08/20 13:55:16 dims Exp $
  + * @version $Id: XMLResourceBundle.java,v 1.2.2.1 2001/09/05 22:18:14 dims Exp $
    */
   public class XMLResourceBundle
       extends ResourceBundle
  
  
  
  1.2.2.1   +1 -1      xml-cocoon2/src/org/apache/cocoon/i18n/XMLResourceBundleFactory.java
  
  Index: XMLResourceBundleFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/i18n/XMLResourceBundleFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- XMLResourceBundleFactory.java	2001/08/20 13:55:16	1.2
  +++ XMLResourceBundleFactory.java	2001/09/05 22:18:14	1.2.2.1
  @@ -30,7 +30,7 @@
    * @author <a href="mailto:mengelhart@earthtrip.com">Mike Engelhart</a>
    * @author <a href="mailto:neeme@one.lv">Neeme Praks</a>
    * @author <a href="mailto:oleg@one.lv">Oleg Podolsky</a>
  - * @version $Id: XMLResourceBundleFactory.java,v 1.2 2001/08/20 13:55:16 dims Exp $
  + * @version $Id: XMLResourceBundleFactory.java,v 1.2.2.1 2001/09/05 22:18:14 dims Exp $
    */
   
   public class XMLResourceBundleFactory
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.1.1.2.3 +97 -96    xml-cocoon2/src/org/apache/cocoon/serialization/FOPSerializer.java
  
  Index: FOPSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/serialization/FOPSerializer.java,v
  retrieving revision 1.1.1.1.2.2
  retrieving revision 1.1.1.1.2.3
  diff -u -r1.1.1.1.2.2 -r1.1.1.1.2.3
  --- FOPSerializer.java	2001/08/20 14:07:33	1.1.1.1.2.2
  +++ FOPSerializer.java	2001/09/05 22:18:14	1.1.1.1.2.3
  @@ -15,134 +15,137 @@
   import org.apache.cocoon.caching.CacheValidity;
   import org.apache.cocoon.caching.Cacheable;
   import org.apache.cocoon.caching.NOPCacheValidity;
  +import org.apache.cocoon.components.renderer.ExtendableRendererFactory;
  +import org.apache.cocoon.components.renderer.RendererFactory;
  +import org.apache.cocoon.util.ClassUtils;
  +import org.apache.avalon.framework.logger.Loggable;
   import org.apache.fop.apps.Driver;
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.apps.Options;
  -import org.apache.fop.messaging.MessageEvent;
  -import org.apache.fop.messaging.MessageHandler;
  -import org.apache.fop.messaging.MessageListener;
  +import org.apache.fop.render.Renderer;
   import org.xml.sax.SAXException;
   
  -import java.io.File;
   import java.io.IOException;
   import java.io.OutputStream;
   
  -/**
  - * FOP serializer.
  - *
  - * @author <a href="mailto:giacomo.pati@pwr.ch">Giacomo Pati</a>
  - *         (PWR Organisation &amp; Entwicklung)
  - * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.1.1.1.2.2 $ $Date: 2001/08/20 14:07:33 $
  - *
  - * The use of a config file for FOP is enabled by adding a configuration
  - * element to the serializer in the sitemap.
  - * <user-config src="../webapps/cocoon/WEB-INF/fop_config.xml"/> 
  - * note the path to the config file has to be relative to where the application
  - * started the JVM, or absolute. If any one wants to fix this, go ahead!
  - * (colin britton)
  - */
   public class FOPSerializer extends AbstractSerializer
  -implements MessageListener, Recyclable, Configurable, Cacheable {
  +    implements Recyclable, Configurable, Cacheable {
   
  -    //Declare options for FOP 
  -    private Options options;
  -    
  -    //Declare the FOP driver
  -    private Driver driver;
  -    
  -   /**
  -    * Set the configurations for this serializer.
  -    */
  +    /**
  +      * The <code>Options</code> used by FOP.
  +      */
  +    protected Options options;
  +
  +    /**
  +      * The <code>Driver</code> which is FOP.
  +      */
  +    protected Driver driver;
  +
  +    /** 
  +      * The current <code>Renderer</code>.  
  +      */
  +    Renderer renderer = null;
  +
  +    /** 
  +      * The Renderer Factory to use 
  +      */
  +    RendererFactory factory = ExtendableRendererFactory.getRendererFactoryImplementation();
  +
  +    /** 
  +      * The current <code>mime-type</code>. 
  +      */
  +    private String mimetype = null;
  +
  +    /**
  +      * Set the configurations for this serializer.
  +      */
       public void configure(Configuration conf) 
  -    throws ConfigurationException {
  +        throws ConfigurationException {
           String userConfig = null;
  -        File userConfigFile = null;
  +        java.io.File userConfigFile = null;
   
           if (conf != null) {
               Configuration child = conf.getChild("user-config");
               if (child != null) {
  -                try{
  +                try {
                       userConfig = child.getAttribute("src");
                   } catch(Exception ex) {		
  -                    // getLogger().debug("FOPSerializer: No config file specified ");
  +                    // No config file specified
                   }
               }
           }
  -             
  +
           // Check for null, use external or inbuilt config.
  -        if(userConfig != null){
  +        if(userConfig != null) {
               try {
  -                userConfigFile = new File(userConfig);
  +                userConfigFile = new java.io.File(userConfig);
                   options = new Options(userConfigFile);
  -                getLogger().debug("FOPSerializer: Using config file " + userConfig);
  -		    } catch (Exception ex) {
  -		        getLogger().error("FOPSerializer: Cannot load  config " + userConfig, ex);
  -		        throw new ConfigurationException("FOPSerializer: Cannot load config " + userConfig, ex);
  +                getLogger().debug("Using config file " + userConfig);
  +            } catch (Exception ex) {
  +                getLogger().error("Cannot load  config " + userConfig, ex);
  +                throw new ConfigurationException("Cannot load config " + userConfig, ex);
               }
           } else {
  -       	    try {
  -	    	    options = new Options();
  -        	    getLogger().debug("FOPSerializer: Using default config file");
  -		    } catch (Exception e) {
  -    		    getLogger().error("FOPSerializer: Cannot load default config ", e);
  +            try {
  +                options = new Options();
  +                getLogger().debug("Using default config file");
  +            } catch (Exception e) {
  +                getLogger().error("Cannot load default config ", e);
               }
           }
  -    }
  -    
  -
  -    /**
  -     * Create the FOP driver
  -     * Set the <code>OutputStream</code> where the XML should be serialized.
  -     */
  -    public void setOutputStream(OutputStream out) {
  -        // load the fop driver
  -        this.driver = new Driver();
  -
  -        // the use of static resources sucks for servlet enviornments
  -        // since we could have multiple FOP that all logs in this pipe
  -        // It's a concurrency and security nightmare! (SM)
  -        MessageHandler.setOutputMethod(MessageHandler.EVENT);
  -        MessageHandler.addListener(this);
  -
  -        this.driver.setRenderer(new org.apache.fop.render.pdf.PDFRenderer());
  -        this.driver.setOutputStream(out);
  -        this.setContentHandler(this.driver.getContentHandler());
  -     }
   
  -    /**
  -     * Receive notification of the end of a document.
  -     */
  -    public void endDocument() throws SAXException {
  -        super.endDocument();
  -        try {
  -            this.driver.format();
  -            this.driver.render();
  -        } catch (IOException e) {
  -            getLogger().error("FOPSerializer.endDocument()", e);
  -            throw new SAXException (e);
  -        } catch (FOPException e) {
  -            getLogger().error("FOPSerializer.endDocument()", e);
  -            throw new SAXException (e);
  +		// Get the mime type.
  +        this.mimetype = conf.getAttribute("mime-type");
  +        getLogger().debug("FOPSerializer mime-type:" + mimetype);
  +
  +        // Using the Renderer Factory, get the default renderer
  +        // for this MIME type.
  +        this.renderer = factory.createRenderer(mimetype);
  +        // Iterate through the parameters, looking for a renderer reference
  +        Configuration[] parameters = conf.getChildren("parameter");
  +        for (int i = 0; i < parameters.length; i++) {
  +            String name = parameters[i].getAttribute("name");
  +            if ("renderer".equals(name)) {
  +                String rendererName = parameters[i].getAttribute("value");
  +                try {
  +                    this.renderer = (Renderer)ClassUtils.newInstance(rendererName);
  +                } catch (Exception ex) {
  +                    getLogger().error("Cannot load  class " + rendererName, ex);
  +                    throw new ConfigurationException("Cannot load class " + rendererName, ex);
  +                }
  +            }
           }
  +        
  +        // Do we have a renderer yet?
  +        if (this.renderer == null ) {
  +            throw new ConfigurationException(
  +                "Could not autodetect renderer for FOPSerializer and "
  +                + "no renderer was specified in the sitemap configuration."
  +            );
  +        }
       }
   
       /**
        * Return the MIME type.
        */
       public String getMimeType() {
  -        return "application/pdf";
  +        return mimetype;
       }
   
       /**
  -     * Receive FOP events.
  +     * Create the FOP driver
  +     * Set the <code>OutputStream</code> where the XML should be serialized.
        */
  -    public void processMessage (MessageEvent event) {
  -        // Output FOP messgaes to Cocoon logging system
  -        // Rather verbose,  so wrote all as debug (including errors)
  -        // Could be cleaned up to handle different messages as required (CB)
  -        getLogger().debug("FOP Message: "+event.getMessage());
  +    public void setOutputStream(OutputStream out) {
  +        // load the fop driver
  +        driver = new Driver();
  +
  +        if(driver instanceof Loggable) {
  +            driver.setLogger(getLogger().getChildLogger("fop"));
  +        }
  +        driver.setRenderer(renderer);
  +        driver.setOutputStream(out);
  +        setContentHandler(driver.getContentHandler());
       }
   
       /**
  @@ -170,20 +173,18 @@
       }
   
       /**
  -     * Recycle the component and remove it from the MessageList
  -     */
  +      * Recycle serializer by removing references
  +      */
       public void recycle() {
           super.recycle();
  -        MessageHandler.removeListener(this);
  -        this.options = null;
  -        this.driver = null;
  +        options = null;
  +        driver = null;
       }
   
       /**
  -     * Test if the component wants to set the content length
  -     */
  +    * Test if the component wants to set the content length
  +    */
       public boolean shouldSetContentLength() {
           return true;
       }
  -
   }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.13.2.21 +99 -60    xml-cocoon2/src/org/apache/cocoon/servlet/CocoonServlet.java
  
  Index: CocoonServlet.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/servlet/CocoonServlet.java,v
  retrieving revision 1.13.2.20
  retrieving revision 1.13.2.21
  diff -u -r1.13.2.20 -r1.13.2.21
  --- CocoonServlet.java	2001/08/20 19:02:08	1.13.2.20
  +++ CocoonServlet.java	2001/09/05 22:18:14	1.13.2.21
  @@ -7,7 +7,14 @@
    *****************************************************************************/
   package org.apache.cocoon.servlet;
   
  +import org.apache.avalon.excalibur.logger.DefaultLogKitManager;
  +import org.apache.avalon.excalibur.logger.LogKitManager;
  +import org.apache.avalon.framework.activity.Initializable;
  +import org.apache.avalon.framework.component.ComponentManager;
  +import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
  +import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.context.DefaultContext;
  +import org.apache.avalon.framework.logger.Loggable;
   import org.apache.cocoon.Cocoon;
   import org.apache.cocoon.ConnectionResetException;
   import org.apache.cocoon.Constants;
  @@ -41,8 +48,10 @@
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
   import java.io.File;
  +import java.io.FileInputStream;
   import java.io.IOException;
   import java.io.OutputStream;
  +import java.lang.reflect.Constructor;
   import java.net.URL;
   import java.util.Arrays;
   import java.util.Date;
  @@ -57,12 +66,14 @@
    * @author <a href="mailto:nicolaken@supereva.it">Nicola Ken Barozzi</a> Aisa
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.13.2.20 $ $Date: 2001/08/20 19:02:08 $
  + * @author <a href="mailto:leo.sutic@inspireinfrastructure.com">Leo Sutic</a>
  + * @version CVS $Revision: 1.13.2.21 $ $Date: 2001/09/05 22:18:14 $
    */
   
   public class CocoonServlet extends HttpServlet {
   
       protected Logger log;
  +    protected LogKitManager logKitManager;
   
       static final float second = 1000;
       static final float minute = 60 * second;
  @@ -96,6 +107,8 @@
       protected ServletContext servletContext;
       protected RepositoryClassLoader classLoader;
   
  +    private String parentComponentManagerClass;
  +
       protected String forceLoadParameter;
       private boolean addClassDirs;
   
  @@ -183,6 +196,11 @@
              log.debug("show-time was not set - defaulting to false");
           }
   
  +        parentComponentManagerClass = conf.getInitParameter("parent-component-manager");
  +        if(parentComponentManagerClass == null) {
  +            log.debug("parent-component-manager was not set - defaulting to null.");
  +        }
  +
           this.createCocoon();
       }
   
  @@ -323,70 +341,47 @@
        */
       private void initLogger()
       throws ServletException {
  -        final Priority logPriority;
  -        String logDir = getInitParameter("log-dir");
           String logLevel = getInitParameter("log-level");
  -        String logFormat = getInitParameter("log-format");
  -        if (logLevel != null) {
  -            logLevel.trim();
  -        }
  -
  -        if (logDir == null) {
  -            if(this.servletContext.getRealPath("/") != null) {
  -                logDir = this.servletContext.getRealPath("/");
  -                if (logDir.endsWith(File.separator) == false) logDir += File.separator;
  -                logDir = logDir + "WEB-INF"+File.separator+"logs"+File.separator;
  -            } else
  -                logDir = "."+File.separator+"WEB-INF"+File.separator+"logs"+File.separator;
  +        if (logLevel == null) {
  +            logLevel = "INFO";
           }
   
  -        this.appContext.put(Constants.CONTEXT_LOG_DIR, logDir);
  +        final Priority logPriority = Priority.getPriorityForName(logLevel.trim());
   
  -        if (logLevel != null) {
  -            logPriority = Priority.getPriorityForName(logLevel);
  -        } else {
  -            logPriority = Priority.ERROR;
  -        }
  -
  -        try {
  -            String logName = getInitParameter("log-name");
  -            if (logName == null) {
  -                logName = "cocoon.log";
  -            }
  +        final ServletOutputLogTarget servTarget = new ServletOutputLogTarget(this.servletContext);
   
  -            this.appContext.put(Constants.CONTEXT_LOG_FILE, logName);
  +        final CocoonLogFormatter formatter = new CocoonLogFormatter();
  +        formatter.setFormat( "%7.7{priority} %{time}   [%8.8{category}] " +
  +                             "(%{uri}) %{thread}/%{class:short}: %{message}\\n%{throwable}" );
   
  -            String value = getInitParameter("log-append");
  -            boolean logAppend = (value == null || value.equalsIgnoreCase("yes") || value.equalsIgnoreCase("true"));
  +        servTarget.setFormatter(formatter);
  +        Hierarchy.getDefaultHierarchy().setDefaultLogTarget(servTarget);
  +        Hierarchy.getDefaultHierarchy().setDefaultPriority(logPriority);
  +        final Logger logger = Hierarchy.getDefaultHierarchy().getLoggerFor("");
   
  -            final String path = logDir + logName;
  -            Formatter formatter;
  -            if (logFormat == null || logFormat.equalsIgnoreCase("xml") == false) {
  -                final CocoonLogFormatter cf = new CocoonLogFormatter();
  -                cf.setFormat( "%7.7{priority} %{time}   [%8.8{category}] " +
  -                                 "(%{uri}) %{thread}/%{class:short}: %{message}\\n%{throwable}" );
  -                formatter = cf;
  -            } else {
  -                final XMLCocoonLogFormatter cf = new XMLCocoonLogFormatter();
  -                cf.setTypes("priority time category uri thread class message throwable");
  -                formatter = cf;
  +        try {
  +            final String logkitConfig = getInitParameter("logkit-config");
  +            
  +            //Configure the logkit management
  +            if (logkitConfig != null) {
  +                final FileInputStream fis = new FileInputStream(this.servletContext.getRealPath("/") + logkitConfig);
  +                final DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
  +                final Configuration conf = builder.build(fis);
  +                final DefaultLogKitManager logKitManager = new DefaultLogKitManager();
  +                logKitManager.setLogger(logger);
  +                final DefaultContext subcontext = new DefaultContext(this.appContext);
  +                subcontext.put("servlet-context", this.servletContext);
  +                subcontext.put("context-root", this.servletContext.getRealPath("/"));
  +                logKitManager.contextualize(subcontext);
  +                logKitManager.configure(conf);
  +                this.logKitManager = logKitManager;
  +                final String cocoonLogger = getInitParameter("servlet-logger");
  +                if (cocoonLogger != null) {
  +                    this.log = logKitManager.getLogger(cocoonLogger);
  +                } else {
  +                    this.log = logKitManager.getLogger("cocoon");
  +                }
               }
  -            this.log = Hierarchy.getDefaultHierarchy().getLoggerFor("cocoon");
  -            this.log.setPriority(logPriority);
  -
  -            FileTarget fileTarget = new FileTarget(new File(path), logAppend, formatter);
  -            ServletOutputLogTarget servTarget = new ServletOutputLogTarget(this.servletContext);
  -
  -            servTarget.setFormatter(formatter);
  -
  -            PriorityFilter filter = new PriorityFilter(Priority.ERROR);
  -            filter.addTarget( servTarget );
  -            LogTarget[] targets = new LogTarget[] { fileTarget, filter };
  -            this.log.setLogTargets( targets );
  -
  -            if (logAppend)
  -                this.log.info("Appending to previous log file, if existing");
  -
           } catch (Exception e) {
               Hierarchy.getDefaultHierarchy().log("Could not set up Cocoon Logger, will use screen instead", e);
           }
  @@ -446,8 +441,7 @@
                   try {
                       log.debug("Trying to load class: " + fqcn);
                       ClassUtils.loadClass(fqcn).newInstance();
  -                } catch (Exception e) {
  -                    log.warn("Could not force-load class: " + fqcn, e);
  +                } catch (Exception e) {                    log.warn("Could not force-load class: " + fqcn, e);
                       // Do not throw an exception, because it is not a fatal error.
                   }
               }
  @@ -660,6 +654,44 @@
       }
   
       /**
  +     * Instatiates the parent component manager, as specified in the
  +     * parent-component-manager init parameter.
  +     *
  +     * If none is specified, the method returns <code>null</code>.
  +     *
  +     * @return the parent component manager, or <code>null</code>.
  +     */
  +    private synchronized ComponentManager getParentComponentManager() {
  +        ComponentManager parentComponentManager = null;
  +        if (parentComponentManagerClass != null) {
  +            try {
  +                String initParam = null;
  +                int dividerPos = parentComponentManagerClass.indexOf('/');
  +                if (dividerPos != -1) {
  +                    initParam = parentComponentManagerClass.substring (dividerPos + 1);
  +                    parentComponentManagerClass = parentComponentManagerClass.substring (0, dividerPos);
  +                }
  +
  +                Class pcm = ClassUtils.loadClass(parentComponentManagerClass);
  +                Constructor pcmc = pcm.getConstructor(new Class[]{String.class});
  +                parentComponentManager = (ComponentManager) pcmc.newInstance(new Object[]{initParam});
  +
  +                if (parentComponentManager instanceof Loggable) {
  +                    ((Loggable) parentComponentManager).setLogger(log);
  +                }
  +                if (parentComponentManager instanceof Initializable) {
  +                    ((Initializable) parentComponentManager).initialize();
  +                }
  +            } catch (Exception e) {
  +                log.error("Could not initialize parent component manager.", e);
  +            }
  +        }
  +        return parentComponentManager;
  +    }
  +
  +
  +
  +    /**
        * Creates the Cocoon object and handles exception handling.
        */
       private synchronized void createCocoon()
  @@ -681,8 +713,15 @@
               URL configFile = (URL) this.appContext.get(Constants.CONTEXT_CONFIG_URL);
               log.info("Reloading from: " + configFile.toExternalForm());
               Cocoon c = (Cocoon) ClassUtils.newInstance("org.apache.cocoon.Cocoon");
  +            final String rootlogger = getInitParameter("cocoon-logger");
  +            if (rootlogger != null) {
  +                c.setLogger(this.logKitManager.getLogger(rootlogger));
  +            } else {
  +                c.setLogger(log);
  +            }
               c.contextualize(this.appContext);
  -            c.setLogger(this.log);
  +            c.compose(getParentComponentManager ());
  +            c.setLogKitManager(this.logKitManager);
               c.initialize();
               this.creationTime = new Date().getTime();
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.19  +12 -1     xml-cocoon2/src/org/apache/cocoon/sitemap/AbstractSitemap.java
  
  Index: AbstractSitemap.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/sitemap/AbstractSitemap.java,v
  retrieving revision 1.4.2.18
  retrieving revision 1.4.2.19
  diff -u -r1.4.2.18 -r1.4.2.19
  --- AbstractSitemap.java	2001/08/20 14:07:34	1.4.2.18
  +++ AbstractSitemap.java	2001/09/05 22:18:14	1.4.2.19
  @@ -10,6 +10,7 @@
   
   import org.apache.avalon.excalibur.component.ExcaliburComponentManager;
   import org.apache.avalon.excalibur.component.RoleManager;
  +import org.apache.avalon.excalibur.logger.LogKitManager;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.component.ComponentException;
  @@ -46,12 +47,13 @@
    * Base class for generated <code>Sitemap</code> classes
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  - * @version CVS $Revision: 1.4.2.18 $ $Date: 2001/08/20 14:07:34 $
  + * @version CVS $Revision: 1.4.2.19 $ $Date: 2001/09/05 22:18:14 $
    */
   public abstract class AbstractSitemap extends AbstractLoggable implements Sitemap, Disposable, ThreadSafe {
       private Context context;
       private static final int BYTE_ARRAY_SIZE = 1024;
       private static RoleManager roleManager;
  +    private static LogKitManager logKitManager;
       private static Configuration defaultConfig;
   
       /** The component manager instance */
  @@ -82,6 +84,13 @@
       }
   
       /**
  +     * Set the logkit manager
  +     */
  +    public static void setLogKitManager(LogKitManager logkit) {
  +        AbstractSitemap.logKitManager = logkit;
  +    }
  +
  +    /**
        * Set the current <code>ComponentManager</code> instance used by this
        * <code>Composable</code>.
        */
  @@ -90,6 +99,7 @@
           this.manager.setLogger(getLogger());
           this.manager.contextualize(this.context);
           this.manager.setRoleManager(AbstractSitemap.roleManager);
  +        this.manager.setLogKitManager(AbstractSitemap.logKitManager);
   
           try {
               if (AbstractSitemap.defaultConfig != null) {
  @@ -150,6 +160,7 @@
           selector.setLogger(getLogger());
           selector.contextualize(this.context);
           selector.setRoleManager(AbstractSitemap.roleManager);
  +        selector.setLogKitManager(AbstractSitemap.logKitManager);
           selector.compose(this.manager);
       }
   
  
  
  
  1.5.2.12  +2 -2      xml-cocoon2/src/org/apache/cocoon/sitemap/ContentAggregator.java
  
  Index: ContentAggregator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/sitemap/ContentAggregator.java,v
  retrieving revision 1.5.2.11
  retrieving revision 1.5.2.12
  diff -u -r1.5.2.11 -r1.5.2.12
  --- ContentAggregator.java	2001/08/22 03:57:59	1.5.2.11
  +++ ContentAggregator.java	2001/09/05 22:18:15	1.5.2.12
  @@ -37,7 +37,7 @@
   /**
    * @author <a href="mailto:giacomo@apache.org">Giacomo Pati</a>
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Id: ContentAggregator.java,v 1.5.2.11 2001/08/22 03:57:59 vgritsenko Exp $
  + * @version CVS $Id: ContentAggregator.java,v 1.5.2.12 2001/09/05 22:18:15 dims Exp $
    */
   public class ContentAggregator extends ContentHandlerWrapper implements Generator, Cacheable, Composable {
   
  @@ -142,7 +142,7 @@
                   }
   
                   try {
  -                    part.source.stream(this);
  +                    part.source.toSAX(this);
                   } finally {
                       if (!part.element.equals("")) {
                           this.endElem(prefix, part.element);
  
  
  
  1.9.2.13  +4 -3      xml-cocoon2/src/org/apache/cocoon/sitemap/Handler.java
  
  Index: Handler.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/sitemap/Handler.java,v
  retrieving revision 1.9.2.12
  retrieving revision 1.9.2.13
  diff -u -r1.9.2.12 -r1.9.2.13
  --- Handler.java	2001/08/22 03:57:59	1.9.2.12
  +++ Handler.java	2001/09/05 22:18:15	1.9.2.13
  @@ -27,6 +27,7 @@
   import org.apache.cocoon.components.source.SourceHandler;
   import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.environment.Source;
  +import org.apache.cocoon.environment.ModifiableSource;
   import org.apache.cocoon.environment.SourceResolver;
   import org.xml.sax.SAXException;
   
  @@ -40,7 +41,7 @@
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.9.2.12 $ $Date: 2001/08/22 03:57:59 $
  + * @version CVS $Revision: 1.9.2.13 $ $Date: 2001/09/05 22:18:15 $
    */
   public class Handler extends AbstractLoggable
   implements Runnable, Contextualizable, Composable, Processor, Disposable, SourceResolver {
  @@ -50,7 +51,7 @@
   
       /** the source of this sitemap */
       private String sourceFileName;
  -    private Source source;
  +    private ModifiableSource source;
   
       /** the last error */
       private Exception exception;
  @@ -117,7 +118,7 @@
           SourceHandler oldSourceHandler = environment.getSourceHandler();
           try {
               environment.setSourceHandler(this.sourceHandler);
  -            this.source = environment.resolve(this.sourceFileName);
  +            this.source = (ModifiableSource)environment.resolve(this.sourceFileName);
               this.contextSource = environment.resolve("");
           } finally {
               environment.setSourceHandler(oldSourceHandler);
  
  
  
  1.2.2.13  +27 -18    xml-cocoon2/src/org/apache/cocoon/sitemap/Manager.java
  
  Index: Manager.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/sitemap/Manager.java,v
  retrieving revision 1.2.2.12
  retrieving revision 1.2.2.13
  diff -u -r1.2.2.12 -r1.2.2.13
  --- Manager.java	2001/08/20 21:49:15	1.2.2.12
  +++ Manager.java	2001/09/05 22:18:15	1.2.2.13
  @@ -9,6 +9,8 @@
   package org.apache.cocoon.sitemap;
   
   import org.apache.avalon.excalibur.component.RoleManager;
  +import org.apache.avalon.excalibur.logger.LogKitManageable;
  +import org.apache.avalon.excalibur.logger.LogKitManager;
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.Composable;
  @@ -34,9 +36,11 @@
    * checking regeneration of the sub <code>Sitemap</code>
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  - * @version CVS $Revision: 1.2.2.12 $ $Date: 2001/08/20 21:49:15 $
  + * @version CVS $Revision: 1.2.2.13 $ $Date: 2001/09/05 22:18:15 $
    */
  -public class Manager extends AbstractLoggable implements Component, Configurable, Composable, Contextualizable, ThreadSafe {
  +public class Manager
  +        extends AbstractLoggable
  +        implements Component, Configurable, Composable, Contextualizable, ThreadSafe, LogKitManageable {
       private Context context;
   
       /** The vectors of sub sitemaps */
  @@ -51,9 +55,10 @@
       /** The sitemap role manager */
       private RoleManager sitemapRoles;
   
  -    /** The log file path */
  -    private String logFilePath;
  +    /** The sitemap logkit manager */
  +    private LogKitManager sitemapLogKitManager;
   
  +
       /**
        * Set the role manager
        */
  @@ -61,6 +66,13 @@
           this.sitemapRoles = roles;
       }
   
  +    /**
  +     * Set the logkit manager
  +     */
  +    public void setLogKitManager(LogKitManager logkit) {
  +        this.sitemapLogKitManager = logkit;
  +    }
  +
       /** get a configuration
        * @param conf the configuration
        */
  @@ -73,9 +85,6 @@
        */
       public void contextualize(Context context) throws ContextException {
           this.context = context;
  -        String logDir = (String) context.get(org.apache.cocoon.Constants.CONTEXT_LOG_DIR);
  -        String logFile = (String) context.get(org.apache.cocoon.Constants.CONTEXT_LOG_FILE);
  -        logFilePath = logDir + logFile;
       }
   
       /** get a component manager
  @@ -100,12 +109,13 @@
               Handler sitemapHandler = getHandler(newManager, environment, source, check_reload, reload_asynchron);
               // setup to invoke the processing
               setupProcessing(environment, sitemapHandler, uri_prefix, source);
  -            URL context = environment.getContext();
  -            try{
  +            String prefix = environment.getURIPrefix();
  +            String uri    = environment.getURI();
  +            try {
                   environment.changeContext(uri_prefix, source);
                   return sitemapHandler.process(environment);
  -            }finally{
  -                environment.setContext(context);
  +            } finally{
  +                environment.setContext(prefix, uri);
               }
       }
   
  @@ -123,14 +133,14 @@
               // get a sitemap handler
               Handler sitemapHandler = getHandler(newManager, environment, source, check_reload, reload_asynchron);
               // setup to invoke the processing
  -            environment.changeContext(uri_prefix, source);
               setupProcessing(environment, sitemapHandler, uri_prefix, source);
  -            URL context = environment.getContext();
  -            try{
  +            String prefix = environment.getURIPrefix();
  +            String uri    = environment.getURI();
  +            try {
                   environment.changeContext(uri_prefix, source);
                   return sitemapHandler.process(environment, pipeline, eventPipeline);
  -            }finally{
  -                environment.setContext(context);
  +            } finally{
  +                environment.setContext(prefix, uri);
               }
       }
   
  @@ -205,10 +215,9 @@
   
       private void setupProcessing(Environment environment, Handler sitemapHandler, String uri_prefix,
           String source) throws Exception {
  -//            environment.changeContext(uri_prefix, source);
               if (!sitemapHandler.available()) {
                   throw new ProcessingException("The sitemap handler's sitemap is not available. " +
  -                    "Please check "+ logFilePath +" for the exact error.",
  +                    "Please check logs for the exact error.",
                       sitemapHandler.getException());
               }
       }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +2 -2      xml-cocoon2/src/org/apache/cocoon/transformation/CIncludeTransformer.java
  
  Index: CIncludeTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/transformation/CIncludeTransformer.java,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- CIncludeTransformer.java	2001/08/22 03:57:59	1.1.2.5
  +++ CIncludeTransformer.java	2001/09/05 22:18:15	1.1.2.6
  @@ -32,7 +32,7 @@
    * which surrounds the included content.
    *
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.1.2.5 $ $Date: 2001/08/22 03:57:59 $ $Author: vgritsenko $
  + * @version CVS $Revision: 1.1.2.6 $ $Date: 2001/09/05 22:18:15 $ $Author: dims $
    */
   public class CIncludeTransformer extends AbstractTransformer
   implements Recyclable, Composable {
  @@ -127,7 +127,7 @@
           Source source = null;
           try {
               source = this.sourceResolver.resolve(src);
  -            source.stream(consumer);
  +            source.toSAX(consumer);
           } catch (IOException e) {
               getLogger().error("CIncludeTransformer", e);
               throw new SAXException("CIncludeTransformer could not read resource", e);
  
  
  
  1.8.2.8   +595 -347  xml-cocoon2/src/org/apache/cocoon/transformation/I18nTransformer.java
  
  Index: I18nTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/transformation/I18nTransformer.java,v
  retrieving revision 1.8.2.7
  retrieving revision 1.8.2.8
  diff -u -r1.8.2.7 -r1.8.2.8
  --- I18nTransformer.java	2001/08/22 03:57:59	1.8.2.7
  +++ I18nTransformer.java	2001/09/05 22:18:15	1.8.2.8
  @@ -12,18 +12,25 @@
   import org.apache.avalon.excalibur.pool.Poolable;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.Composable;
  +import org.apache.avalon.framework.configuration.Configurable;
  +import org.apache.avalon.framework.configuration.Configuration;
  +import org.apache.avalon.framework.configuration.ConfigurationException;
  +import org.apache.avalon.framework.configuration.DefaultConfiguration;
   import org.apache.avalon.framework.parameters.Parameters;
  +import org.apache.cocoon.ResourceNotFoundException;
   import org.apache.cocoon.ProcessingException;
  -import org.apache.cocoon.acting.LangSelect;
  -import org.apache.cocoon.environment.Source;
  +import org.apache.cocoon.acting.LocaleAction;
   import org.apache.cocoon.environment.SourceResolver;
  +import org.apache.cocoon.environment.Source;
  +import org.apache.cocoon.i18n.XMLResourceBundle;
  +import org.apache.cocoon.i18n.XMLResourceBundleFactory;
  +import org.apache.regexp.RE;
   import org.xml.sax.Attributes;
   import org.xml.sax.SAXException;
   import org.xml.sax.helpers.AttributesImpl;
  -import org.xml.sax.helpers.DefaultHandler;
   
   import java.io.IOException;
  -import java.net.MalformedURLException;
  +import java.io.File;
   import java.text.DateFormat;
   import java.text.DecimalFormat;
   import java.text.MessageFormat;
  @@ -35,124 +42,233 @@
   import java.util.HashMap;
   import java.util.Locale;
   import java.util.Map;
  +import java.util.MissingResourceException;
   import java.util.StringTokenizer;
   
   /**
  - * I18nTransformer. Cocoon2 port of Infozone groups I18nProcessor.
  + * Internationalisation transformer. Used to transform i18n markup into text
  + * based on a particular locale.
  + *
    * <p>
  - * Sitemap configuration:
  - * </p>
  + *
  + * The i18n transformer works by obtaining the users locale via
  + * <code>getLocale()</code> in the LocaleAction.
  + * (@see org.apache.cocoon.acting.LocaleAction). It them attempts to find a
  + * message catalogue that satisifies the particular locale, and use it for
  + * for text replacement within i18n markup.
  + *
    * <p>
  - * &lt;map:transformer<br>
  - *	name="translate"<br>
  - *	src="org.apache.cocoon.transformation.I18nTransformer"/&gt;<br>
  - * </p>
  + *
  + * Catalogues are maintained in separate files, with a naming convention
  + * similar to that of ResourceBundle (@see java.util.ResourceBundle). ie.
  + * <strong>basename</strong>_<strong>locale</strong>, where <i>basename</i>
  + * can be any name, and <i>locale</i> can be any locale specified using
  + * ISO 639/3166 characters (eg. en_AU, de_AT, es).
  + *
    * <p>
  - * &lt;map:match pattern="file"&gt;<br>
  - *	&lt;map:generate src="file.xml"/&gt;<br>
  - * 	&lt;map:transform type="translate"&gt;<br>
  - *		&lt;parameter name="default_lang" value="fi"/&gt;<br>
  - *		&lt;parameter name="available_lang_1" value="fi"/&gt;<br>
  - *		&lt;parameter name="available_lang_2" value="en"/&gt;<br>
  - *		&lt;parameter name="available_lang_3" value="sv"/&gt;<br>
  - *		&lt;parameter name="src"<br>
  - *			value="translations/file_trans.xml"/&gt;<br>
  - *	&lt;/map:transform&gt;<br>
  - * </p>
  + *
  + * Catalogues are of the following format:
  + *
  + * <pre>
  + * &lt;?xml version="1.0"?&gt;
  + * &lt;!-- message catalogue file for locale ... --&gt;
  + *
  + * &lt;catalogue xml:lang=&quot;locale&quot;&gt;
  + *        &lt;message key="key"&gt;text&lt;/message&gt;
  + *        ....
  + * &lt;/catalogue&gt;
  + * </pre>
  + *
  + * Where <strong>key</strong> specifies a particular message for that
  + * language.
  + *
    * <p>
  - * When user requests .../file?lang=fi<br>
  - * transformer substitutes text surrounded &lt;i18n:text&gt; with
  - * translations from file_trans.xml.<br>
  - * Attributes listed in &lt;i18n:attr&gt; attribute are also translated
  - * </p>
  + *
  + * Files to be translated contain the following markup:
  + *
  + * <pre>
  + * &lt;?xml version="1.0"?&gt;
  + *
  + * ... some text, translate &lt;i18n:text&gt;key&lt;/i18n:text&gt;
  + * </pre>
  + *
  + * At runtime, the i18n transformer will find a message catalogue for the
  + * user's locale, and will appropriately replace the text between the
  + * <code>&lt;i18n:text&gt;</code> markup, using the value between the tags as
  + * the lookup key.
  + *
    * <p>
  - * file.xml:<br>
  - * &lt;root xmlns:i18n="http://apache.org/cocoon/i18n/2.0"&gt;<br>
  - * 	&lt;elem i18n:attr="title" title="translate_me"&gt;Text&lt;/elem&gt;<br>
  - * 	&lt;elem&gt;&lt;i18n:text&gt;Translate me&lt;/i18n:text&gt;&lt;/elem&gt;<br>
  - * &lt;/root&gt;
  - * </p>
  + *
  + * If the i18n transformer cannot find an appropriate message catalogue for
  + * the user's given locale, it will recursively try to locate a <i>parent</i>
  + * message catalogue, until a valid catalogue can be found.
  + *
  + * ie: 
  + *
  + * <ul>
  + *  <li><strong>catalogue</strong>_<i>language</i>_<i>country</i>_<i>variant</i>.xml
  + *  <li><strong>catalogue</strong>_<i>language</i>_<i>country</i>.xml
  + *  <li><strong>catalogue</strong>_<i>language</i>.xml
  + *  <li><strong>catalogue</strong>.xml
  + * </ul>
  + *
  + * eg: Assuming a basename of <i>messages</i> and a locale of <i>en_AU</i>
  + * (no variant), the following search will occur:
  + *
  + * <ul>
  + *  <li><strong>messages</strong>_<i>en</i>_<i>AU</i>.xml
  + *  <li><strong>messages</strong>_<i>en</i>.xml
  + *  <li><strong>messages</strong>.xml
  + * </ul>
  + *
  + * This allows the developer to write a hierarchy of message catalogues,
  + * at each defining messages with increasing depth of variation.
  + *
    * <p>
  - * file_trans.xml:<br>
  - * &lt;translations&gt;<br>
  - * 	&lt;entry&gt;&lt;key&gt;Translate me&lt;/key&gt;<br>
  - * 		&lt;translation lang="sv"&gt;�vers�tta mej&lt;/translation&gt;<br>
  - * 		&lt;translation lang="fi"&gt;K��nn� minut&lt;/translation&gt;<br>
  - *	&lt;/entry&gt;<br>
  - * &lt;/translations&gt;<br>
  - * </p>
  + *
  + * Sitemap configuration:
  + *
  + * <pre>
  + * &lt;map:transformer name="i18n" src="org.apache.cocoon.transformation.I18nTransformer"&gt;
  + *  &lt;catalogue-name&gt;messages&lt;/catalogue-name&gt;
  + *  &lt;catalogue-location&gt;translations&lt;/catalogue-location&gt;
  + *  &lt;untranslated-text&gt;untranslated&lt;/untranslated-text&gt;
  + *  &lt;cache-at-startup&gt;true&lt;/cache-at-startup&gt;
  + * &lt;/map:transformer&gt;
  + * </pre>
  + *
  + * <ul>
  + *  <li>&lt;strong&gt;catalogue-name&lt;/strong&gt;: base name of the message
  + *      catalogue (<i>mandatory</i>).
  + *  <li>&lt;strong&gt;catalogue-location&lt;/strong&gt;: location of the
  + *      message catalogues (<i>mandatory</i>).
  + *  <li>&lt;strong&gt;untranslated-text&lt;/strong&gt;: default text used for
  + *      untranslated keys (default is 'untranslated-text').
  + *  <li>&lt;strong&gt;cache-at-startup&lt;/strong&gt;: flag whether to cache
  + *      messages at startup (false by default).
  + * </ul>
  + *
    * <p>
    *
  - * @todo Caching dictionaries in memory.<br>
  - * @todo Date and Number i18n.<br>
  - * @todo Multiple dictionary support. <br>
  -*
  + * To use the transformer in a pipeline, simply specify it in a particular
  + * transform. eg:
  + *
  + * <pre>
  + * &lt;map:match pattern="file"&gt;
  + *  &lt;map:generate src="file.xml"/&gt;
  + *  &lt;map:transform type="i18n"/&gt;
  + *  &lt;map:serialize/&gt;
  + * &lt;/map:match&gt;
  + * </pre>
  + *
  + * <p/>
  + * <ul>
  + *  <li><strong><i18n:date/></strong> gives now only the date.</li>
  + *  <li><strong><i18n:date-time/></strong> gives the date and time.</li>
  + *  <li><strong><i18n:time/></strong> gives the time.</li>
  + *  <li>For date, date-time and time the pattern and src-pattern attribute 
  + *      may have also values of: "short", "medium",
  + *      "long" or "full".</li>
  + * </ul>
  + * <p/>
  + * <ul>
  + * <li>for date, date-time, time and number a different locale and
  + *     source-locale can be specified:
  + *     <i18n:date src-pattern="short" src-locale="en_US" locale="de_DE">
  + *      12/24/01
  + *     </i18n:date>
  + *     will result in 24.12.2001</li>
  + * <li>A given real pattern and src-pattern (not short, medium, long, full)
  + *     overwrites the locale and src-locale</li>
  + * </ul>
  + * <p/>
  + * Future work coming:
  + *
  + * <ul>
  + *  <li>Ability to override definition parameters in the pipeline
  + *  <li>Many clean ups :-)
  + * </ul>
  + *
  + * @author <a href="mailto:Marcus.Crafter@osa.de">Marcus Crafter</a>
    * @author <a href="mailto:kpiroumian@flagship.ru">Konstantin Piroumian</a>
    * @author <a href="mailto:lassi.immonen@valkeus.com">Lassi Immonen</a>
  + * @author <a href="mailto:Michael.Enke@wincor-nixdorf.com">Michael Enke</a>
    */
   public class I18nTransformer extends AbstractTransformer
  -implements Composable, Poolable {
  +    implements Composable, Poolable, Configurable {
   
  +  private static final String FILE = "file:";
  +  
       protected ComponentManager manager;
   
       /**
  -     * The parsed dictionary data.
  -     */
  -    public Map dictionary;
  -
  -    /**
        * The namespace for i18n is "http://apache.org/cocoon/i18n/2.0"
        */
  -    public final static String I18N_NAMESPACE_URI =
  -            "http://apache.org/cocoon/i18n/2.0";
  +    public static final String I18N_NAMESPACE_URI =
  +        "http://apache.org/cocoon/i18n/2.0";
   
       //
       // Dictionary elements and attributes
       //
  -    public final static String I18N_DICTIONARY_ELEMENT = "dictionary";
  -    public final static String I18N_ENTRY_ELEMENT = "entry";
  -    public final static String I18N_KEY_ELEMENT = "key";
  -    public final static String I18N_TRANSLATION_ELEMENT = "translation";
  +    public static final String I18N_DICTIONARY_ELEMENT = "dictionary";
  +    public static final String I18N_ENTRY_ELEMENT = "entry";
  +    public static final String I18N_KEY_ELEMENT = "key";
  +    public static final String I18N_TRANSLATION_ELEMENT = "translation";
   
       //
       // Text elements and attributes
       //
  -    public final static String I18N_LANG = "lang";
  -    public final static String I18N_KEY_ATTRIBUTE = "key";
  -    public final static String I18N_ATTR_ATTRIBUTE = "attr";
  -    public final static String I18N_TEXT_ELEMENT = "text";
  -    public final static String I18N_TRANSLATE_ELEMENT = "translate";
  -    public final static String I18N_PARAM_ELEMENT = "param";
  -    public final static String I18N_DATE_ELEMENT = "date";
  -    public final static String I18N_NUMBER_ELEMENT = "number";
  +    public static final String I18N_LANG = "lang";
  +    public static final String I18N_KEY_ATTRIBUTE = "key";
  +    public static final String I18N_ATTR_ATTRIBUTE = "attr";
  +    public static final String I18N_TEXT_ELEMENT = "text";
  +    public static final String I18N_TRANSLATE_ELEMENT = "translate";
  +    public static final String I18N_PARAM_ELEMENT = "param";
  +    public static final String I18N_DATE_ELEMENT = "date";
  +    public static final String I18N_DATE_TIME_ELEMENT = "date-time";
  +    public static final String I18N_TIME_ELEMENT = "time";
  +    public static final String I18N_NUMBER_ELEMENT = "number";
   
       // number and date formatting attributes
  -    public final static String I18N_SRC_PATTERN_ATTRIBUTE = "src-pattern";
  -    public final static String I18N_PATTERN_ATTRIBUTE = "pattern";
  -    public final static String I18N_VALUE_ATTRIBUTE = "value";
  +    public static final String I18N_SRC_PATTERN_ATTRIBUTE = "src-pattern";
  +    public static final String I18N_PATTERN_ATTRIBUTE = "pattern";
  +    public static final String I18N_VALUE_ATTRIBUTE = "value";
  +    public static final String I18N_LOCALE_ATTRIBUTE = "locale";
  +    public static final String I18N_SRC_LOCALE_ATTRIBUTE = "src-locale";
  +
  +    // configuration parameters
  +    public static final String I18N_CATALOGUE_NAME = "catalogue-name";
  +    public static final String I18N_CATALOGUE_LOCATION = "catalogue-location";
  +    public static final String I18N_CATALOGUE_PREFIX = "/catalogue/message";
  +    public static final String I18N_UNTRANSLATED = "untranslated-text";
  +    public static final String I18N_CACHE_STARTUP = "cache-at-startup";
  +
       /**
  -     * <code>sub-type</code> attribute is used with <code>i18:number</code> to indicate
  -     * a sub-type: <code>currency</code> or <code>percent</code>.
  +     * <code>sub-type</code> attribute is used with <code>i18:number</code> to
  +     * indicate a sub-type: <code>currency</code> or <code>percent</code>.
        */
  -    public final static String I18N_SUB_TYPE_ATTRIBUTE = "sub-type";
  +    public static final String I18N_SUB_TYPE_ATTRIBUTE = "sub-type";
  +
       /**
  -     * <code>type</code> attribute is used with <code>i18:param</code> to indicate
  -     * the parameter type: <code>date</code> or <code>number</code>.
  +     * <code>type</code> attribute is used with <code>i18:param</code> to
  +     * indicate the parameter type: <code>date</code> or <code>number</code>.
        * If <code>type</code> is <code>number</code> then a <code>sub-type</code>
        * can be used.
        */
  -    public final static String I18N_TYPE_ATTRIBUTE = "type";
  +    public static final String I18N_TYPE_ATTRIBUTE = "type";
   
       // States of the transformer
  -    private final static int STATE_OUTSIDE = 0;
  -    private final static int STATE_INSIDE_TEXT = 1;
  -    private final static int STATE_INSIDE_PARAM = 2;
  -    private final static int STATE_INSIDE_TRANSLATE = 3;
  -    private final static int STATE_INSIDE_TRANSLATE_TEXT = 4;
  -    private final static int STATE_TRANSLATE_KEY = 5;
  -    private final static int STATE_TRANSLATE_TEXT_KEY = 6;
  -    private final static int STATE_INSIDE_DATE = 7;
  -    private final static int STATE_INSIDE_NUMBER = 8;
  +    private static final int STATE_OUTSIDE = 0;
  +    private static final int STATE_INSIDE_TEXT = 1;
  +    private static final int STATE_INSIDE_PARAM = 2;
  +    private static final int STATE_INSIDE_TRANSLATE = 3;
  +    private static final int STATE_INSIDE_TRANSLATE_TEXT = 4;
  +    private static final int STATE_TRANSLATE_KEY = 5;
  +    private static final int STATE_TRANSLATE_TEXT_KEY = 6;
  +    private static final int STATE_INSIDE_DATE = 7;
  +    private static final int STATE_INSIDE_DATE_TIME = 8;
  +    private static final int STATE_INSIDE_TIME = 9;
  +    private static final int STATE_INSIDE_NUMBER = 10;
   
       /**
        * Current state of the transformer.
  @@ -164,7 +280,7 @@
        * Previous state.
        * Used to translate text inside params and translate elements.
        */
  -     private int prev_state = STATE_OUTSIDE;
  +    private int prev_state = STATE_OUTSIDE;
   
       /**
        * The i18n:key attribute is stored for the current element.
  @@ -213,81 +329,162 @@
       private String lang;
   
       /**
  -     * @todo Locale full support.
  -     * Do we really need it? We can use a combination of
  -     * language code and country code (en_US) instead. <br>
  -     * Also, different encodings can be specified: ru_RU_koi8
  +     * Locale setting.
        */
  -    private Locale locale;
  +    private Locale locale, loc, srcLoc;
   
       /**
        * Date element attributes and their values.
        */
       private HashMap formattingParams;
   
  -    public static Locale parseLocale(String locale) {
  -        StringTokenizer st = new StringTokenizer(locale, "_");
  -        String lang = null;
  -        String country = null;
  -        String variant = null;
  -        if (!st.hasMoreTokens()) {
  -            return Locale.ENGLISH;
  -        }
  -        else {
  -            lang = st.nextToken();
  -        }
  +    /**
  +     * Dictionary data.
  +     */
  +    private XMLResourceBundle dictionary;
  +    private XMLResourceBundleFactory factory = new XMLResourceBundleFactory();
   
  -        country = st.hasMoreTokens() ? st.nextToken() : "";
  -        variant = st.hasMoreTokens() ? st.nextToken() : "";
  +    /*
  +     * i18n configuration variables
  +     */
  +    private String catalogueName;
  +    private String catalogueLocation;
  +    private String untranslated;
  +    private boolean cacheAtStartup;
  +
  +    /**
  +     * Configure this transformer.
  +     */
  +    public void configure(Configuration conf)
  +    throws ConfigurationException {
  +        if (conf != null) {
  +
  +            // read in the config options from the transformer definition
  +
  +            // obtain the base name of the message catalogue
  +            Configuration child = conf.getChild(I18N_CATALOGUE_NAME);
  +            catalogueName = child.getValue(null);
  +            debug("Default catalogue name is " + catalogueName);
  +
  +            // obtain the directory location of message catalogues
  +            child = conf.getChild(I18N_CATALOGUE_LOCATION);
  +            catalogueLocation = child.getValue(null);
  +            debug("Default catalogue location is " + catalogueLocation);
  +
  +            // check our mandatory parameters
  +            if (catalogueName == null || catalogueLocation == null)
  +	        throw new ConfigurationException(
  +		    "I18nTransformer requires the name and location of " +
  +		    "the message catalogues"
  +		);
  +
  +            // obtain default text to use for untranslated messages
  +            child = conf.getChild(I18N_UNTRANSLATED);
  +            untranslated = child.getValue(I18N_UNTRANSLATED);
  +            debug("Default untranslated text is '" + untranslated + "'");
  +
  +            // obtain config option, whether to cache messages at startup time
  +            child = conf.getChild(I18N_CACHE_STARTUP);
  +            cacheAtStartup = child.getValueAsBoolean(false);
  +            debug((cacheAtStartup ? "will" : "won't") +
  +                " cache messages during startup, by default"
  +            );
   
  -        return new Locale(lang, country, variant);
  +            // activate resource bundle logging
  +            factory.setLogger(getLogger());
  +        }
       }
   
  -    public void setLocale(Locale locale) {
  -        this.locale = locale;
  -        this.lang = locale.getLanguage();
  +    /**
  +     *  Uses <code>org.apache.cocoon.acting.LocaleAction.getLocale()</code>
  +     *  to get language user has selected. 
  +     */
  +    public void setup(SourceResolver resolver, Map objectModel, String source,
  +                      Parameters parameters)
  +    throws ProcessingException, SAXException, IOException {
  +
  +        try {
  +
  +            // Set current language and locale
  +            String lc = LocaleAction.getLocale(objectModel);
  +
  +            // configure the factory
  +            _setup(resolver);
  +
  +            // setup everything for the current locale
  +            String[] matches = new RE("_").split(lc);
  +
  +            String l = matches.length > 0
  +                       ? matches[0] : Locale.getDefault().getLanguage();
  +            String c = matches.length > 1 ? matches[1] : "";
  +            String v = matches.length > 2 ? matches[2] : "";
  +            Locale locale = new Locale(l, c, v);
  +
  +            debug("using locale " + locale.toString());
  +
  +            dictionary =
  +	        (XMLResourceBundle) factory.select(catalogueName, locale);
  +
  +            debug("selected dictionary " + dictionary);
  +
  +            setLocale(locale);
  +
  +        } catch(Exception e) {
  +            debug("exception generated, leaving unconfigured");
  +            throw new ProcessingException(e.getMessage(), e);
  +        }
       }
   
       /**
  -     *  Uses <code>org.apache.cocoon.acting.LangSelect.getLang()</code>
  -     *  to get language user has selected. First it checks is lang set in
  -     *  objectModel.
  +     * Internal setup.
  +     *
  +     * REVISIT: when we can get the resolver anywhere, we can pass the
  +     * configuration object directly to XMLResourceBundle.
        */
  -    public void setup(SourceResolver resolver, Map objectModel, String source,
  -            Parameters parameters)
  -            throws ProcessingException, SAXException, IOException {
  +    private void _setup(SourceResolver resolver) throws Exception {
   
  -        // Set current language and locale
  -        String lang = (String)(objectModel.get("lang"));
  -        if (lang == null) {
  -            lang = LangSelect.getLang(objectModel, parameters);
  +        // configure the factory to log correctly and cache catalogues
  +        DefaultConfiguration configuration =
  +            new DefaultConfiguration("name", "location");
  +        DefaultConfiguration cacheConf =
  +            new DefaultConfiguration(
  +                XMLResourceBundleFactory.ConfigurationKeys.CACHE_AT_STARTUP,
  +                "location"
  +            );
  +        cacheConf.setValue(new Boolean(cacheAtStartup).toString());
  +        configuration.addChild(cacheConf);
  +
  +        // set the root location for message catalogues
  +        DefaultConfiguration dirConf =
  +            new DefaultConfiguration(
  +                XMLResourceBundleFactory.ConfigurationKeys.ROOT_DIRECTORY,
  +                "location"
  +            );
  +
  +        debug("catalog location:" + catalogueLocation);
  +        Source source = resolver.resolve(catalogueLocation);
  +        String systemId = source.getSystemId();
  +        if (!systemId.startsWith(FILE)) {
  +          throw new ResourceNotFoundException(systemId + " does not denote a directory");
           }
  +        debug("catalog directory:" + systemId);
  +        dirConf.setValue(systemId);
   
  -        setLocale(parseLocale(lang));
  -        formatter.setLocale(locale);
  +        configuration.addChild(dirConf);
  +        factory.configure(configuration);
   
  -        // FIXME (KP)
  -        // We need another way of specifying dictionaries, e.g.
  -        // <parameter name="dictionary.en" src="dict.xml" />
  -        // <parameter name="dictionary.de" src="dict_de.xml" />
  -        // etc.
  -        String translations_file = parameters.getParameter("src", null);
  -
  -        // FIXME (KP)
  -        // Add multiple dictionary support!
  -        initialiseDictionary(resolver.resolve(translations_file));
  +        debug("configured");
       }
   
  -
       public void compose(ComponentManager manager) {
           this.manager = manager;
       }
   
       public void startElement(String uri, String name, String raw,
  -            Attributes attr) throws SAXException {
  +                             Attributes attr) throws SAXException {
   
           if (I18N_NAMESPACE_URI.equals(uri)) {
  -            this.getLogger().debug("Starting i18n element: " + name);
  +            debug("Starting i18n element: " + name);
               startI18NElement(name, attr);
               return;
           }
  @@ -297,7 +494,7 @@
   
   
       public void endElement(String uri, String name, String raw)
  -            throws SAXException {
  +    throws SAXException {
   
           if (I18N_NAMESPACE_URI.equals(uri)) {
               endI18NElement(name);
  @@ -322,61 +519,75 @@
   
       private void startI18NElement(String name, Attributes attr)
       throws SAXException {
  -        this.getLogger().debug("Start i18n element: " + name);
  +        debug("Start i18n element: " + name);
           try {
               if (I18N_TEXT_ELEMENT.equals(name)) {
                   if (current_state != STATE_OUTSIDE
  -                    && current_state != STATE_INSIDE_PARAM
  -                    && current_state != STATE_INSIDE_TRANSLATE) {
  +                        && current_state != STATE_INSIDE_PARAM
  +                        && current_state != STATE_INSIDE_TRANSLATE) {
                       throw new SAXException(this.getClass().getName()
  -                        + ": nested i18n:text elements are not allowed. Current state: " + current_state);
  +                                           + ": nested i18n:text elements are not allowed. Current state: " + current_state);
                   }
                   prev_state = current_state;
                   current_state = STATE_INSIDE_TEXT;
                   current_key = attr.getValue(I18N_NAMESPACE_URI, I18N_KEY_ATTRIBUTE);
  -            }
  -            else if (I18N_TRANSLATE_ELEMENT.equals(name)) {
  +            } else if (I18N_TRANSLATE_ELEMENT.equals(name)) {
                   if (current_state != STATE_OUTSIDE) {
                       throw new SAXException(this.getClass().getName()
  -                        + ": i18n:translate element must be used "
  -                        + "outside of other i18n elements. Current state: " + current_state);
  +                                           + ": i18n:translate element must be used "
  +                                           + "outside of other i18n elements. Current state: " + current_state);
                   }
                   current_state = STATE_INSIDE_TRANSLATE;
  -            }
  -            else if (I18N_PARAM_ELEMENT.equals(name)) {
  +            } else if (I18N_PARAM_ELEMENT.equals(name)) {
                   if (current_state != STATE_INSIDE_TRANSLATE) {
                       throw new SAXException(this.getClass().getName()
  -                        + ": i18n:param element can be used only inside "
  -                        + "i18n:translate element. Current state: " + current_state);
  +                                           + ": i18n:param element can be used only inside "
  +                                           + "i18n:translate element. Current state: " + current_state);
                   }
                   setFormattingParams(attr);
                   current_state = STATE_INSIDE_PARAM;
  -            }
  -            else if (I18N_DATE_ELEMENT.equals(name)) {
  +            } else if (I18N_DATE_ELEMENT.equals(name)) {
                   if (current_state != STATE_OUTSIDE) {
                       throw new SAXException(this.getClass().getName()
  -                        + ": i18n:date elements are not allowed "
  -                        + "inside of other i18n elements.");
  +                                           + ": i18n:date elements are not allowed "
  +                                           + "inside of other i18n elements.");
                   }
   
                   setFormattingParams(attr);
                   current_state = STATE_INSIDE_DATE;
  -            }
  -            else if (I18N_NUMBER_ELEMENT.equals(name)) {
  +            } else if (I18N_DATE_TIME_ELEMENT.equals(name)) {
                   if (current_state != STATE_OUTSIDE) {
                       throw new SAXException(this.getClass().getName()
  -                        + ": i18n:number elements are not allowed "
  -                        + "inside of other i18n elements.");
  +                                           + ": i18n:date-time elements are not allowed "
  +                                           + "inside of other i18n elements.");
                   }
   
                   setFormattingParams(attr);
  +                current_state = STATE_INSIDE_DATE_TIME;
  +            } else if (I18N_TIME_ELEMENT.equals(name)) {
  +                if (current_state != STATE_OUTSIDE) {
  +                    throw new SAXException(this.getClass().getName()
  +                                           + ": i18n:date elements are not allowed "
  +                                           + "inside of other i18n elements.");
  +                }
  +
  +                setFormattingParams(attr);
  +                current_state = STATE_INSIDE_TIME;
  +            } else if (I18N_NUMBER_ELEMENT.equals(name)) {
  +                if (current_state != STATE_OUTSIDE) {
  +                    throw new SAXException(this.getClass().getName()
  +                                           + ": i18n:number elements are not allowed "
  +                                           + "inside of other i18n elements.");
  +                }
  +
  +                setFormattingParams(attr);
                   current_state = STATE_INSIDE_NUMBER;
               }
           } catch (Exception e) {
               // we need it to avoid further errors if an exception occurs
               current_state = STATE_OUTSIDE;
               throw new SAXException(this.getClass().getName()
  -                + ": error in format", e);
  +                                   + ": error in format", e);
           }
       }
   
  @@ -401,6 +612,16 @@
               formattingParams.put(I18N_VALUE_ATTRIBUTE, attr_value);
           }
   
  +        attr_value = attr.getValue(I18N_LOCALE_ATTRIBUTE);
  +        if (attr_value != null) {
  +            formattingParams.put(I18N_LOCALE_ATTRIBUTE, attr_value);
  +        }
  +
  +        attr_value = attr.getValue(I18N_SRC_LOCALE_ATTRIBUTE);
  +        if (attr_value != null) {
  +            formattingParams.put(I18N_SRC_LOCALE_ATTRIBUTE, attr_value);
  +        }
  +
           attr_value = attr.getValue(I18N_TYPE_ATTRIBUTE);
           if (attr_value != null) {
               formattingParams.put(I18N_TYPE_ATTRIBUTE, attr_value);
  @@ -414,26 +635,33 @@
       }
   
       private void endI18NElement(String name) throws SAXException {
  -        this.getLogger().debug("End i18n element: " + name);
  +        debug("End i18n element: " + name);
           try {
               switch (current_state) {
  -                case STATE_INSIDE_TEXT: {
  +            case STATE_INSIDE_TEXT:
  +                {
                       endTextElement();
                       break;
                   }
  -                case STATE_INSIDE_TRANSLATE: {
  +            case STATE_INSIDE_TRANSLATE:
  +                {
                       endTranslateElement();
                       break;
                   }
  -                case STATE_INSIDE_PARAM: {
  +            case STATE_INSIDE_PARAM:
  +                {
                       endParamElement();
                       break;
                   }
  -                case STATE_INSIDE_DATE: {
  -                    endDateElement();
  +            case STATE_INSIDE_DATE:
  +            case STATE_INSIDE_DATE_TIME:
  +            case STATE_INSIDE_TIME:
  +                {
  +                    endDate_TimeElement();
                       break;
                   }
  -                case STATE_INSIDE_NUMBER: {
  +            case STATE_INSIDE_NUMBER:
  +                {
                       endNumberElement();
                       break;
                   }
  @@ -442,7 +670,7 @@
               // we need it to avoid further errors if an exception occurs
               current_state = STATE_OUTSIDE;
               throw new SAXException(this.getClass().getName()
  -                + ": error in format", e);
  +                                   + ": error in format", e);
           }
       }
   
  @@ -461,70 +689,74 @@
       }
   
       private void i18nCharacters(char[] ch, int start, int len)
  -    throws SAXException{
  +    throws SAXException {
   
  -        String text2translate = new String(ch, start, len);
  -        text2translate = stripWhitespace(text2translate);
  -        if (text2translate == null || text2translate.length() == 0) {
  +        String key = new String(ch, start, len);
  +        key = stripWhitespace(key);
  +        if (key == null || key.length() == 0) {
               return;
           }
   
  -        this.getLogger().debug("Text 2 translate: '" + text2translate + "'");
  +        debug("i18n message key = '" + key + "'");
   
           switch (current_state) {
  -            case STATE_INSIDE_TEXT: {
  +        case STATE_INSIDE_TEXT:
  +            {
                   if (current_key != null) {
  -                    translated_text = (String)(dictionary.get(current_key));
  +                    try {
  +                        translated_text = getString(current_key);
  +                    } catch (MissingResourceException e) {
  +                        translated_text = untranslated;
  +                    }
                       if (translated_text == null) {
  -                        translated_text = text2translate;
  +                        translated_text = key;
                       }
                       current_key = null;
  -                }
  -                else {
  -                    translated_text = (String)(dictionary.get(text2translate));
  +                } else {
  +                    try {
  +                        translated_text = getString(key);
  +                    } catch (MissingResourceException e) {
  +                        translated_text = untranslated;
  +                    }
                   }
   
                   break;
               }
  -            case STATE_INSIDE_TRANSLATE: {
  +        case STATE_INSIDE_TRANSLATE:
  +            {
                   // Store text for param substitution (do not translate)
                   if (substitute_text == null) {
  -                    substitute_text = text2translate;
  +                    substitute_text = key;
                   }
                   break;
               }
  -            case STATE_INSIDE_PARAM: {
  +        case STATE_INSIDE_PARAM:
  +            {
                   // Store translation for param substitution
                   if (param_value == null) {
  -                    param_value = text2translate;
  +                    param_value = key;
                   }
                   break;
               }
  -            case STATE_INSIDE_DATE: {
  +        case STATE_INSIDE_DATE:
  +        case STATE_INSIDE_DATE_TIME:
  +        case STATE_INSIDE_TIME:
  +        case STATE_INSIDE_NUMBER:
  +            {
                   if (formattingParams != null) {
                       if (formattingParams.get(I18N_VALUE_ATTRIBUTE) == null) {
  -                        formattingParams.put(I18N_VALUE_ATTRIBUTE, text2translate);
  -                    }
  -                    else {
  +                        formattingParams.put(I18N_VALUE_ATTRIBUTE, key);
  +                    } else {
                           // how to use the text inside of date element?
  -                    }
  -                }
  -                break;
  -            }
  -            case STATE_INSIDE_NUMBER: {
  -                if (formattingParams != null) {
  -                    if (formattingParams.get(I18N_PATTERN_ATTRIBUTE) == null) {
  -                        formattingParams.put(I18N_PATTERN_ATTRIBUTE, text2translate);
  -                    }
  -                    else {
  -                        // how to use the text inside of number element?
                       }
  +
                   }
                   break;
               }
  -            default: {
  +        default:
  +            {
                   throw new SAXException(this.getClass().getName()
  -                    + "Something's really wrong!!!");
  +                                       + "Something's really wrong!!!");
               }
           }
       }
  @@ -549,25 +781,29 @@
               // remove the i18n:attr attribute - we don't need it
               temp_attr.removeAttribute(i18n_attr_index);
               while (st.hasMoreElements()) {
  -            // translate all listed attributes
  +                // translate all listed attributes
                   String attr_name = st.nextToken();
                   int attr_index = temp_attr.getIndex(attr_name);
   
                   if (attr_index != -1) {
                       String text2translate = temp_attr.getValue(attr_index);
  -                    String result = (String)(dictionary.get(text2translate));
  +                    String result;
  +
  +                    try {
  +                        result = getString(text2translate);
  +                    } catch (MissingResourceException e) {
  +                        result = untranslated;
  +                    }
                       // set the translated value
                       if (result != null) {
                           temp_attr.setValue(attr_index, result);
  -                    }
  -                    else {
  +                    } else {
                           getLogger().warn("translation not found for attribute "
  -                        + attr_name + " in element: " + name);
  +                                         + attr_name + " in element: " + name);
                       }
  -                }
  -                else {
  +                } else {
                       getLogger().warn("i18n attribute '" + attr_name
  -                        + "' not found in element: " + name);
  +                                     + "' not found in element: " + name);
                   }
               }
               return temp_attr;
  @@ -577,25 +813,27 @@
       }
   
       private void endTextElement() throws SAXException {
  -        this.getLogger().debug("End text element, translated_text: " + translated_text);
  +        debug("End text element, translated_text: " + translated_text);
           switch (prev_state) {
  -            case STATE_OUTSIDE: {
  +        case STATE_OUTSIDE:
  +            {
                   // simply translate text (key translation already performed)
                   if (translated_text != null) {
                       super.contentHandler.characters(translated_text.toCharArray(),
  -                        0, translated_text.length());
  +                                                    0, translated_text.length());
  +                } else {
  +                    // else - translation not found
  +                    debug("--- Translation not found! ---");
                   }
  -                else {
  -                 // else - translation not found
  -                    this.getLogger().debug("--- Translation not found! ---");
  -                }
                   break;
               }
  -            case STATE_INSIDE_TRANSLATE: {
  +        case STATE_INSIDE_TRANSLATE:
  +            {
                   substitute_text = translated_text;
                   break;
               }
  -            case STATE_INSIDE_PARAM: {
  +        case STATE_INSIDE_PARAM:
  +            {
                   param_value = translated_text;
                   break;
               }
  @@ -606,27 +844,28 @@
       }
   
       private void endParamElement() throws SAXException {
  -        this.getLogger().debug("Substitution param: " + param_value);
  +        debug("Substitution param: " + param_value);
           if (formattingParams != null) {
               String paramType = (String)formattingParams.get(I18N_TYPE_ATTRIBUTE);
               if (paramType != null) {
  -                this.getLogger().debug("Param type: " + paramType);
  +                debug("Param type: " + paramType);
                   if (formattingParams.get(I18N_VALUE_ATTRIBUTE) == null
  -                    && param_value != null) {
  -                    this.getLogger().debug("Put param value: " + param_value);
  +                        && param_value != null) {
  +                    debug("Put param value: " + param_value);
                       formattingParams.put(I18N_VALUE_ATTRIBUTE, param_value);
  -                }
  -                if ("date".equals(paramType)) {
  -                    this.getLogger().debug("Formatting date param: " + formattingParams);
  -                    param_value = formatDate(formattingParams);
                   }
  -                else if ("number".equals(paramType)) {
  -                    this.getLogger().debug("Formatting number param: " + formattingParams);
  +                if ("date".equals(paramType) ||
  +		    "date-time".equals(paramType) ||
  +		    "time".equals(paramType)) {
  +                    debug("Formatting date_time param: " + formattingParams);
  +                    param_value = formatDate_Time(formattingParams);
  +                } else if ("number".equals(paramType)) {
  +                    debug("Formatting number param: " + formattingParams);
                       param_value = formatNumber(formattingParams);
                   }
               }
           }
  -        this.getLogger().debug("Added substitution param: " + param_value);
  +        debug("Added substitution param: " + param_value);
           indexedParams.add(param_value);
           param_value = null;
           current_state = STATE_INSIDE_TRANSLATE;
  @@ -640,11 +879,10 @@
   
           String result;
           if (indexedParams.size() > 0 && substitute_text.length() > 0) {
  -            this.getLogger().debug("Text for susbtitution: " + substitute_text);
  +            debug("Text for susbtitution: " + substitute_text);
               result = formatter.format(substitute_text, indexedParams.toArray());
  -            this.getLogger().debug("Result of susbtitution: " + result);
  -        }
  -        else {
  +            debug("Result of susbtitution: " + result);
  +        } else {
               result = substitute_text;
           }
   
  @@ -654,17 +892,43 @@
           current_state = STATE_OUTSIDE;
       }
   
  -    private void endDateElement() throws SAXException {
  -        String result = formatDate(formattingParams);
  +    private void endDate_TimeElement() throws SAXException {
  +        String result = formatDate_Time(formattingParams);
           super.contentHandler.characters(result.toCharArray(), 0, result.length());
           current_state = STATE_OUTSIDE;
       }
  +
  +    private Locale getLocale(Map params, String attribute) {
  +	Locale locale = this.locale;
  +        // the specific locale value
  +        String lc = (String)params.get(attribute);
  +	if(lc != null) try {
  +	    
  +            String[] matches = new RE("_").split(lc);
  +            String l = matches.length > 0
  +                       ? matches[0] : Locale.getDefault().getLanguage();
  +            String c = matches.length > 1 ? matches[1] : "";
  +            String v = matches.length > 2 ? matches[2] : "";
  +            locale = new Locale(l, c, v);
  +	}
  +	catch(Exception e) {}
  +	return locale;
  +    }
  +	
  +    private String formatDate_Time(Map params) throws SAXException {
  +        SimpleDateFormat to_fmt = null, from_fmt;
  +	String element = null;
  +	int srcStyle = DateFormat.SHORT, style = DateFormat.SHORT;
  +	boolean realPattern = false, realSrcPattern = false;
   
  -    private String formatDate(Map params) throws SAXException {
           if (params == null) {
               throw new SAXException(this.getClass().getName()
  -                + ": i18n:date - error in element attributes.");
  +                                   + ": i18n:"+element+" - error in element attributes.");
           }
  +
  +	loc = getLocale(params, I18N_LOCALE_ATTRIBUTE);
  +	srcLoc = getLocale(params, I18N_SRC_LOCALE_ATTRIBUTE);
  +
           // from pattern
           String srcPattern = (String)params.get(I18N_SRC_PATTERN_ATTRIBUTE);
           // to pattern
  @@ -672,38 +936,88 @@
           // the date value
           String value = (String)params.get(I18N_VALUE_ATTRIBUTE);
   
  +	if(srcPattern == null) {
  +	    srcStyle = DateFormat.DEFAULT;
  +	}
  +	else {
  +	    if(srcPattern.equalsIgnoreCase("short"))
  +		srcStyle = DateFormat.SHORT;
  +	    else if(srcPattern.equalsIgnoreCase("medium"))
  +		srcStyle = DateFormat.MEDIUM;
  +	    else if(srcPattern.equalsIgnoreCase("long"))
  +		srcStyle = DateFormat.LONG;
  +	    else if(srcPattern.equalsIgnoreCase("full"))
  +		srcStyle = DateFormat.FULL;
  +	    /* really a src-pattern */
  +	    else
  +		realSrcPattern = true;
  +	}
  +	if(pattern == null) {
  +	    style = DateFormat.DEFAULT;
  +	}
  +	else {
  +	    if(pattern.equalsIgnoreCase("short"))
  +		style = DateFormat.SHORT;
  +	    else if(pattern.equalsIgnoreCase("medium"))
  +		style = DateFormat.MEDIUM;
  +	    else if(pattern.equalsIgnoreCase("long"))
  +		style = DateFormat.LONG;
  +	    else if(pattern.equalsIgnoreCase("full"))
  +		style = DateFormat.FULL;
  +	    /* really a pattern */
  +	    else
  +		realPattern = true;
  +	}
  +
  +	if (current_state == STATE_INSIDE_DATE) {
  +	    element = I18N_DATE_ELEMENT;
  +	    to_fmt = (SimpleDateFormat)DateFormat.
  +		getDateInstance(style, loc);
  +	    from_fmt = (SimpleDateFormat)DateFormat.
  +		getDateInstance(srcStyle, srcLoc);
  +	}
  +	else if (current_state == STATE_INSIDE_DATE_TIME) {
  +	    element = I18N_DATE_TIME_ELEMENT;
  +	    to_fmt = (SimpleDateFormat)DateFormat.
  +		getDateTimeInstance(style, style, loc);
  +	    from_fmt = (SimpleDateFormat)DateFormat.
  +		getDateTimeInstance(srcStyle, srcStyle, srcLoc);
  +	}
  +	else { /* STATE_INSIDE_TIME */
  +	    element = I18N_TIME_ELEMENT;
  +	    to_fmt = (SimpleDateFormat)DateFormat.
  +		getTimeInstance(style, loc);
  +	    from_fmt = (SimpleDateFormat)DateFormat.
  +		getTimeInstance(srcStyle, srcLoc);
  +	}
  +
           // parsed date object
           Date dateValue = null;
   
  -        // src format
  -        SimpleDateFormat from_fmt = (SimpleDateFormat)DateFormat.getInstance();
  -        if (srcPattern != null) {
  +	// pattern overwrites locale format
  +        if (realSrcPattern) {
               from_fmt.applyPattern(srcPattern);
           }
   
  -        // result pattern is localized
  -        SimpleDateFormat to_fmt = (SimpleDateFormat)DateFormat.getDateTimeInstance(
  -            DateFormat.DEFAULT, DateFormat.DEFAULT, locale);
  -        if (pattern != null) {
  +        if (realPattern) {
               to_fmt.applyPattern(pattern);
           }
   
           // get current date and time by default
           if (value == null) {
               dateValue = new Date();
  -        }
  -        else {
  +        } else {
               try {
                   dateValue = from_fmt.parse(value);
               } catch (ParseException pe) {
                   throw new SAXException(this.getClass().getName()
  -                    + "i18n:date - parsing error.", pe);
  +                                       + "i18n:date - parsing error.", pe);
               }
           }
   
           // we have all necessary data here: do formatting.
           String result = to_fmt.format(dateValue);
  -        this.getLogger().debug("i18n:date result: " + result);
  +        debug("i18n:"+element+" result: " + result);
           return result;
       }
   
  @@ -716,7 +1030,7 @@
       private String formatNumber(Map params) throws SAXException {
           if (params == null) {
               throw new SAXException(this.getClass().getName()
  -                + ": i18n:number - error in element attributes.");
  +                                   + ": i18n:number - error in element attributes.");
           }
           // from pattern
           String srcPattern = (String)params.get(I18N_SRC_PATTERN_ATTRIBUTE);
  @@ -730,142 +1044,75 @@
           // parsed number
           Number numberValue = null;
   
  +	// locale, may be switched locale
  +	loc = getLocale(params, I18N_LOCALE_ATTRIBUTE);
  +	srcLoc = getLocale(params, I18N_SRC_LOCALE_ATTRIBUTE);
  +
  +
           // src format
  -        DecimalFormat from_fmt = (DecimalFormat)NumberFormat.getInstance();
  +        DecimalFormat from_fmt = (DecimalFormat)NumberFormat.getInstance(srcLoc);
  +	// src-pattern overwrites locale format
           if (srcPattern != null) {
               from_fmt.applyPattern(srcPattern);
           }
   
  -        // result pattern is localized
  +	// to format
           DecimalFormat to_fmt = null;
           if (subType == null) {
  -            to_fmt = (DecimalFormat)NumberFormat.getInstance(locale);
  -        }
  -        else if (subType.equals("currency")) {
  -            to_fmt = (DecimalFormat)NumberFormat.getCurrencyInstance(locale);
  +            to_fmt = (DecimalFormat)NumberFormat.getInstance(loc);
  +        } else if (subType.equals("currency")) {
  +            to_fmt = (DecimalFormat)NumberFormat.getCurrencyInstance(loc);
  +        } else if (subType.equals("percent")) {
  +            to_fmt = (DecimalFormat)NumberFormat.getPercentInstance(loc);
           }
  -        else if (subType.equals("percent")) {
  -            to_fmt = (DecimalFormat)NumberFormat.getPercentInstance(locale);
  -        }
  +
  +	// pattern overwrites locale format
           if (pattern != null) {
               to_fmt.applyPattern(pattern);
           }
   
  -        // get current date and time by default
           if (value == null) {
               numberValue = new Long(0);
  -        }
  -        else {
  +        } else {
               try {
                   numberValue = from_fmt.parse(value);
               } catch (ParseException pe) {
                   throw new SAXException(this.getClass().getName()
  -                    + "i18n:number - parsing error.", pe);
  +                                       + "i18n:number - parsing error.", pe);
               }
           }
   
           // we have all necessary data here: do formatting.
           String result = to_fmt.format(numberValue);
  -        this.getLogger().debug("i18n:number result: " + result);
  +        debug("i18n:number result: " + result);
           return result;
       }
   
       /**
  -     * Gets translations from xml file to dictionary.
  +     * Helper method to retrieve a message from the dictionary
        */
  -    class I18nContentHandler extends DefaultHandler {
  -        boolean in_entry = false;
  -        boolean in_key = false;
  -        boolean in_translation = false;
  -
  -        String key = null;
  -        String translation = null;
  -
  -
  -        public void startElement(String namespace, String name, String raw,
  -                Attributes attr) throws SAXException {
  -
  -            if (name.equals(I18N_ENTRY_ELEMENT)) {
  -                in_entry = true;
  -            } else {
  -                if (in_entry) {
  -                    if (name.equals(I18N_KEY_ELEMENT)) {
  -                        in_key = true;
  -                    } else {
  -                        if (name.equals(I18N_TRANSLATION_ELEMENT)
  -                                && attr.getValue(I18N_LANG).equals(lang)) {
  -                            in_translation = true;
  -                        }
  -                    }
  -                }
  -            }
  -        }
  -
  -
  -        public void endElement(String namespace, String name, String raw)
  -                throws SAXException {
  +    private String getString(String key) {
   
  -            if (name.equals(I18N_ENTRY_ELEMENT)) {
  -                if (key != null && translation != null) {
  -                    dictionary.put(key, translation);
  -                    key = null;
  -                    translation = null;
  -                }
  -                in_entry = false;
  -            } else if (name.equals(I18N_KEY_ELEMENT)) {
  -                in_key = false;
  -            } else {
  -                if (name.equals(I18N_TRANSLATION_ELEMENT)) {
  -                    in_translation = false;
  -                }
  -            }
  -
  -        }
  -
  -
  -        public void characters(char[] ary, int start, int length)
  -                throws SAXException {
  -            if (in_key) {
  -                key = new String(ary, start, length);
  -
  -            } else {
  -                if (in_translation) {
  -                    translation = new String(ary, start, length);
  -                }
  -            }
  -        }
  -
  +    	return dictionary.getString(
  +		I18N_CATALOGUE_PREFIX + "[@key='" + key + "']"
  +	);
       }
   
  +    private void setLocale(Locale locale) {
  +        this.locale = locale;
  +        lang = locale.getLanguage();
  +        formatter.setLocale(locale);
  +    }
   
       /**
  -     *Loads translations from given URL
  +     * Helper method to debug messages
        */
  -    private void initialiseDictionary(Source inputSource)
  -    throws ProcessingException, SAXException, MalformedURLException, IOException {
  -        try
  -        {
  -            // How this could be cached?
  -            this.dictionary = new HashMap();
  -            I18nContentHandler i18n_handler = new I18nContentHandler();
  -            inputSource.stream(i18n_handler);
  -        } catch(SAXException e) {
  -            getLogger().error("Error in initialiseDictionary", e);
  -            throw e;
  -        } catch(MalformedURLException e) {
  -            getLogger().error("Error in initialiseDictionary", e);
  -            throw e;
  -        } catch(IOException e) {
  -            getLogger().error("Error in initialiseDictionary", e);
  -            throw e;
  -        } finally {
  -            inputSource.recycle();
  -        }
  +    private void debug(String msg) {
  +    	getLogger().debug("I18nTransformer: " + msg);
       }
   
       /**
        *
  -     */
       static public void main(String[] args) {
   
           Locale locale = null;
  @@ -874,8 +1121,8 @@
           for (int i = 0; i < locales.length; i++) {
               locale = locales[i];
               SimpleDateFormat fmt = (SimpleDateFormat)DateFormat.getDateTimeInstance(
  -                DateFormat.DEFAULT, DateFormat.DEFAULT, locale
  -            );
  +                                       DateFormat.DEFAULT, DateFormat.DEFAULT, locale
  +                                   );
   
               String localized = fmt.format(new Date());
   
  @@ -883,13 +1130,14 @@
               String money = n_fmt.format(1210.5);
   
               System.out.println("Locale ["
  -                + locale.getLanguage() + ", "
  -                + locale.getCountry() + ", "
  -                + locale.getVariant() + "] : "
  -                + locale.getDisplayName()
  -                + " \t Date: " + localized
  -                + " \t Money: " + money);
  +                               + locale.getLanguage() + ", "
  +                               + locale.getCountry() + ", "
  +                               + locale.getVariant() + "] : "
  +                               + locale.getDisplayName()
  +                               + " \t Date: " + localized
  +                               + " \t Money: " + money);
           }
       }
  +     */
   
   }
  
  
  
  1.15.2.15 +42 -225   xml-cocoon2/src/org/apache/cocoon/transformation/TraxTransformer.java
  
  Index: TraxTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/transformation/TraxTransformer.java,v
  retrieving revision 1.15.2.14
  retrieving revision 1.15.2.15
  diff -u -r1.15.2.14 -r1.15.2.15
  --- TraxTransformer.java	2001/08/22 03:57:59	1.15.2.14
  +++ TraxTransformer.java	2001/09/05 22:18:15	1.15.2.15
  @@ -23,26 +23,17 @@
   import org.apache.cocoon.caching.Cacheable;
   import org.apache.cocoon.caching.TimeStampCacheValidity;
   import org.apache.cocoon.components.browser.Browser;
  -import org.apache.cocoon.components.store.Store;
  +import org.apache.cocoon.components.xslt.XSLTProcessor;
   import org.apache.cocoon.environment.Cookie;
   import org.apache.cocoon.environment.Request;
   import org.apache.cocoon.environment.Source;
   import org.apache.cocoon.environment.SourceResolver;
   import org.apache.cocoon.util.HashUtil;
  -import org.apache.cocoon.util.TraxErrorHandler;
   import org.apache.cocoon.xml.XMLConsumer;
  -import org.xml.sax.InputSource;
   import org.xml.sax.SAXException;
   
  -import javax.xml.transform.Templates;
  -import javax.xml.transform.TransformerConfigurationException;
  -import javax.xml.transform.TransformerFactory;
  -import javax.xml.transform.URIResolver;
   import javax.xml.transform.sax.SAXResult;
  -import javax.xml.transform.sax.SAXSource;
  -import javax.xml.transform.sax.SAXTransformerFactory;
   import javax.xml.transform.sax.TransformerHandler;
  -import java.io.File;
   import java.io.IOException;
   import java.text.StringCharacterIterator;
   import java.util.Enumeration;
  @@ -59,15 +50,10 @@
    * <b>In the map:sitemap/map:components/map:transformers:</b><br>
    *
    * &lt;map:transformer name="xslt" src="org.apache.cocoon.transformation.TraxTransformer"&gt;<br>
  - *   &lt;use-store&gt;true&lt;/use-store&gt;
    *   &lt;use-request-parameters&gt;false&lt;/use-request-parameters&gt;
    *   &lt;use-browser-capabilities-db&gt;false&lt;/use-browser-capabilities-db&gt;
    * &lt;/map:transformer&gt;
    *
  - * The &lt;use-store&gt; configuration forces the transformer to put the
  - * <code>Templates</code> generated from the XSLT stylesheet into the
  - * <code>Store</code>. This property is true by default.
  - *
    * The &lt;use-request-parameter&gt; configuration forces the transformer to make all
    * request parameters available in the XSLT stylesheet. Note that this might have issues
    * concerning cachability of the generated output of this transformer.
  @@ -93,226 +79,65 @@
    * @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
    * @author <a href="mailto:giacomo@apache.org">Giacomo Pati</a>
  - * @version CVS $Id: TraxTransformer.java,v 1.15.2.14 2001/08/22 03:57:59 vgritsenko Exp $
  + * @author <a href="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
  + * @version CVS $Id: TraxTransformer.java,v 1.15.2.15 2001/09/05 22:18:15 dims Exp $
    */
   public class TraxTransformer extends AbstractTransformer
  -implements Transformer, Composable, Recyclable, Configurable, Cacheable, Disposable, URIResolver {
  +implements Transformer, Composable, Recyclable, Configurable, Cacheable, Disposable {
   
  -    /** The store service instance */
  -    private Store store = null;
  +    private static final String FILE = "file:";
   
       /** The Browser service instance */
       private Browser browser = null;
   
  -    /** The trax TransformerFactory */
  -    private SAXTransformerFactory tfactory = null;
  -
  -    /** The trax TransformerHandler */
  -    private TransformerHandler transformerHandler = null;
  -
  -    /** Is the store turned on? (default is on) */
  -    private boolean useStore = true;
  -
       /** Should we make the request parameters available in the stylesheet? (default is off) */
       private boolean useParameters = false;
       private boolean _useParameters = false;
   
  -    /** Should we make the cookies availalbe in the stylesheet? (default is off) **/
  -    private boolean useCookies = false;
  -    private boolean _useCookies = false;
  -
       /** Should we make the browser capability properties available in the stylesheet? (default is off) */
       private boolean useBrowserCap = false;
       private boolean _useBrowserCap = false;
   
  +    /** Should we make the cookies availalbe in the stylesheet? (default is off) */
  +    private boolean useCookies = false;
  +    private boolean _useCookies = false;
  +
       private ComponentManager manager;
   
  +    /** The trax TransformerHandler */
  +    TransformerHandler transformerHandler;
       /** The Source */
       private Source inputSource;
       /** The parameters */
       private Parameters par;
       /** The object model */
       private Map objectModel;
  -    /** The source resolver */
  -    SourceResolver resolver;
  -
  -    TransformerHandler getTransformerHandler()
  -    throws SAXException, ProcessingException, IOException, TransformerConfigurationException {
  -        Templates templates = getTemplates();
  -        if(templates == null) {
  -            getLogger().debug("Creating new Templates in " + this + " for " + this.inputSource.getSystemId());
  -            InputSource is = this.inputSource.getInputSource();
  -            //templates = getTransformerFactory().newTemplates(new SAXSource(is));
  -
  -            // Create a Templates ContentHandler to handle parsing of the
  -            // stylesheet.
  -            javax.xml.transform.sax.TemplatesHandler templatesHandler =
  -                                                getTransformerFactory().newTemplatesHandler();
  -
  -            // Create an XMLReader and set its ContentHandler.
  -            org.xml.sax.XMLReader reader =
  -                           org.xml.sax.helpers.XMLReaderFactory.createXMLReader();
  -            reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
  -            reader.setContentHandler(templatesHandler);
  -
  -            // Parse the stylesheet.
  -            reader.parse(is);
  -
  -            // Get the Templates object (generated during the parsing of the stylesheet)
  -            // from the TemplatesHandler.
  -            templates = templatesHandler.getTemplates();
  -
  -
  -            putTemplates (templates);
  -        } else {
  -            getLogger().debug("Reusing Templates in " + this + " for " + this.inputSource.getSystemId());
  -        }
  -
  -        TransformerHandler handler = getTransformerFactory().newTransformerHandler(templates);
  -        if(handler == null) {
  -            /* If there is a problem in getting the handler, try using a brand new Templates object */
  -            getLogger().debug("Re-creating new Templates in " + this + " for" + this.inputSource.getSystemId());
  -            InputSource is = this.inputSource.getInputSource();
  -            templates = getTransformerFactory().newTemplates(new SAXSource(is));
  -            putTemplates (templates);
  -            handler = getTransformerFactory().newTransformerHandler(templates);
  -        }
  -
  -        handler.getTransformer().setErrorListener(new TraxErrorHandler(getLogger()));
  -        return handler;
  -    }
  -
  -    private Templates getTemplates ()
  -    throws IOException {
  -        Templates templates = null;
  -        if (this.useStore == false)
  -            return null;
  -
  -        // only stylesheets with a last modification date are stored
  -        if (this.inputSource.getLastModified() != 0) {
  -
  -            // Stored is an array of the template and the caching time
  -            if (store.containsKey(this.inputSource.getSystemId()) == true) {
  -                Object[] templateAndTime = (Object[])store.get(this.inputSource.getSystemId());
  -                if(templateAndTime != null && templateAndTime[1] != null) {
  -                    long storedTime = ((Long)templateAndTime[1]).longValue();
  -                    if (storedTime < this.inputSource.getLastModified()) {
  -                        store.remove(this.inputSource.getSystemId());
  -                    } else {
  -                        templates = (Templates)templateAndTime[0];
  -                    }
  -                }
  -            }
  -        } else {
  -            // remove an old template if it exists
  -            if (store.containsKey(this.inputSource.getSystemId()) == true) {
  -               store.remove(this.inputSource.getSystemId());
  -            }
  -        }
  -        return templates;
  -    }
  -
  -    private void putTemplates (Templates templates)
  -    throws IOException {
  -        if (this.useStore == false)
  -            return;
   
  -        // only stylesheets with a last modification date are stored
  -        if (this.inputSource.getLastModified() != 0) {
  +    /** The XSLTProcessor */
  +    XSLTProcessor xsltProcessor;
   
  -            // Stored is an array of the template and the current time
  -            Object[] templateAndTime = new Object[2];
  -            templateAndTime[0] = templates;
  -            templateAndTime[1] = new Long(this.inputSource.getLastModified());
  -            store.hold(this.inputSource.getSystemId(), templateAndTime);
  -        }
  -    }
  -
  -    /**
  -     * Called by the processor when it encounters
  -     * an xsl:include, xsl:import, or document() function.
  -     *
  -     * @param href An href attribute, which may be relative or absolute.
  -     * @param base The base URI in effect when the href attribute
  -     * was encountered.
  -     *
  -     * @return A Source object, or null if the href cannot be resolved,
  -     * and the processor should try to resolve the URI itself.
  -     *
  -     * @throws TransformerException if an error occurs when trying to
  -     * resolve the URI.
  -     */
  -    public javax.xml.transform.Source resolve(String href, String base)
  -    throws javax.xml.transform.TransformerException {
  -        Source xslSource = null;
  -        try {
  -            if (href.indexOf(":") > 1) {
  -                xslSource = this.resolver.resolve(href);
  -            } else {
  -                // patch for a null pointer passed as base
  -                if (base == null) base = this.inputSource.getSystemId();
  -
  -                // is the base a file or a real url
  -                if (base.startsWith("file:") == false) {
  -                    int lastPathElementPos = base.lastIndexOf('/');
  -                    if (lastPathElementPos == -1) {
  -                        // this should never occur as the base should
  -                        // always be protol:/....
  -                        return null; // we can't resolve this
  -                    } else {
  -                        xslSource = this.resolver.resolve(base.substring(0, lastPathElementPos)
  -                                                       + "/" + href);
  -                    }
  -                } else {
  -                    File parent = new File(base.substring(5));
  -                    xslSource = this.resolver.resolve("file:/"
  -                               + new File(parent.getParentFile(), href).getAbsolutePath());
  -                }
  -            }
  -            return new javax.xml.transform.stream.StreamSource(xslSource.getInputStream(), xslSource.getSystemId());
  -        } catch (IOException e) {
  -            throw new javax.xml.transform.TransformerException(e);
  -        } catch (SAXException e) {
  -           throw new javax.xml.transform.TransformerException(e);
  -        } catch (ProcessingException e) {
  -            throw new javax.xml.transform.TransformerException(e);
  -        } finally {
  -            if (xslSource != null) xslSource.recycle();
  -        }
  -    }
       /**
  -     * Helper for TransformerFactory.
  -     */
  -    private SAXTransformerFactory getTransformerFactory() {
  -        if(tfactory == null)  {
  -            tfactory = (SAXTransformerFactory) TransformerFactory.newInstance();
  -            tfactory.setErrorListener(new TraxErrorHandler(getLogger()));
  -            tfactory.setURIResolver(this);
  -        }
  -        return tfactory;
  -    }
  -
  -    /**
        * Configure this transformer.
        */
       public void configure(Configuration conf)
       throws ConfigurationException {
           if (conf != null) {
  -            Configuration child = conf.getChild("use-store");
  -            this.useStore = child.getValueAsBoolean(true);
  -            getLogger().debug("Use store is " + this.useStore + " for " + this);
  -            child = conf.getChild("use-request-parameters");
  -            this.useParameters = child.getValueAsBoolean(false);
  -            this._useParameters = this.useParameters;
  -            getLogger().debug("Use parameters is " + this.useParameters + " for " + this);
  -            child = conf.getChild("use-cookies");
  -            this.useCookies = child.getValueAsBoolean(false);
  -            this._useCookies = this.useCookies;
  -            getLogger().debug("Use cookies is " + this.useCookies + " for " + this);
  -            child = conf.getChild("use-browser-capabilities-db");
  -            this.useBrowserCap = child.getValueAsBoolean(false);
  -            this._useBrowserCap = this.useBrowserCap;
  -            getLogger().debug("Use browser capabilities is " + this.useBrowserCap + " for " + this);
  +          Configuration child;
  +
  +          child = conf.getChild("use-request-parameters");
  +          this.useParameters = child.getValueAsBoolean(false);
  +          this._useParameters = this.useParameters;
  +          getLogger().debug("Use parameters is " + this.useParameters + " for " + this);
  +
  +          child = conf.getChild("use-cookies");
  +          this.useCookies = child.getValueAsBoolean(false);
  +          this._useCookies = this.useCookies;
  +          getLogger().debug("Use cookies is " + this.useCookies + " for " + this);
  +
  +          child = conf.getChild("use-browser-capabilities-db");
  +          this.useBrowserCap = child.getValueAsBoolean(false);
  +          this._useBrowserCap = this.useBrowserCap;
  +          getLogger().debug("Use browser capabilities is " + this.useBrowserCap + " for " + this);
           }
       }
   
  @@ -323,10 +148,11 @@
       public void compose(ComponentManager manager) {
           try {
               this.manager = manager;
  -            getLogger().debug("Looking up " + Store.ROLE);
  -            this.store = (Store) this.manager.lookup(Store.ROLE);
  +            getLogger().debug("Looking up " + XSLTProcessor.ROLE);
  +            xsltProcessor = (XSLTProcessor)manager.lookup(XSLTProcessor.ROLE);
  +            getLogger().debug("XSLTProcessor = " + xsltProcessor);
               getLogger().debug("Looking up " + Browser.ROLE);
  -            this.browser = (Browser) this.manager.lookup(Browser.ROLE);
  +            this.browser = (Browser) manager.lookup(Browser.ROLE);
           } catch (Exception e) {
               getLogger().error("Could not find component", e);
           }
  @@ -347,11 +173,11 @@
           this.par = par;
           this.objectModel = objectModel;
           this.inputSource = resolver.resolve(src);
  -        this.resolver = resolver;
  +        xsltProcessor.setSourceResolver(resolver);
           getLogger().debug("Using stylesheet: '"+this.inputSource.getSystemId()+"' in " + this + ", last modified: " + this.inputSource.getLastModified());
           _useParameters = par.getParameterAsBoolean("use-request-parameters", this.useParameters);
  -        _useCookies = par.getParameterAsBoolean("use-cookies", this.useCookies);
           _useBrowserCap = par.getParameterAsBoolean("use-browser-capabilities-db", this.useBrowserCap);
  +        _useCookies = par.getParameterAsBoolean("use-cookies", this.useCookies);
       }
   
       /**
  @@ -408,17 +234,9 @@
   
           /** Get a Transformer Handler */
           try {
  -            transformerHandler = getTransformerHandler();
  -        } catch (TransformerConfigurationException e){
  -            getLogger().error("Problem in getTransformer:", e);
  -            throw new RuntimeException("Problem in getTransformer:" + e.getMessage());
  -        } catch (SAXException e){
  -            getLogger().error("Problem in getTransformer:", e);
  -            throw new RuntimeException("Problem in getTransformer:" + e.getMessage());
  -        } catch (IOException e){
  -            getLogger().error("Problem in getTransformer:", e);
  -            throw new RuntimeException("Problem in getTransformer:" + e.getMessage());
  -        } catch (ProcessingException e){
  +            transformerHandler
  +              = xsltProcessor.getTransformerHandler(inputSource);
  +        } catch (Exception e){
               getLogger().error("Problem in getTransformer:", e);
               throw new RuntimeException("Problem in getTransformer:" + e.getMessage());
           }
  @@ -565,8 +383,6 @@
   
       public void dispose()
       {
  -        if(this.store != null)
  -            this.manager.release((Component)this.store);
           if(this.browser != null)
               this.manager.release((Component)this.browser);
       }
  @@ -594,10 +410,11 @@
           */
           this.transformerHandler = null;
           this.objectModel = null;
  -        this.inputSource.recycle();
  -        this.inputSource = null;
  +        if (this.inputSource != null) {
  +          this.inputSource.recycle();
  +          this.inputSource = null;
  +        }
           this.par = null;
  -        this.resolver = null;
           this._useParameters = this.useParameters;
           this._useCookies = this.useCookies;
           this._useBrowserCap = this.useBrowserCap;
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.6   +28 -1     xml-cocoon2/src/org/apache/cocoon/util/IOUtils.java
  
  Index: IOUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/util/IOUtils.java,v
  retrieving revision 1.2.2.5
  retrieving revision 1.2.2.6
  diff -u -r1.2.2.5 -r1.2.2.6
  --- IOUtils.java	2001/08/20 14:07:35	1.2.2.5
  +++ IOUtils.java	2001/09/05 22:18:15	1.2.2.6
  @@ -9,6 +9,8 @@
   
   import org.apache.log.Hierarchy;
   
  +import java.io.ByteArrayInputStream;
  +import java.io.ByteArrayOutputStream;
   import java.io.BufferedInputStream;
   import java.io.BufferedOutputStream;
   import java.io.File;
  @@ -29,7 +31,7 @@
    *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.2.2.5 $ $Date: 2001/08/20 14:07:35 $
  + * @version CVS $Revision: 1.2.2.6 $ $Date: 2001/09/05 22:18:15 $
    */
   public class IOUtils {
   
  @@ -301,5 +303,30 @@
       File parent = file.getParentFile();
       if (parent != null) parent.mkdirs();
       return file;
  +  }
  +
  +  /**
  +   * Returns a byte array from the given object.
  +   *
  +   * @param object to convert
  +   * @return byte array from the object
  +   */
  +  public static byte[] objectToBytes(Object object) throws IOException {
  +    ByteArrayOutputStream baos = new ByteArrayOutputStream();
  +    ObjectOutputStream os = new ObjectOutputStream(baos);
  +    os.writeObject(object);
  +    return baos.toByteArray();
  +  }
  +
  +  /**
  +   * Returns a object from the given byte array.
  +   *
  +   * @param byte array to convert
  +   * @return object
  +   */
  +  public static Object bytesToObject(byte[] bytes) throws IOException, ClassNotFoundException {
  +    ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
  +    ObjectInputStream is = new ObjectInputStream(bais);
  +    return is.readObject();
     }
   }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +1 -1      xml-cocoon2/src/org/apache/cocoon/util/log/CocoonTargetFactory.java
  
  Index: CocoonTargetFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/util/log/CocoonTargetFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- CocoonTargetFactory.java	2001/08/30 19:15:43	1.1
  +++ CocoonTargetFactory.java	2001/09/05 22:18:15	1.1.2.1
  @@ -82,7 +82,7 @@
    * </dl>
    *
    * @author <a href="mailto:giacomo@apache,org">Giacomo Pati</a>
  - * @version CVS $Revision: 1.1 $ $Date: 2001/08/30 19:15:43 $
  + * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/09/05 22:18:15 $
    * @since 4.0
    */
   public class CocoonTargetFactory 
  
  
  
  1.1.2.1   +0 -0      xml-cocoon2/src/org/apache/cocoon/util/log/package.html
  
  Index: package.html
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/util/log/package.html,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.1.1.2.1 +3 -3      xml-cocoon2/src/org/apache/cocoon/xml/NamespacesTable.java
  
  Index: NamespacesTable.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/xml/NamespacesTable.java,v
  retrieving revision 1.1.1.1
  retrieving revision 1.1.1.1.2.1
  diff -u -r1.1.1.1 -r1.1.1.1.2.1
  --- NamespacesTable.java	2001/05/09 20:49:30	1.1.1.1
  +++ NamespacesTable.java	2001/09/05 22:18:16	1.1.1.1.2.1
  @@ -16,7 +16,7 @@
    *
    * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
    *         (Apache Software Foundation, Exoffice Technologies)
  - * @version CVS $Revision: 1.1.1.1 $ $Date: 2001/05/09 20:49:30 $
  + * @version CVS $Revision: 1.1.1.1.2.1 $ $Date: 2001/09/05 22:18:16 $
    */
   public class NamespacesTable {
       /** The initial namespace declaration. */
  @@ -284,7 +284,7 @@
        * A namespace-aware name. (This interface is used in conjunction
        * with <code>NamespacesTable</code>).
        */
  -    public static interface Name {
  +    public interface Name {
           /** Return the namespace URI. */
           String getUri();
           /** Return the namespace prefix. */
  @@ -299,7 +299,7 @@
        * A namespace declaration. (This interface is used in conjunction
        * with <code>NamespacesTable</code>).
        */
  -    public static interface Declaration {
  +    public interface Declaration {
           /** Return the namespace URI. */
           String getUri();
           /** Return the namespace prefix. */
  
  
  
  1.2.2.1   +13 -10    xml-cocoon2/src/org/apache/cocoon/xml/XMLFragment.java
  
  Index: XMLFragment.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/xml/XMLFragment.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- XMLFragment.java	2001/05/31 16:12:47	1.2
  +++ XMLFragment.java	2001/09/05 22:18:16	1.2.2.1
  @@ -15,21 +15,24 @@
    * This interface must be implemented by classes willing
    * to provide an XML representation of their current state.
    * <br/>
  - * This class replaces the Cocoon1 <code>XObject</code> class
  - * by using the SAX2 <code>ContentHandler</code> and exists in both
  - * Cocoon1 and Cocoon2 to ensure compatibility.
  + * This interface exists in both Cocoon 1 and Cocoon 2 and to ensure
  + * a minimal compatibility between the two versions.
  + * <br/>
  + * Cocoon 2 only objects can implement the SAX-only <code>XMLizable</code>
  + * interface.
    *
    * @author <a href="mailto:sylvain.wallez@anyware-tech.com">Sylvain Wallez</a>
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a> for the original XObject class
  - * @version CVS $Revision: 1.2 $ $Date: 2001/05/31 16:12:47 $
  + * @version CVS $Revision: 1.2.2.1 $ $Date: 2001/09/05 22:18:16 $
    */
   
  -public interface XMLFragment {
  -    /**
  -     * Generates SAX events representing the object's state
  -     * for the given content handler.
  -     */
  -    void toSAX(ContentHandler handler) throws SAXException;
  +public interface XMLFragment extends XMLizable {
  +// Now inherited from XMLizable
  +//    /**
  +//     * Generates SAX events representing the object's state
  +//     * for the given content handler.
  +//     */
  +//    void toSAX(ContentHandler handler) throws SAXException;
   
       /**
        * Appends children representing the object's state to the given node.
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +1 -1      xml-cocoon2/src/org/apache/cocoon/xml/XMLizable.java
  
  Index: XMLizable.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/xml/XMLizable.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- XMLizable.java	2001/08/24 10:03:45	1.1
  +++ XMLizable.java	2001/09/05 22:18:16	1.1.2.1
  @@ -15,7 +15,7 @@
    * of their current state as SAX events.
    *
    * @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
  - * @version CVS $Revision: 1.1 $ $Date: 2001/08/24 10:03:45 $
  + * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/09/05 22:18:16 $
    */
   
   public interface XMLizable {
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.1.1.2.3 +2 -2      xml-cocoon2/src/org/apache/cocoon/xml/dom/DOMBuilder.java
  
  Index: DOMBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/xml/dom/DOMBuilder.java,v
  retrieving revision 1.1.1.1.2.2
  retrieving revision 1.1.1.1.2.3
  diff -u -r1.1.1.1.2.2 -r1.1.1.1.2.3
  --- DOMBuilder.java	2001/08/20 14:07:36	1.1.1.1.2.2
  +++ DOMBuilder.java	2001/09/05 22:18:16	1.1.1.1.2.3
  @@ -33,7 +33,7 @@
    *
    * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
    *         (Apache Software Foundation, Exoffice Technologies)
  - * @version CVS $Revision: 1.1.1.1.2.2 $ $Date: 2001/08/20 14:07:36 $
  + * @version CVS $Revision: 1.1.1.1.2.3 $ $Date: 2001/09/05 22:18:16 $
    */
   public class DOMBuilder implements XMLConsumer, Loggable {
       protected Logger log;
  @@ -584,7 +584,7 @@
        * The Listener interface must be implemented by those objects willing to
        * be notified of a successful DOM tree generation.
        */
  -    public static interface Listener {
  +    public interface Listener {
   
           /**
            * Receive notification of a successfully completed DOM tree generation.
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.7.2.21  +37 -31    xml-cocoon2/webapp/cocoon.xconf
  
  Index: cocoon.xconf
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/cocoon.xconf,v
  retrieving revision 1.7.2.20
  retrieving revision 1.7.2.21
  diff -u -r1.7.2.20 -r1.7.2.21
  --- cocoon.xconf	2001/08/30 13:04:51	1.7.2.20
  +++ cocoon.xconf	2001/09/05 22:18:16	1.7.2.21
  @@ -19,29 +19,48 @@
     -->
   
     <!-- Storing:
  -       freememory: Indicates how much memory should be left free in the
  -                   JVM for normal operation.
  -       heapsize: Indicates how big the heap size can grow to before the
  -                 cleanup thread kicks in.
  -       cleanupthreadinterval: Indicates the interval of the cleanup thread in seconds.
          maxobjects: Indicates how many objects will be hold in the cache.
                      When the number of maxobjects has been reached. The
                      last object in the cache will be thrown out.
  -       usecleanupthread: Indicates whether we use a cleanup thread or not.
  -       threadpriority: Indicates the priority of the cleanup thread.
  +       threadpriority: Indicates the priority of the writer thread.
                          (1 is the lowest priority and 10 is the highest).
          filesystem: Turns the filesystem storage for objects on or off.
     -->
  -  <store class="org.apache.cocoon.components.store.MRUMemoryStore">
  -     <parameter name="freememory" value="1000000"/>
  -     <parameter name="heapsize" value="60000000"/>
  -     <parameter name="cleanupthreadinterval" value="10"/>
  +  <store class="org.apache.cocoon.components.store.MRUMemoryStore" logger="root.store">
        <parameter name="maxobjects" value="100"/>
  -     <parameter name="usecleanupthread" value="true"/>
        <parameter name="threadpriority" value="5"/>
        <parameter name="filesystem" value="true"/>
     </store>
   
  +  <!-- Store Janitor:
  +    freememory = How much free memory shall be available in the jvm
  +    heapsize = Indicates the limit of the jvm memory consumption
  +    cleanupthreadinterval = How often shall the cleanup thread check memory
  +    threadpriority = Indicates the thread priority of the cleanup thread
  +
  +    Be carefull with the heapsize and freememory paramters. Wrong values can
  +    cause high cpu usage.
  +    Example configuration:
  +    Jvm settings: 
  +      -Xms100000000 -Xmx200000000
  +    store-janitor settings:
  +       <parameter name="freememory" value="50000000"/>
  +       <parameter name="heapsize" value="150000000"/>
  +  
  +    Heapsize must be higher then the -Xms parameter and freememory
  +    between those both.    
  +  -->
  +  <store-janitor class="org.apache.cocoon.components.store.StoreJanitorImpl" logger="root.store">
  +     <parameter name="freememory" value="1000000"/>
  +     <parameter name="heapsize" value="60000000"/>
  +     <parameter name="cleanupthreadinterval" value="10"/>
  +     <parameter name="threadpriority" value="5"/>
  +  </store-janitor>
  +
  +  <xslt-processor class="org.apache.cocoon.components.xslt.XSLTProcessorImpl" logger="root.xslt">
  +     <parameter name="use-store" value="true"/>
  +  </xslt-processor>
  +
     <!-- The url factory adds special url protocols to the system, they
          are then available inside Cocoon, e.g. as a source argument
          for one of the sitemap components -->
  @@ -178,6 +197,7 @@
             <parameter name="uri" value="http://apache.org/cocoon/capture/1.0"/>
             <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/capture.xsl"/>
           </builtin-logicsheet>
  +
         </target-language>
       </xsp-language>
   
  @@ -224,7 +244,7 @@
          or connects a EventPipeline with a
          Serializer and let them produce the character stream.
     -->
  -  <stream-pipeline class="org.apache.cocoon.components.pipeline.CachingStreamPipeline" 
  +  <stream-pipeline class="org.apache.cocoon.components.pipeline.CachingStreamPipeline"
                      pool-max="32" pool-min="16" pool-grow="4"/>
   
     <!-- Caching of stream pipeline:
  @@ -241,44 +261,30 @@
                          (1 is the lowest priority and 10 is the highest).
          filesystem: Turns the filesystem storage for objects on or off.
     -->
  -  <stream-cache class="org.apache.cocoon.components.store.MRUMemoryStore">
  -     <parameter name="freememory" value="1000000"/>
  -     <parameter name="heapsize" value="60000000"/>
  -     <parameter name="cleanupthreadinterval" value="10"/>
  +  <stream-cache class="org.apache.cocoon.components.store.MRUMemoryStore" logger="root.store">
        <parameter name="maxobjects" value="100"/>
  -     <parameter name="usecleanupthread" value="true"/>
        <parameter name="threadpriority" value="5"/>
        <parameter name="filesystem" value="true"/>
     </stream-cache>
   
     <!-- An EventPipeline connects the generator and the various transformers
          and produces a character stream. Alternatives to CachingEventPipeline
  -       are: NonCachingEventPipeline.
  +       is: NonCachingEventPipeline.
     <event-pipeline class="org.apache.cocoon.components.pipeline.NonCachingEventPipeline"/>
     -->
     <event-pipeline class="org.apache.cocoon.components.pipeline.CachingEventPipeline"
  -                   pool-max="32" pool-min="16" pool-grow="4"/>
  +                  pool-max="32" pool-min="16" pool-grow="4"/>
   
     <!-- Caching of event pipeline:
  -       freememory: Indicates how much memory should be left free in the
  -                   JVM for normal operation.
  -       heapsize: Indicates how big the heap size can grow to before the
  -                 cleanup thread kicks in.
  -       cleanupthreadinterval: Indicates the interval of the cleanup thread in seconds.
          maxobjects: Indicates how many objects will be hold in the cache.
                      When the number of maxobjects has been reached. The
                      last object in the cache will be thrown out.
  -       usecleanupthread: Indicates whether we use a cleanup thread or not.
          threadpriority: Indicates the priority of the cleanup thread.
                          (1 is the lowest priority and 10 is the highest).
          filesystem: Turns the filesystem storage for objects on or off.
     -->
  -  <event-cache class="org.apache.cocoon.components.store.MRUMemoryStore">
  -     <parameter name="freememory" value="1000000"/>
  -     <parameter name="heapsize" value="60000000"/>
  -     <parameter name="cleanupthreadinterval" value="10"/>
  +  <event-cache class="org.apache.cocoon.components.store.MRUMemoryStore" logger="root.store">
        <parameter name="maxobjects" value="100"/>
  -     <parameter name="usecleanupthread" value="true"/>
        <parameter name="threadpriority" value="5"/>
        <parameter name="filesystem" value="true"/>
     </event-cache>
  
  
  
  1.11.2.31 +34 -2     xml-cocoon2/webapp/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/sitemap.xmap,v
  retrieving revision 1.11.2.30
  retrieving revision 1.11.2.31
  diff -u -r1.11.2.30 -r1.11.2.31
  --- sitemap.xmap	2001/08/24 13:00:37	1.11.2.30
  +++ sitemap.xmap	2001/09/05 22:18:16	1.11.2.31
  @@ -31,7 +31,10 @@
      <map:transformer     name="log"       src="org.apache.cocoon.transformation.LogTransformer"/>
      <map:transformer     name="sql"       src="org.apache.cocoon.transformation.SQLTransformer"/>
      <map:transformer     name="extractor" src="org.apache.cocoon.transformation.FragmentExtractorTransformer"/>
  -   <map:transformer     name="i18n"      src="org.apache.cocoon.transformation.I18nTransformer"/>
  +   <map:transformer     name="i18n"      src="org.apache.cocoon.transformation.I18nTransformer">
  +    <catalogue-name>messages</catalogue-name>
  +    <catalogue-location>translations</catalogue-location>
  +   </map:transformer>
      <map:transformer     name="xinclude"  src="org.apache.cocoon.transformation.XIncludeTransformer"/>
      <map:transformer     name="cinclude"  src="org.apache.cocoon.transformation.CIncludeTransformer"/>
      <map:transformer     name="filter"  src="org.apache.cocoon.transformation.FilterTransformer"/>
  @@ -191,11 +194,26 @@
   <!-- =========================== Pipelines ================================= -->
   
    <map:pipelines>
  +
  +  <!-- Utility for viewing source xml or html-->
  +  <map:pipeline>
  +   <map:match pattern="**.source">
  +    <map:generate src="cocoon:/{1}" />
  +    <map:transform src="stylesheets/simple-xml2html.xsl"/>
  +    <map:serialize/>
  +   </map:match>
  +  </map:pipeline>
  +
     <!-- sub-sitemap example pipeline -->
     <map:pipeline>
      <map:match pattern="sub/**">
       <map:mount uri-prefix="sub" src="sub/" check-reload="yes"/>
      </map:match>
  +
  +   <map:handle-errors>
  +    <map:transform src="stylesheets/system/error2html.xsl"/>
  +    <map:serialize status-code="500"/>
  +   </map:handle-errors>
     </map:pipeline>
   
     <!-- protected webapp example pipeline -->
  @@ -240,7 +258,7 @@
     </map:pipeline>
   
     <map:pipeline>
  -
  +   
      <map:match pattern="">
       <map:redirect-to uri="welcome"/>
      </map:match>
  @@ -379,6 +397,20 @@
       </map:aggregate>
       <map:transform src="stylesheets/news/news.xsl"/>
       <map:serialize/>
  +   </map:match>
  +
  +   <!-- ==============  Catalog  ========================== -->
  +
  +   <map:match pattern="**/samples/catalog-demo">
  +    <map:generate src="docs/samples/catalog/test.xml"/>
  +    <map:transform src="docs/samples/catalog/style.xsl"/>
  +    <map:serialize type="html"/>
  +   </map:match>
  +
  +   <map:match pattern="catalog-demo">
  +    <map:generate src="docs/samples/catalog/test.xml"/>
  +    <map:transform src="docs/samples/catalog/style.xsl"/>
  +    <map:serialize type="html"/>
      </map:match>
   
      <!-- ======================== C2 Docs ============================== -->
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.1.1.2.8 +42 -43    xml-cocoon2/webapp/WEB-INF/web.xml
  
  Index: web.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/WEB-INF/web.xml,v
  retrieving revision 1.1.1.1.2.7
  retrieving revision 1.1.1.1.2.8
  diff -u -r1.1.1.1.2.7 -r1.1.1.1.2.8
  --- web.xml	2001/08/18 18:19:07	1.1.1.1.2.7
  +++ web.xml	2001/09/05 22:18:16	1.1.1.1.2.8
  @@ -49,64 +49,49 @@
       </init-param>
   
       <!--
  -      This parameter indicates the log level to use throughout the system
  -
  -      Available levels are:
  -        DEBUG:        prints all level of log messages.
  -        INFO:         prints all level of log messages except DEBUG ones.
  -        WARN:         prints all level of log messages except DEBUG and INFO ones.
  -        ERROR:        prints all level of log messages except DEBUG, INFO and WARN ones.
  -        FATAL-ERROR: prints only log messages of this level
  +      This parameter indicates the configuration file of the LogKit management
       -->
       <init-param>
  -      <param-name>log-level</param-name>
  -      <param-value>DEBUG</param-value>
  +      <param-name>logkit-config</param-name>
  +      <param-value>/WEB-INF/logkit.xconf</param-value>
       </init-param>
   
       <!--
  -      This parameter indicates the directory where Cocoon should put the log file.
  -      Note that this path must be specified as an absolute path into your filesystem
  -      and it is not rooted at the servlets context path. Also note that the path 
  -      must end with a file separator character.
  -      The default location is in the servlets context root at /WEB-INF/logs/.
  -
  +      This parameter indicates the category id of the logger from the LogKit 
  +      configuration used by the CocoonServlet. 
  +    -->
       <init-param>
  -      <param-name>log-dir</param-name>
  -      <param-value>/WEB-INF/logs</param-value>
  +      <param-name>servlet-logger</param-name>
  +      <param-value>root</param-value>
       </init-param>
  -    -->
   
       <!--
  -      This parameter specifies the name of the log file to use. It will be created in 
  -      the log-dir mentioned above.
  -      The default name is "cocoon.log".
  -
  -    <init-param>
  -      <param-name>log-name</param-name>
  -      <param-value>cocoon.log</param-value>
  -    </init-param>
  +      This parameter indicates the category id of the logger from the LogKit
  +      management configuration for the Cocoon engine.
  +      This logger is used for all components described in the cocoon.xconf 
  +      and sitemap.xmap file not having specified a logger with the 
  +      logger="..." attribute in the component configuration file.
       -->
  -  
  -    <!-- 
  -      This parameter specifies the format of the log. You can choose between xml
  -      and text, default is text.
  -
       <init-param>
  -      <param-name>log-format</param-name>
  -      <param-value>xml</param-value>
  +      <param-name>cocoon-logger</param-name>
  +      <param-value>cocoon</param-value>
       </init-param>
  -    -->
  -  
  -    <!-- 
  -      This boolean value parameter specifies whether the cocoon log file
  -      should be appended to or not.
   
  +    <!--
  +      This parameter indicates the log level to use throughout startup of the system
  + 
  +      Available levels are:
  +        DEBUG:        prints all level of log messages.
  +        INFO:         prints all level of log messages except DEBUG ones.
  +        WARN:         prints all level of log messages except DEBUG and INFO ones.
  +        ERROR:        prints all level of log messages except DEBUG, INFO and WARN ones.
  +        FATAL-ERROR: prints only log messages of this level
  +    -->
       <init-param>
  -      <param-name>log-append</param-name>
  -      <param-value>true</param-value>
  +      <param-name>log-level</param-name>
  +      <param-value>DEBUG</param-value>
       </init-param>
  -    -->
  -  
  +
       <!-- 
         Allow reinstantiating (reloading) of the cocoon instance. If this is
         set to "yes" or "true", a new cocoon instance can be created using
  @@ -182,6 +167,20 @@
         <param-value>WEB-INF/extra-classes1:/[YOU-ABSOLUTE-PATH-TO]/own.jar</param-value>
       </init-param>
       -->
  +
  +    <!--
  +      This parameter allows you to select the parent component manager.
  +      The class will be instantiated via the constructor that takes a single
  +      String as a parameter. That String will be equal to the text after the
  +      '/'.
  +
  +      Cocoon honors the Loggable and Initializable interfaces for this class,
  +      if it implements them.
  +    -->
  +    <init-param>
  +      <param-name>parent-component-manager</param-name>
  +      <param-value>org.apache.cocoon.components.ParentComponentManager/InitParameter</param-value>
  +    </init-param>
   
       <!--
         This parameter allows you to startup Cocoon2 immediately after startup
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +0 -0      xml-cocoon2/webapp/WEB-INF/logkit.xconf
  
  Index: logkit.xconf
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/WEB-INF/logkit.xconf,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.7   +9 -0      xml-cocoon2/webapp/docs/samples/samples.xml
  
  Index: samples.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/docs/samples/samples.xml,v
  retrieving revision 1.3.2.6
  retrieving revision 1.3.2.7
  diff -u -r1.3.2.6 -r1.3.2.7
  --- samples.xml	2001/07/16 13:14:27	1.3.2.6
  +++ samples.xml	2001/09/05 22:18:16	1.3.2.7
  @@ -30,6 +30,15 @@
      </sample>
     </group>
   
  +  <group name="Entity Catalogs">
  +   <sample name="Entity resolution using catalogs" href="catalog-demo">
  +    External entities (e.g. DTDs, symbols, character entity sets, images) are
  +    resolved to local copies of the resources. The catalog manager facilitates
  +    the mapping between public identifiers or system identifiers and other
  +    system identifiers.
  +   </sample>
  +  </group>
  +
     <group name="XML-ized web sites">
      <sample name="java.apache.org" href="sites/java.apache.org">
       This page shows a much more complex example that shows how powerful
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/docs/samples/catalog/style.xsl
  
  Index: style.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/docs/samples/catalog/style.xsl,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/docs/samples/catalog/test.xml
  
  Index: test.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/docs/samples/catalog/test.xml,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/docs/samples/catalog/testovr.xml
  
  Index: testovr.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/docs/samples/catalog/testovr.xml,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.1.1.2.1 +333 -340  xml-cocoon2/webapp/docs/samples/fo/readme.fo
  
  Index: readme.fo
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/docs/samples/fo/readme.fo,v
  retrieving revision 1.1.1.1
  retrieving revision 1.1.1.1.2.1
  diff -u -r1.1.1.1 -r1.1.1.1.2.1
  --- readme.fo	2001/05/09 20:50:16	1.1.1.1
  +++ readme.fo	2001/09/05 22:18:17	1.1.1.1.2.1
  @@ -1,10 +1,11 @@
   <?xml version="1.0" encoding="utf-8"?>
  +
   <!--
   THIS IS NOT THE LATEST VERSION OF THE FOP DOCUMENTATION BUT ONLY AN EXAMPLE FILE 
   
  -This files shows next to the trivial usage of fo:block and fo:inline-sequence examples of
  -- fo:simple-link external-destination
  -- fo:simple-link internal-destination
  +This files shows next to the trivial usage of fo:block and fo:inline examples of
  +- fo:basic-link external-destination
  +- fo:basic-link internal-destination
   - fo:table
   - fo:list-block (including a bullet from the font Symbol as list-item-label)
   - fo:page-number-citation (computes dynamically the page number in section 'content') 
  @@ -22,21 +23,21 @@
                     margin-bottom="2cm" 
                     margin-left="2.5cm" 
                     margin-right="2.5cm">
  -      <fo:region-before extent="3cm"/>
         <fo:region-body margin-top="3cm"/>
  +      <fo:region-before extent="3cm"/>
         <fo:region-after extent="1.5cm"/>
       </fo:simple-page-master>
   
       <!-- layout for the other pages -->
       <fo:simple-page-master master-name="rest"
  -                  height="29.7cm" 
  -                  width="21cm"
  +                  page-height="29.7cm" 
  +                  page-width="21cm"
                     margin-top="1cm" 
                     margin-bottom="2cm" 
                     margin-left="2.5cm" 
                     margin-right="2.5cm">
  -      <fo:region-before extent="2.5cm"/>
         <fo:region-body margin-top="2.5cm"/>
  +      <fo:region-before extent="2.5cm"/>
         <fo:region-after extent="1.5cm"/>
       </fo:simple-page-master>
   
  @@ -78,36 +79,33 @@
   
     </fo:block>
     <fo:block space-after.optimum="3pt" font-family="serif">FOP is part of Apache's XML project. The homepage of FOP is 
  -     <fo:inline-sequence font-style="italic" font-family="serif"><fo:simple-link color="blue" external-destination="http://xml.apache.org/fop">http://xml.apache.org/fop</fo:simple-link></fo:inline-sequence>
  +     <fo:inline font-style="italic" font-family="serif"><fo:basic-link color="blue" external-destination="http://xml.apache.org/fop">http://xml.apache.org/fop</fo:basic-link></fo:inline>
     </fo:block>
   
   
   
  -
  -
  -
     <fo:block  id="sec2" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >B) 
         Downloading FOP</fo:block>
  -  <fo:block space-after.optimum="3pt" font-family="serif">The latest release version is <fo:inline-sequence font-style="italic" font-family="serif">FOP 12.0</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  +  <fo:block space-after.optimum="3pt" font-family="serif">The latest release version is <fo:inline font-style="italic" font-family="serif">FOP
  +0.14</fo:inline> <fo:inline font-family="serif">
         ()
  -   </fo:inline-sequence>. </fo:block>
  +   </fo:inline>. </fo:block>
     <fo:block space-after.optimum="3pt" font-family="serif">NOTE: you do not have to unjar or unzip this jar file.</fo:block>
  -  <fo:block space-after.optimum="3pt" font-family="serif">Documentation can be downloaded here as <fo:inline-sequence font-style="italic" font-family="serif">HMTL file</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  +  <fo:block space-after.optimum="3pt" font-family="serif">Documentation can be downloaded here as <fo:inline font-style="italic" font-family="serif">HMTL file</fo:inline>
  +<fo:inline font-family="serif">
         ()
  -   </fo:inline-sequence> or 
  -     as <fo:inline-sequence font-style="italic" font-family="serif">PDF file</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  +   </fo:inline> or 
  +     as <fo:inline font-style="italic" font-family="serif">PDF file</fo:inline>
  +<fo:inline font-family="serif">
         ()
  -   </fo:inline-sequence>.</fo:block>
  +   </fo:inline>.</fo:block>
     <fo:block space-after.optimum="3pt" font-family="serif">To run FOP from the command line, see Running FOP. If you are interested in 
        embedding FOP in a Java application of your own, see Embedding FOP.
     </fo:block>
  -  <fo:block space-after.optimum="3pt" font-family="serif">You can also download the <fo:inline-sequence font-style="italic" font-family="serif">source code v. 12.0</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  +  <fo:block space-after.optimum="3pt" font-family="serif">You can also download the <fo:inline font-style="italic" font-family="serif">source code v. 0.14</fo:inline>
  +<fo:inline font-family="serif">
         ()
  -   </fo:inline-sequence> as jar file</fo:block>
  +   </fo:inline> as jar file</fo:block>
   
   
   
  @@ -122,28 +120,28 @@
         <fo:block space-after.optimum="3pt" font-family="serif">For the fo-file viewer mode of FOP (see below) you must have the swing classes installed. 
            From Java 1.2 on (aka Java 2) they are part of the standard java distribution. 
            If you use Java 1.1.x you must seperately include the swing classes, which can
  -         be found at the <fo:inline-sequence font-style="italic" font-family="serif">
  -         Sun website</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  +         be found at the <fo:inline font-style="italic" font-family="serif">
  +         Sun website</fo:inline>
  +<fo:inline font-family="serif">
         (http://java.sun.com/products/jfc/#download-swing)
  -   </fo:inline-sequence>. 
  +   </fo:inline>. 
         </fo:block>
       <fo:block space-after.optimum="3pt" font-family="serif">b) An XML parser which supports SAX and DOM like 
  -          <fo:inline-sequence font-style="italic" font-family="serif">Xerces-J</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  +          <fo:inline font-style="italic" font-family="serif">Xerces-J</fo:inline>
  +<fo:inline font-family="serif">
         (http://xml.apache.org/xerces-j/index.html)
  -   </fo:inline-sequence>.</fo:block>
  +   </fo:inline>.</fo:block>
       <fo:block space-after.optimum="3pt" font-family="serif">c) If you have to produce the flow objects files, which are the input for FOP, 
          you need a transformation utility to create this files from your xml files. 
          Normally this is an XSLT stylesheet processor like 
  -       <fo:inline-sequence font-style="italic" font-family="serif">XT</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  +       <fo:inline font-style="italic" font-family="serif">XT</fo:inline>
  +<fo:inline font-family="serif">
         (http://www.jclark.com/xml/xt.html)
  -   </fo:inline-sequence> 
  -       or <fo:inline-sequence font-style="italic" font-family="serif">XALAN</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  +   </fo:inline> 
  +       or <fo:inline font-style="italic" font-family="serif">XALAN</fo:inline>
  +<fo:inline font-family="serif">
         (http://xml.apache.org/xalan/index.html)
  -   </fo:inline-sequence>. 
  +   </fo:inline>. 
       </fo:block>
     
     
  @@ -230,10 +228,10 @@
     
       <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >4) Problems</fo:block>
       <fo:block space-after.optimum="3pt" font-family="serif">If you have problems running FOP, please have a look at the 
  -       <fo:inline-sequence font-style="italic" font-family="serif">FOP FAQ</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  +       <fo:inline font-style="italic" font-family="serif">FOP FAQ</fo:inline>
  +<fo:inline font-family="serif">
         (faq.html)
  -   </fo:inline-sequence>. If you don't find a solution there,
  +   </fo:inline>. If you don't find a solution there,
          you can ask for help on the list fop-dev@xml.apache.org. Maybe it's bug and 
          maybe somebody is already working on it. 
       </fo:block>
  @@ -241,11 +239,6 @@
   
   
   
  -
  -
  -
  -
  -
     <fo:block  id="sec4" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >D) 
         Embedding FOP </fo:block>
     <fo:block space-after.optimum="3pt" font-family="serif">Instantiate org.apache.fop.apps.Driver. Once this class is 
  @@ -291,226 +284,226 @@
       <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >1) Formatting Objects</fo:block>
       <fo:list-block start-indent="1cm" provisional-distance-between-starts="12pt" font-family="serif">
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>root </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>layout-master-set </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>simple-page-master </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>region-body </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>region-before </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>region-after </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>page-sequence </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>sequence-specification </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>sequence-specifier-single </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>sequence-specifier-repeating </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>sequence-specifier-alternating </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>flow </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>static-content </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>block </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>list-block </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>list-item </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>list-item-label </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>list-item-body </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>page-number </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>display-sequence </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  -<fo:block>inline-sequence </fo:block>
  +<fo:list-item-body start-indent="body-start()">
  +<fo:block>inline </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>display-rule </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>display-graphic </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>table (minimal support)</fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>table-column (minimal support)</fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>table-body (minimal support)</fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>table-row (minimal support)</fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>table-cell (minimal support)</fo:block>
   </fo:list-item-body>
   </fo:list-item>
  @@ -521,330 +514,330 @@
       <fo:block font-size="16pt" font-family="serif" line-height="18pt" space-before.optimum="8pt" space-after.optimum="8pt" >2) Properties</fo:block>
       <fo:list-block start-indent="1cm" provisional-distance-between-starts="12pt" font-family="serif">
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>end-indent </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>page-master-name </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>page-master-first </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>page-master-repeating </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>page-master-odd </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>page-master-even </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>margin-top (only on pages and regions)</fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>margin-bottom (only on pages and regions)</fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>margin-left (only on pages and regions)</fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>margin-right (only on pages and regions)</fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>extent </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>page-width </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>page-height </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>flow-name </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>font-family </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>font-style </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>font-weight </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>font-size </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>line-height </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>text-align </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>text-align-last </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>space-before.optimum </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>space-after.optimum </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>start-indent </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>end-indent </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>provisional-distance-between-starts </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>provisional-label-separation </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>rule-thickness </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>color </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>wrap-option </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>white-space-treatment </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>break-before </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>break-after </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>text-indent </fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>href</fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>column-width</fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>background-color</fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>padding-top (only in conjunction with background color)</fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>padding-left (only in conjunction with background color)</fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>padding-bottom (only in conjunction with background color)</fo:block>
   </fo:list-item-body>
   </fo:list-item>
         <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>padding-right (only in conjunction with background color)</fo:block>
   </fo:list-item-body>
   </fo:list-item>
  @@ -944,21 +937,21 @@
       
         <fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >a) Java 1.1.x or later</fo:block>
         <fo:block space-after.optimum="3pt" font-family="serif">If you use Java 1.1.x you must also seperately include the swing classes, which can
  -         be found at the <fo:inline-sequence font-style="italic" font-family="serif">
  -         Sun website</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  +         be found at the <fo:inline font-style="italic" font-family="serif">
  +         Sun website</fo:inline>
  +<fo:inline font-family="serif">
         (http://java.sun.com/products/jfc/#download-swing)
  -   </fo:inline-sequence>. From Java 1.2 on (aka Java 2) they are part of the standard 
  +   </fo:inline>. From Java 1.2 on (aka Java 2) they are part of the standard 
            distribution. 
         </fo:block>
       
       
         <fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >b) An XML parser</fo:block>
         <fo:block space-after.optimum="3pt" font-family="serif">An XML parser which supports DOM like 
  -         <fo:inline-sequence font-style="italic" font-family="serif">Xerces-J</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  +         <fo:inline font-style="italic" font-family="serif">Xerces-J</fo:inline>
  +<fo:inline font-family="serif">
         (http://xml.apache.org/xerces-j/index.html)
  -   </fo:inline-sequence>.</fo:block>
  +   </fo:inline>.</fo:block>
       
       
         <fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >c) XT from James Clark</fo:block>
  @@ -967,30 +960,30 @@
         <fo:block space-after.optimum="3pt" font-family="serif">XT is an XSL stylesheet processor written in java. At the moment you
            can't use any other processor, because the make file makes use of some
            proprietary features of Clark's xt which allow to write output in more
  -         then one document. You can find XT at <fo:inline-sequence font-style="italic" font-family="serif">
  -        James Clark's website</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  +         then one document. You can find XT at <fo:inline font-style="italic" font-family="serif">
  +        James Clark's website</fo:inline>
  +<fo:inline font-family="serif">
         (http://www.jclark.com/xml/xt.html)
  -   </fo:inline-sequence>. You have to use XT version 19991105 or later.</fo:block>
  +   </fo:inline>. You have to use XT version 19991105 or later.</fo:block>
         <fo:block space-after.optimum="3pt" font-family="serif">(Under windows you shouldn't use the prepackaged xt.exe but also the
            generic jar file, otherwise make won't work)
         </fo:block>
         <fo:block space-after.optimum="3pt" font-family="serif">XT relies on an sax parser like XP (also J. Clark), which can be
  -         downloaded at <fo:inline-sequence font-style="italic" font-family="serif">James 
  -         Clark's Website</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  +         downloaded at <fo:inline font-style="italic" font-family="serif">James 
  +         Clark's Website</fo:inline>
  +<fo:inline font-family="serif">
         (http://www.jclark.com/xml/xp/index.html)
  -   </fo:inline-sequence>
  +   </fo:inline>
         </fo:block>
       
       
         <fo:block font-size="14pt" font-family="serif" line-height="16pt" space-before.optimum="8pt" space-after.optimum="4pt" >d) make</fo:block>
         <fo:block space-after.optimum="3pt" font-family="serif">Under windows it has been reported that the use of the cygnus solutions port 
            of the GNU utilities works. You can find it at 
  -         <fo:inline-sequence font-style="italic" font-family="serif">Cygnus Solutions</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  +         <fo:inline font-style="italic" font-family="serif">Cygnus Solutions</fo:inline>
  +<fo:inline font-family="serif">
         (http://sourceware.cygnus.com/cygwin/)
  -   </fo:inline-sequence>
  +   </fo:inline>
         </fo:block>
       
     
  @@ -1032,106 +1025,106 @@
         FOP Relevant Specifications</fo:block>
     <fo:list-block start-indent="1cm" provisional-distance-between-starts="12pt" font-family="serif">
       <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>
  -<fo:inline-sequence font-style="italic" font-family="serif">XML Recommendation</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif" >
  -      (<fo:simple-link color="blue" external-destination="http://www.w3.org/TR/REC-xml">http://www.w3.org/TR/REC-xml</fo:simple-link>)
  -   </fo:inline-sequence>    
  +<fo:inline font-style="italic" font-family="serif">XML Recommendation</fo:inline>
  +<fo:inline font-family="serif" >
  +      (<fo:basic-link color="blue" external-destination="http://www.w3.org/TR/REC-xml">http://www.w3.org/TR/REC-xml</fo:basic-link>)
  +   </fo:inline>    
   </fo:block>
   </fo:list-item-body>
   </fo:list-item>
       <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>
  -<fo:inline-sequence font-style="italic" font-family="serif">XSL-FO Working Draft</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  -      (<fo:simple-link color="blue" external-destination="http://www.w3.org/TR/WD-xsl/">http://www.w3.org/TR/WD-xsl/</fo:simple-link>)
  -   </fo:inline-sequence>
  +<fo:inline font-style="italic" font-family="serif">XSL-FO Working Draft</fo:inline>
  +<fo:inline font-family="serif">
  +      (<fo:basic-link color="blue" external-destination="http://www.w3.org/TR/WD-xsl/">http://www.w3.org/TR/WD-xsl/</fo:basic-link>)
  +   </fo:inline>
   </fo:block>
   </fo:list-item-body>
   </fo:list-item>
       <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>
  -<fo:inline-sequence font-style="italic" font-family="serif">XSLT Recommendation</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  -      (<fo:simple-link color="blue" external-destination="http://www.w3.org/TR/xslt">http://www.w3.org/TR/xslt</fo:simple-link>)
  -   </fo:inline-sequence>
  +<fo:inline font-style="italic" font-family="serif">XSLT Recommendation</fo:inline>
  +<fo:inline font-family="serif">
  +      (<fo:basic-link color="blue" external-destination="http://www.w3.org/TR/xslt">http://www.w3.org/TR/xslt</fo:basic-link>)
  +   </fo:inline>
   </fo:block>
   </fo:list-item-body>
   </fo:list-item>
       <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>
  -<fo:inline-sequence font-style="italic" font-family="serif">PDF Documentation</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  -      (<fo:simple-link color="blue" external-destination="http://partners.adobe.com/asn/developer/acrosdk/DOCS/pdfspec.pdf">http://partners.adobe.com/asn/developer/acrosdk/DOCS/pdfspec.pdf</fo:simple-link>)
  -   </fo:inline-sequence>
  +<fo:inline font-style="italic" font-family="serif">PDF Documentation</fo:inline>
  +<fo:inline font-family="serif">
  +      (<fo:basic-link color="blue" external-destination="http://partners.adobe.com/asn/developer/acrosdk/DOCS/pdfspec.pdf">http://partners.adobe.com/asn/developer/acrosdk/DOCS/pdfspec.pdf</fo:basic-link>)
  +   </fo:inline>
   </fo:block>
   </fo:list-item-body>
   </fo:list-item>
       <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>
  -<fo:inline-sequence font-style="italic" font-family="serif">Simple API for XML (SAX)</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  -      (<fo:simple-link color="blue" external-destination="http://www.megginson.com/SAX/">http://www.megginson.com/SAX/</fo:simple-link>)
  -   </fo:inline-sequence>
  +<fo:inline font-style="italic" font-family="serif">Simple API for XML (SAX)</fo:inline>
  +<fo:inline font-family="serif">
  +      (<fo:basic-link color="blue" external-destination="http://www.megginson.com/SAX/">http://www.megginson.com/SAX/</fo:basic-link>)
  +   </fo:inline>
   </fo:block>
   </fo:list-item-body>
   </fo:list-item>
       <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>
  -<fo:inline-sequence font-style="italic" font-family="serif">Document Object Model (DOM)</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  -      (<fo:simple-link color="blue" external-destination="http://www.w3.org/TR/REC-DOM-Level-1">http://www.w3.org/TR/REC-DOM-Level-1</fo:simple-link>)
  -   </fo:inline-sequence>
  +<fo:inline font-style="italic" font-family="serif">Document Object Model (DOM)</fo:inline>
  +<fo:inline font-family="serif">
  +      (<fo:basic-link color="blue" external-destination="http://www.w3.org/TR/REC-DOM-Level-1">http://www.w3.org/TR/REC-DOM-Level-1</fo:basic-link>)
  +   </fo:inline>
   </fo:block>
   </fo:list-item-body>
   </fo:list-item>
       <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>
  -<fo:inline-sequence font-style="italic" font-family="serif">Namespaces in XML Recommendation</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  -      (<fo:simple-link color="blue" external-destination="http://www.w3.org/TR/REC-xml-names/">http://www.w3.org/TR/REC-xml-names/</fo:simple-link>)
  -   </fo:inline-sequence>
  +<fo:inline font-style="italic" font-family="serif">Namespaces in XML Recommendation</fo:inline>
  +<fo:inline font-family="serif">
  +      (<fo:basic-link color="blue" external-destination="http://www.w3.org/TR/REC-xml-names/">http://www.w3.org/TR/REC-xml-names/</fo:basic-link>)
  +   </fo:inline>
   </fo:block>
   </fo:list-item-body>
   </fo:list-item>
       <fo:list-item>
  -<fo:list-item-label>
  -<fo:block><fo:inline-sequence font-family="Symbol">&#183;</fo:inline-sequence></fo:block>
  +<fo:list-item-label end-indent="label-end()">
  +<fo:block><fo:inline font-family="Symbol">&#183;</fo:inline></fo:block>
   </fo:list-item-label>
  -<fo:list-item-body>
  +<fo:list-item-body start-indent="body-start()">
   <fo:block>
  -<fo:inline-sequence font-style="italic" font-family="serif">Java JDK 1.1 Documentation</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  -      (<fo:simple-link color="blue" external-destination="http://java.sun.com/products/jdk/1.1/docs/index.html">http://java.sun.com/products/jdk/1.1/docs/index.html</fo:simple-link>)
  -   </fo:inline-sequence>
  +<fo:inline font-style="italic" font-family="serif">Java JDK 1.1 Documentation</fo:inline>
  +<fo:inline font-family="serif">
  +      (<fo:basic-link color="blue" external-destination="http://java.sun.com/products/jdk/1.1/docs/index.html">http://java.sun.com/products/jdk/1.1/docs/index.html</fo:basic-link>)
  +   </fo:inline>
   </fo:block>
   </fo:list-item-body>
   </fo:list-item>
  @@ -1192,10 +1185,10 @@
        This software  consists of voluntary contributions made  by many individuals
        on  behalf of the Apache Software  Foundation and was  originally created by
        James Tauber &lt;jtauber@jtauber.com&gt;. For more  information on the Apache 
  -     Software Foundation, please see <fo:inline-sequence font-style="italic" font-family="serif">http://www.apache.org/</fo:inline-sequence>
  -<fo:inline-sequence font-family="serif">
  +     Software Foundation, please see <fo:inline font-style="italic" font-family="serif">http://www.apache.org/</fo:inline>
  +<fo:inline font-family="serif">
         (http://www.apache.org/)
  -   </fo:inline-sequence>.
  +   </fo:inline>.
     </fo:block>
   
   <fo:block font-size="14pt" font-family="sans-serif" line-height="10pt" space-after.optimum="15pt" font-weight="bold" start-indent="15pt" break-before="page">
  @@ -1212,7 +1205,7 @@
                        </fo:block>
   </fo:table-cell>
   <fo:table-cell>
  -<fo:block text-align="start"><fo:simple-link color="blue" internal-destination="sec1">What is FOP?</fo:simple-link></fo:block>
  +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec1">What is FOP?</fo:basic-link></fo:block>
   </fo:table-cell>
   <fo:table-cell>
   <fo:block text-align="end"><fo:page-number-citation ref-id="sec1"/></fo:block>
  @@ -1224,7 +1217,7 @@
                        </fo:block>
   </fo:table-cell>
   <fo:table-cell>
  -<fo:block text-align="start"><fo:simple-link color="blue" internal-destination="sec2">Downloading FOP</fo:simple-link></fo:block>
  +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec2">Downloading FOP</fo:basic-link></fo:block>
   </fo:table-cell>
   <fo:table-cell>
   <fo:block text-align="end"><fo:page-number-citation ref-id="sec2"/></fo:block>
  @@ -1236,7 +1229,7 @@
                        </fo:block>
   </fo:table-cell>
   <fo:table-cell>
  -<fo:block text-align="start"><fo:simple-link color="blue" internal-destination="sec3">Running FOP</fo:simple-link></fo:block>
  +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec3">Running FOP</fo:basic-link></fo:block>
   </fo:table-cell>
   <fo:table-cell>
   <fo:block text-align="end"><fo:page-number-citation ref-id="sec3"/></fo:block>
  @@ -1248,7 +1241,7 @@
                        </fo:block>
   </fo:table-cell>
   <fo:table-cell>
  -<fo:block text-align="start"><fo:simple-link color="blue" internal-destination="sec4">Embedding FOP</fo:simple-link> </fo:block>
  +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec4">Embedding FOP</fo:basic-link> </fo:block>
   </fo:table-cell>
   <fo:table-cell>
   <fo:block text-align="end"><fo:page-number-citation ref-id="sec4"/></fo:block>
  @@ -1260,7 +1253,7 @@
                        </fo:block>
   </fo:table-cell>
   <fo:table-cell>
  -<fo:block text-align="start"><fo:simple-link color="blue" internal-destination="sec5">What's Implemented?</fo:simple-link></fo:block>
  +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec5">What's Implemented?</fo:basic-link></fo:block>
   </fo:table-cell>
   <fo:table-cell>
   <fo:block text-align="end"><fo:page-number-citation ref-id="sec5"/></fo:block>
  @@ -1272,7 +1265,7 @@
                        </fo:block>
   </fo:table-cell>
   <fo:table-cell>
  -<fo:block text-align="start"><fo:simple-link color="blue" internal-destination="sec6">Limitations</fo:simple-link></fo:block>
  +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec6">Limitations</fo:basic-link></fo:block>
   </fo:table-cell>
   <fo:table-cell>
   <fo:block text-align="end"><fo:page-number-citation ref-id="sec6"/></fo:block>
  @@ -1284,7 +1277,7 @@
                        </fo:block>
   </fo:table-cell>
   <fo:table-cell>
  -<fo:block text-align="start"><fo:simple-link color="blue" internal-destination="sec7">Bugs</fo:simple-link></fo:block>
  +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec7">Bugs</fo:basic-link></fo:block>
   </fo:table-cell>
   <fo:table-cell>
   <fo:block text-align="end"><fo:page-number-citation ref-id="sec7"/></fo:block>
  @@ -1296,7 +1289,7 @@
                        </fo:block>
   </fo:table-cell>
   <fo:table-cell>
  -<fo:block text-align="start"><fo:simple-link color="blue" internal-destination="sec8">Compiling FOP</fo:simple-link></fo:block>
  +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec8">Compiling FOP</fo:basic-link></fo:block>
   </fo:table-cell>
   <fo:table-cell>
   <fo:block text-align="end"><fo:page-number-citation ref-id="sec8"/></fo:block>
  @@ -1308,7 +1301,7 @@
                        </fo:block>
   </fo:table-cell>
   <fo:table-cell>
  -<fo:block text-align="start"><fo:simple-link color="blue" internal-destination="sec9">Getting involved</fo:simple-link></fo:block>
  +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec9">Getting involved</fo:basic-link></fo:block>
   </fo:table-cell>
   <fo:table-cell>
   <fo:block text-align="end"><fo:page-number-citation ref-id="sec9"/></fo:block>
  @@ -1320,7 +1313,7 @@
                        </fo:block>
   </fo:table-cell>
   <fo:table-cell>
  -<fo:block text-align="start"><fo:simple-link color="blue" internal-destination="sec10">FOP Relevant Specifications</fo:simple-link></fo:block>
  +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec10">FOP Relevant Specifications</fo:basic-link></fo:block>
   </fo:table-cell>
   <fo:table-cell>
   <fo:block text-align="end"><fo:page-number-citation ref-id="sec10"/></fo:block>
  @@ -1332,7 +1325,7 @@
                        </fo:block>
   </fo:table-cell>
   <fo:table-cell>
  -<fo:block text-align="start"><fo:simple-link color="blue" internal-destination="sec11">Licence</fo:simple-link></fo:block>
  +<fo:block text-align="start"><fo:basic-link color="blue" internal-destination="sec11">Licence</fo:basic-link></fo:block>
   </fo:table-cell>
   <fo:table-cell>
   <fo:block text-align="end"><fo:page-number-citation ref-id="sec11"/></fo:block>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.2   +12 -12    xml-cocoon2/webapp/i18n/simple.xml
  
  Index: simple.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/i18n/simple.xml,v
  retrieving revision 1.3.2.1
  retrieving revision 1.3.2.2
  diff -u -r1.3.2.1 -r1.3.2.2
  --- simple.xml	2001/06/15 15:00:11	1.3.2.1
  +++ simple.xml	2001/09/05 22:18:17	1.3.2.2
  @@ -1,13 +1,13 @@
   <?xml version="1.0" encoding="UTF-8"?>
   <root xmlns:i18n="http://apache.org/cocoon/i18n/2.0">
   	<title>
  -		<i18n:text>Hello, internationalization!</i18n:text> 
  +		<i18n:text>titletext</i18n:text> 
   	</title>
   	<sub-title>
   		<i18n:date pattern="EEE, MMMM dd, yyyy zzz" />
   	</sub-title>	
   	<annotation>
  -		<i18n:text>Documentation link:</i18n:text> 
  +		<i18n:text>doclink</i18n:text> 
   		<link>
   			<href>http://xml.apache.org/cocoon2/i18n.html</href>
   			<title>Cocoon 2 Web Site</title>
  @@ -19,7 +19,7 @@
   		</item>
   		<item>
   			<link>
  -				<href>?lang=<i18n:text>lang_id1</i18n:text></href>
  +				<href>simple.xml?locale=<i18n:text>lang_id1</i18n:text></href>
   				<title>
   					<i18n:text>language1</i18n:text>
   				</title>
  @@ -27,7 +27,7 @@
   		</item>
   		<item>
   			<link>
  -				<href>?lang=<i18n:text>lang_id2</i18n:text></href>
  +				<href>simple.xml?locale=<i18n:text>lang_id2</i18n:text></href>
   				<title>
   					<i18n:text>language2</i18n:text>
   				</title>
  @@ -35,7 +35,7 @@
   		</item>
   		<item>
   			<link>
  -				<href>?lang=<i18n:text>lang_id3</i18n:text></href>
  +				<href>simple.xml?locale=<i18n:text>lang_id3</i18n:text></href>
   				<title>
   					<i18n:text>language3</i18n:text>
   				</title>
  @@ -43,7 +43,7 @@
   		</item>		
   		<item>
   			<link>
  -				<href>?lang=<i18n:text>lang_id4</i18n:text></href>
  +				<href>simple.xml?locale=<i18n:text>lang_id4</i18n:text></href>
   				<title>
   					<i18n:text>language4</i18n:text>
   				</title>
  @@ -51,7 +51,7 @@
   		</item>				
   		<item>
   			<link>
  -				<href>?lang=<i18n:text>lang_id5</i18n:text></href>
  +				<href>simple.xml?locale=<i18n:text>lang_id5</i18n:text></href>
   				<title>
   					<i18n:text>language5</i18n:text>
   				</title>
  @@ -61,25 +61,25 @@
   	<menu>
   		<item>
   			<link>
  -				<href>?lang=en_US</href>
  +				<href>simple.xml?locale=en_US</href>
   				<title>English (US)</title>
   			</link>
   		</item>
   		<item>
   			<link>
  -				<href>?lang=en_GB</href>
  +				<href>simple.xml?locale=en_GB</href>
   				<title>English (GB)</title>
   			</link>
   		</item>		
   		<item>
   			<link>
  -				<href>?lang=ru_RU</href>
  +				<href>simple.xml?locale=ru_RU</href>
   				<title>Russian (Russia)</title>
   			</link>
   		</item>		
   		<item>
   			<link>
  -				<href>?lang=de_AT_EURO</href>
  +				<href>simple.xml?locale=de_AT_EURO</href>
   				<title>German (Austria, Euro)</title>
   			</link>
   		</item>
  @@ -93,7 +93,7 @@
   		</para>
   		<para title="third" name="article" i18n:attr="title name">
   			<i18n:translate>
  -				<i18n:text>Hello, {0}! Glad to see you!</i18n:text>
  +				<i18n:text>Hello</i18n:text>
   				<i18n:param name="username">
   					<i18n:text>Kot</i18n:text>
   				</i18n:param>
  
  
  
  1.4.2.3   +13 -17    xml-cocoon2/webapp/i18n/simple.xsp
  
  Index: simple.xsp
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/i18n/simple.xsp,v
  retrieving revision 1.4.2.2
  retrieving revision 1.4.2.3
  diff -u -r1.4.2.2 -r1.4.2.3
  --- simple.xsp	2001/06/15 18:00:47	1.4.2.2
  +++ simple.xsp	2001/09/05 22:18:17	1.4.2.3
  @@ -14,19 +14,15 @@
   			count++;
   		}
   	
  -		Locale loc = null;
  -		String lang = <xsp-request:get-attribute name="lang"/>;
  -		if (lang != null) {
  -			loc = org.apache.cocoon.transformation.I18nTransformer.parseLocale(lang);
  -		}
  -			
  +		Locale loc = request.getLocale();
  +
   		SimpleDateFormat df = new SimpleDateFormat("EEEE, MMMM dd, yyyy H:mm:ss", loc);
   	</xsp:logic>
   		<title>
  -			<i18n:text>Hello, internationalization!</i18n:text>
  +			<i18n:text>titletext</i18n:text>
   		</title>
   		<annotation>
  -			<i18n:text>Documentation link:</i18n:text>
  +			<i18n:text>doclink</i18n:text>
   			<link>
   				<href>http://xml.apache.org/cocoon2/i18n.html</href>
   				<title>Cocoon 2 Web Site</title>
  @@ -51,7 +47,7 @@
   			</item>
   			<item>
   				<link>
  -					<href>?lang=<i18n:text>lang_id1</i18n:text></href>
  +					<href>simple.xsp?locale=<i18n:text>lang_id1</i18n:text></href>
   					<title>
   						<i18n:text>language1</i18n:text>
   					</title>
  @@ -59,7 +55,7 @@
   			</item>
   			<item>
   				<link>
  -					<href>?lang=<i18n:text>lang_id2</i18n:text></href>
  +					<href>simple.xsp?locale=<i18n:text>lang_id2</i18n:text></href>
   					<title>
   						<i18n:text>language2</i18n:text>
   					</title>
  @@ -67,7 +63,7 @@
   			</item>
   			<item>
   				<link>
  -					<href>?lang=<i18n:text>lang_id3</i18n:text></href>
  +					<href>simple.xsp?locale=<i18n:text>lang_id3</i18n:text></href>
   					<title>
   						<i18n:text>language3</i18n:text>
   					</title>
  @@ -75,7 +71,7 @@
   			</item>
   			<item>
   				<link>
  -					<href>?lang=<i18n:text>lang_id4</i18n:text></href>
  +					<href>simple.xsp?locale=<i18n:text>lang_id4</i18n:text></href>
   					<title>
   						<i18n:text>language4</i18n:text>
   					</title>
  @@ -83,7 +79,7 @@
   			</item>
   			<item>
   				<link>
  -					<href>?lang=<i18n:text>lang_id5</i18n:text></href>
  +					<href>simple.xsp?locale=<i18n:text>lang_id5</i18n:text></href>
   					<title>
   						<i18n:text>language5</i18n:text>
   					</title>
  @@ -93,25 +89,25 @@
   		<menu>
   			<item>
   				<link>
  -					<href>?lang=en_US</href>
  +					<href>simple.xsp?locale=en_US</href>
   					<title>English (US)</title>
   				</link>
   			</item>
   			<item>
   				<link>
  -					<href>?lang=en_GB</href>
  +					<href>simple.xsp?locale=en_GB</href>
   					<title>English (GB)</title>
   				</link>
   			</item>		
   			<item>
   				<link>
  -					<href>?lang=ru_RU</href>
  +					<href>simple.xsp?locale=ru_RU</href>
   					<title>Russian (Russia)</title>
   				</link>
   			</item>					
   			<item>
   				<link>
  -					<href>?lang=de_AT_EURO</href>
  +					<href>simple.xsp?locale=de_AT_EURO</href>
   					<title>German (Austria, Euro)</title>
   				</link>
   			</item>			
  
  
  
  1.5.2.2   +7 -32     xml-cocoon2/webapp/i18n/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/i18n/sitemap.xmap,v
  retrieving revision 1.5.2.1
  retrieving revision 1.5.2.2
  diff -u -r1.5.2.1 -r1.5.2.2
  --- sitemap.xmap	2001/06/15 18:00:48	1.5.2.1
  +++ sitemap.xmap	2001/09/05 22:18:17	1.5.2.2
  @@ -3,52 +3,27 @@
   	<!-- =========================== Components ================================ -->
   	<map:components>
   		<map:generators default="file"/>
  -		<map:transformers default="xslt">
  -			<map:transformer name="i18n" src="org.apache.cocoon.transformation.I18nTransformer">
  -				<map:parameter name="available_lang_1" value="en"/>
  -				<map:parameter name="available_lang_2" value="ru"/>
  -				<map:parameter name="available_lang_3" value="de"/>
  -				<map:parameter name="available_lang_4" value="pl"/>
  -				<map:parameter name="available_lang_5" value="sp"/>
  -				<map:parameter name="available_lang_6" value="hy"/>
  -			</map:transformer>
  -		</map:transformers>
  +		<map:transformers default="xslt"/>
   		<map:readers default="resource"/>
   		<map:serializers default="html"/>
   		<map:selectors default="browser"/>
   		<map:matchers default="wildcard">
   			<map:matcher name="wildcard" src="org.apache.cocoon.matching.WildcardURIMatcherFactory"/>
   		</map:matchers>
  -		<map:actions>
  -			<map:action name="lang-select" src="org.apache.cocoon.acting.LangSelect">
  -				<store-in-session>true</store-in-session>
  -				<create-session>true</create-session>
  -				<store-in-cookie>true</store-in-cookie>
  -				<store-in-request>true</store-in-request>
  -			</map:action>
  -		</map:actions>
   
   	</map:components>
   	<!-- =========================== Pipelines ================================= -->
   	<map:pipelines>
   		<map:pipeline>
  -			<map:match pattern="**.xml">
  -				<map:act type="lang-select">
  -				<map:generate src="{../1}.xml"/>
  -				<map:transform type="i18n">
  -					<map:parameter name="src" value="translations/{../1}_dict.xml"/>
  -				</map:transform>
  -				</map:act>
  +			<map:match pattern="*.xml">
  +				<map:generate src="{1}.xml"/>
  +				<map:transform type="i18n"/>
   				<map:transform src="simple.xsl"/>
   				<map:serialize/>
   			</map:match>
  -			<map:match pattern="**.xsp">
  -				<map:act type="lang-select">
  -				<map:generate type="serverpages" src="{../1}.xsp"/>
  -				<map:transform type="i18n">
  -					<map:parameter name="src" value="translations/{../1}_dict.xml"/>
  -				</map:transform>
  -				</map:act>
  +			<map:match pattern="*.xsp">
  +				<map:generate type="serverpages" src="{1}.xsp"/>
  +				<map:transform type="i18n"/>
   				<map:transform src="simple.xsl"/>
   				<map:serialize/>
   			</map:match>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/i18n/translations/convert.xsl
  
  Index: convert.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/i18n/translations/convert.xsl,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +1 -1      xml-cocoon2/webapp/i18n/translations/messages.xml
  
  Index: messages.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/i18n/translations/messages.xml,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- messages.xml	2001/07/19 11:22:22	1.1
  +++ messages.xml	2001/09/05 22:18:17	1.1.2.1
  @@ -1,6 +1,6 @@
   <?xml version="1.0" encoding="UTF-8"?>
   
  -<!-- CVS $Id: messages.xml,v 1.1 2001/07/19 11:22:22 dims Exp $ -->
  +<!-- CVS $Id: messages.xml,v 1.1.2.1 2001/09/05 22:18:17 dims Exp $ -->
   
   <!-- Default English message catalogue file for cocoon2 sample webapp -->
   
  
  
  
  1.1.2.1   +1 -1      xml-cocoon2/webapp/i18n/translations/messages_de.xml
  
  Index: messages_de.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/i18n/translations/messages_de.xml,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- messages_de.xml	2001/07/19 11:22:22	1.1
  +++ messages_de.xml	2001/09/05 22:18:17	1.1.2.1
  @@ -1,6 +1,6 @@
   <?xml version="1.0" encoding="UTF-8"?>
   
  -<!-- CVS $Id: messages_de.xml,v 1.1 2001/07/19 11:22:22 dims Exp $ -->
  +<!-- CVS $Id: messages_de.xml,v 1.1.2.1 2001/09/05 22:18:17 dims Exp $ -->
   
   <!-- German message catalogue file for cocoon2 sample webapp -->
   
  
  
  
  1.1.2.1   +1 -1      xml-cocoon2/webapp/i18n/translations/messages_en.xml
  
  Index: messages_en.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/i18n/translations/messages_en.xml,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- messages_en.xml	2001/07/19 11:22:22	1.1
  +++ messages_en.xml	2001/09/05 22:18:17	1.1.2.1
  @@ -1,6 +1,6 @@
   <?xml version="1.0" encoding="UTF-8"?>
   
  -<!-- CVS $Id: messages_en.xml,v 1.1 2001/07/19 11:22:22 dims Exp $ -->
  +<!-- CVS $Id: messages_en.xml,v 1.1.2.1 2001/09/05 22:18:17 dims Exp $ -->
   
   <!-- English message catalogue file for cocoon2 sample webapp -->
   
  
  
  
  1.1.2.1   +1 -1      xml-cocoon2/webapp/i18n/translations/messages_es.xml
  
  Index: messages_es.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/i18n/translations/messages_es.xml,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- messages_es.xml	2001/07/19 11:22:22	1.1
  +++ messages_es.xml	2001/09/05 22:18:17	1.1.2.1
  @@ -1,6 +1,6 @@
   <?xml version="1.0" encoding="UTF-8"?>
   
  -<!-- CVS $Id: messages_es.xml,v 1.1 2001/07/19 11:22:22 dims Exp $ -->
  +<!-- CVS $Id: messages_es.xml,v 1.1.2.1 2001/09/05 22:18:17 dims Exp $ -->
   
   <!-- Spanish message catalogue file for cocoon2 sample webapp -->
   
  
  
  
  1.1.2.1   +1 -1      xml-cocoon2/webapp/i18n/translations/messages_hy.xml
  
  Index: messages_hy.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/i18n/translations/messages_hy.xml,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- messages_hy.xml	2001/07/19 11:22:22	1.1
  +++ messages_hy.xml	2001/09/05 22:18:17	1.1.2.1
  @@ -1,6 +1,6 @@
   <?xml version="1.0" encoding="UTF-8"?>
   
  -<!-- CVS $Id: messages_hy.xml,v 1.1 2001/07/19 11:22:22 dims Exp $ -->
  +<!-- CVS $Id: messages_hy.xml,v 1.1.2.1 2001/09/05 22:18:17 dims Exp $ -->
   
   <!-- Armenian message catalogue file for cocoon2 sample webapp -->
   
  
  
  
  1.1.2.1   +1 -1      xml-cocoon2/webapp/i18n/translations/messages_pl.xml
  
  Index: messages_pl.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/i18n/translations/messages_pl.xml,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- messages_pl.xml	2001/07/19 11:22:22	1.1
  +++ messages_pl.xml	2001/09/05 22:18:17	1.1.2.1
  @@ -1,6 +1,6 @@
   <?xml version="1.0" encoding="UTF-8"?>
   
  -<!-- CVS $Id: messages_pl.xml,v 1.1 2001/07/19 11:22:22 dims Exp $ -->
  +<!-- CVS $Id: messages_pl.xml,v 1.1.2.1 2001/09/05 22:18:17 dims Exp $ -->
   
   <!-- Polish message catalogue file for cocoon2 sample webapp -->
   
  
  
  
  1.1.2.1   +1 -1      xml-cocoon2/webapp/i18n/translations/messages_ru.xml
  
  Index: messages_ru.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/i18n/translations/messages_ru.xml,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- messages_ru.xml	2001/07/19 11:22:22	1.1
  +++ messages_ru.xml	2001/09/05 22:18:17	1.1.2.1
  @@ -1,6 +1,6 @@
   <?xml version="1.0" encoding="UTF-8"?>
   
  -<!-- CVS $Id: messages_ru.xml,v 1.1 2001/07/19 11:22:22 dims Exp $ -->
  +<!-- CVS $Id: messages_ru.xml,v 1.1.2.1 2001/09/05 22:18:17 dims Exp $ -->
   
   <!-- Russian message catalogue file for cocoon2 sample webapp -->
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.1   +0 -0      xml-cocoon2/webapp/resources/entities/CatalogManager.properties
  
  Index: CatalogManager.properties
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/resources/entities/CatalogManager.properties,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/resources/entities/ISOdia.pen
  
  Index: ISOdia.pen
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/resources/entities/ISOdia.pen,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/resources/entities/ISOgrk1.pen
  
  Index: ISOgrk1.pen
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/resources/entities/ISOgrk1.pen,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/resources/entities/ISOlat1.pen
  
  Index: ISOlat1.pen
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/resources/entities/ISOlat1.pen,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/resources/entities/ISOnum.pen
  
  Index: ISOnum.pen
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/resources/entities/ISOnum.pen,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/resources/entities/ISOpub.pen
  
  Index: ISOpub.pen
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/resources/entities/ISOpub.pen,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/resources/entities/ISOtech.pen
  
  Index: ISOtech.pen
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/resources/entities/ISOtech.pen,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/resources/entities/README
  
  Index: README
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/resources/entities/README,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/resources/entities/catalog
  
  Index: catalog
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/resources/entities/catalog,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/resources/entities/catalog-demo/catalog-demo-v10.dtd
  
  Index: catalog-demo-v10.dtd
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/resources/entities/catalog-demo/catalog-demo-v10.dtd,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/resources/entities/catalog-demo/override.xml
  
  Index: override.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/resources/entities/catalog-demo/override.xml,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/resources/entities/catalog-demo/testpub.xml
  
  Index: testpub.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/resources/entities/catalog-demo/testpub.xml,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/resources/entities/catalog-demo/testsys.xml
  
  Index: testsys.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/resources/entities/catalog-demo/testsys.xml,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/stylesheets/simple-page2html.xsl
  
  Index: simple-page2html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/stylesheets/simple-page2html.xsl,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  1.1.2.1   +0 -0      xml-cocoon2/webapp/stylesheets/simple-xml2html.xsl
  
  Index: simple-xml2html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/stylesheets/simple-xml2html.xsl,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +78 -38    xml-cocoon2/xdocs/directory-generator.xml
  
  Index: directory-generator.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/xdocs/directory-generator.xml,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- directory-generator.xml	2001/07/19 13:46:58	1.1.2.5
  +++ directory-generator.xml	2001/09/05 22:18:18	1.1.2.6
  @@ -14,45 +14,85 @@
   	<body>
   		<s1 title="Directory Generator">
   			<p>Generates an XML directory listing.</p>
  - <p>
  - The root node of the generated document will normally be a
  - <code>directory</code> node, and a directory node can contain zero
  - or more <code>file</code> or <code>directory</code> nodes. A file node has no
  - children. Each node will contain the following attributes:</p>
  -   <ul>
  -	<li>name : the name of the file or directory</li>
  -      <li>lastModified : the time the file was last modified, measured as the number of
  -   milliseconds since the epoch (as in java.io.File.lastModified)</li>
  -      <li>date (optional) : the time the file was last modified in human-readable form</li>
  -   </ul>
  -	<p>All generated elements have the namespace
  -         <code>http://apache.org/cocoon/directory/2.0</code>. The root <code>directory</code>
  -         node has the attribute <code>requested</code> with the value <code>true</code>.</p>
  -			<ul>
  -				<li>Name : directory</li>
  -				<li>Class: org.apache.cocoon.generation.DirectoryGenerator</li>
  -				<li>Cacheable: no.</li>
  -			</ul>
  -<source>
  -     <![CDATA[
  +      <p>
  +        The root node of the generated document will normally be a
  +        <code>directory</code> node, and a directory node can contain zero
  +        or more <code>file</code> or <code>directory</code> nodes. A file node has no
  +        children. Each node will contain the following attributes:
  +      </p>
  +      <ul>
  +        <li>name : the name of the file or directory</li>
  +        <li>lastModified : the time the file was last modified, measured as the number of
  +        milliseconds since the epoch (as in java.io.File.lastModified)</li>
  +        <li>date (optional) : the time the file was last modified in human-readable form</li>
  +      </ul>
  +      <p>All generated elements have the namespace
  +        <code>http://apache.org/cocoon/directory/2.0</code>.
  +        The root <code>directory</code>
  +        node has the attribute <code>requested</code> with the value <code>true</code>.
  +      </p>
  +      <ul>
  +        <li>Name : directory</li>
  +        <li>Class: org.apache.cocoon.generation.DirectoryGenerator</li>
  +        <li>Cacheable: no.</li>
  +      </ul>
  +<source><![CDATA[
     <map:generate type="directory" src="the_directory"/>
  -     ]]>
  -</source>
  +]]></source>
   		</s1>
  -<s1 title="Configuration">
  -<p>The following parameter can be specified in the pipeline for 
  -   the generate command:</p>
  -<ul>
  -<li>depth (optional) : Sets how deep Directory Generator should delve into the
  - directory structure. If set to 1 (the default), only the starting
  - directory's immediate contents will be returned.</li>
  -<li>dateFormat (optional) :  Sets the format for the date attribute of each node, as
  - described in java.text.SimpleDateFormat. If unset, the default
  - format for the current locale will be used.</li>
  -<li>root (optional) : The root pattern</li>
  -<li>include (optional) : The include pattern</li>
  -<li>exclude (optional) : The exclude pattern</li>
  -</ul>
  -</s1>
  +    <s1 title="Configuration">
  +      <p>The following parameter can be specified in the pipeline for 
  +         the generate command:
  +      </p>
  +      <ul>
  +        <li>depth (optional) : Sets how deep Directory Generator should delve into the
  +         directory structure. If set to 1 (the default), only the starting
  +         directory's immediate contents will be returned.</li>
  +        <li>dateFormat (optional) :  Sets the format for the date attribute of each node, as
  +         described in java.text.SimpleDateFormat. If unset, the default
  +         format for the current locale will be used.</li>
  +        <li>root (optional) : The root pattern</li>
  +        <li>include (optional) : The include pattern</li>
  +        <li>exclude (optional) : The exclude pattern</li>
  +      </ul>
  +    </s1>
  +    <s1 title="DTD">
  +      <p>XML generated by directory generator uses namespace
  +        <code>http://apache.org/cocoon/status/2.0</code>. The DTD
  +        of XML generated by directory generator:
  +      </p>
  +<source><![CDATA[
  +  <!ELEMENT directory (directory|file)*>
  +  <!ATTLIST directroy
  +    name         CDATA #REQUIRED
  +    lastModified CDATA #REQUIRED
  +    date         CDATA #IMPLIED
  +    requested    CDATA #IMPLIED>
  +  
  +  <!ELEMENt file #EMPTY>
  +  <!ATTLIST file
  +    name         CDATA #REQUIRED
  +    lastModified CDATA #REQUIRED
  +    date         CDATA #IMPLIED>
  +]]></source>
  +    </s1>
  +    <s1 title="Example">
  +      <p>
  +        The current directory generator may generate following xml:
  +      </p>
  +<source><![CDATA[
  +<directory xmlns="http://apache.org/cocoon/directory/2.0" 
  +  name="stylesheets" lastModified="999425490000" 
  +  date="02.09.01 12:11" 
  +  requested="true">
  +  <directory name="sites" 
  +    lastModified="999425490000" date="02.09.01 12:11"/>
  +  <file name="dynamic-page2html.xsl" 
  +    lastModified="999425490000" date="02.09.01 12:11"/>
  +  <file name="simple-xml2html.xsl" 
  +    lastModified="999425490000" date="02.09.01 12:11"/>
  +</directory>
  +]]></source>
  +    </s1>
   </body>
   </document>
  
  
  
  1.3.2.20  +1 -0      xml-cocoon2/xdocs/docs-book.xml
  
  Index: docs-book.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/xdocs/docs-book.xml,v
  retrieving revision 1.3.2.19
  retrieving revision 1.3.2.20
  diff -u -r1.3.2.19 -r1.3.2.20
  --- docs-book.xml	2001/08/13 10:38:22	1.3.2.19
  +++ docs-book.xml	2001/09/05 22:18:18	1.3.2.20
  @@ -66,6 +66,7 @@
     <page id="caching" label="Caching" source="caching.xml"/>
     <page id="mrustore" label="MRU Store" source="mrustore.xml"/>
     <page id="sessions" label="Sessions" source="sessions.xml"/>
  +  <page id="catalog" label="Entity Catalogs" source="catalog.xml"/>
     <page id="datasources" label="Using Databases" source="datasources.xml"/>
     <page id="extending" label="Extending C2" source="extending.xml"/>
     <page id="avalon" label="Avalon" source="avalon.xml"/>
  
  
  
  1.1.2.6   +14 -2     xml-cocoon2/xdocs/i18n-transformer.xml
  
  Index: i18n-transformer.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/xdocs/i18n-transformer.xml,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- i18n-transformer.xml	2001/07/28 03:38:32	1.1.2.5
  +++ i18n-transformer.xml	2001/09/05 22:18:18	1.1.2.6
  @@ -33,6 +33,9 @@
   				<p>
   				First implementation was developed by <link href="mailto:lassi.immonen@valkeus.com">Lassi Immonen</link>. In this implementation syntax was changed according to the <link href="http://www.infozone-group.org">Infozone Group's</link> i18n proposal (with a little difference) and some new features were implemented.
   				</p>
  +				<p>
  +				Enhancements for number, date and time have been contributed by <link href="mailto:Michael.Enke@wincor-nixdorf.com">Michael Enke</link>.
  +				</p>
   			<ul>
   				<li>Name : i18n</li>
   				<li>Class: org.apache.cocoon.transformation.I18nTransformer</li>
  @@ -168,10 +171,19 @@
   				</p>
   			</s2>
   			<s2 title="Date, time and number formatting">
  -				<p>To format dates and time according to the current locale use <code><![CDATA[<i18n:date src-pattern="dd/MM/yyyy" pattern="dd:MMM:yyyy" value="01/01/2001" />]]></code>. The <code>'src-pattern'</code> attribute will be used to parse the <code>'value'</code>, then the date will be formatted according to the current locale using the format specified by <code>'pattern'</code> attribute.
  +				<p>To format dates according to the current locale use <code><![CDATA[<i18n:date src-pattern="dd/MM/yyyy" pattern="dd:MMM:yyyy" value="01/01/2001" />]]></code>. The <code>'src-pattern'</code> attribute will be used to parse the <code>'value'</code>, then the date will be formatted according to the current locale using the format specified by <code>'pattern'</code> attribute.
  +				</p>
  +				<p>To format time for a locale (e.g. de_DE) use <code><![CDATA[<i18n:time src-pattern="dd/MM/yyyy" locale="de_DE" value="01/01/2001" />]]></code>. The <code>'src-pattern'</code> and <code>'pattern'</code> attribute may also contain <code>'short'</code>, <code>'medium'</code>, <code>'long'</code> or <code>'full'</code>. The date will be formatted according to this format.
  +				</p>
  +				<p>To format date and time use <code><![CDATA[<i18n:date-time />]]></code>.
  +				</p>
  +				<p>It is also possible to specify a src-locale:  <code><![CDATA[<i18n:date src-pattern="short" src-locale="en_US" locale="de_DE"> 12/24/01 </i18n:date> ]]></code> will result in 24.12.2001
  +				</p>
  +				<p>
  +				A given real <code>pattern</code> and <code>src-pattern</code> (not short, medium, long, full) overwrites the <code>locale</code> and <code>src-locale</code>.
   				</p>
   				<p>
  -					If no pattern was specified then the date will be formatted with the <code>DateFormat.DEFAULT</code> format (both date and time). If no value for the date is specified then the current date will be used. E.g.: <code><![CDATA[<i18n:date ]]></code> will result in the current date and time, formatted with default localized pattern.
  +					If no pattern was specified then the date will be formatted with the <code>DateFormat.DEFAULT</code> format (both date and time). If no value for the date is specified then the current date will be used. E.g.: <code><![CDATA[<i18n:date/> ]]></code> will result in the current date, formatted with default localized pattern.
   				</p>
   				<p>To format numbers in locale sensitive manner use <code><![CDATA[<i18n:number pattern="0.##" value="2.0" />]]></code>. This will be useful for Arabic, Indian, etc. number formatting. Additionally, currencies and percent formatting can be used. E.g.: 
    				</p>
  
  
  
  1.1.2.3   +112 -2    xml-cocoon2/xdocs/jsp-generator.xml
  
  Index: jsp-generator.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/xdocs/jsp-generator.xml,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- jsp-generator.xml	2001/07/19 13:46:58	1.1.2.2
  +++ jsp-generator.xml	2001/09/05 22:18:18	1.1.2.3
  @@ -12,11 +12,22 @@
   	</header>
   	<body>
   		<s1 title="JSP Generator">
  -			<p>????.</p>
  +			<p>The JspGenerator selects a JSPEngine component. The JSPEngine component
  +                          launches a JSP servlet engine of your servlet container, 
  +                          feeds the HttpRequest into the 
  +                          JSP servlet engine, and pipes the jsp response as SAX events into Cocoon2.
  +                          The JSP page is specified by the HttpRequest.
  +                        </p>
  +                        <p>
  +                          This way you can continue to use your JSP pages. 
  +                          Your migration from JSP to XSP may be done step by step. 
  +                          You may specify your JSP pages either as JSP scriptlets or as JSP-XML.
  +                          But keep in mind that your JSP output should be valid XML.
  +                        </p>
   			<ul>
   				<li>Name : jsp</li>
   				<li>Class: org.apache.cocoon.generation.JspGenerator</li>
  -				<li>Cacheable: ????.</li>
  +				<li>Cacheable: ?.</li>
   			</ul>
   <source>
        <![CDATA[
  @@ -24,5 +35,104 @@
        ]]>
   </source>
   		</s1>
  +                <s1 title="JSPEngine">
  +                  <p>As JSP servlet engines are implemented differently, you may have to
  +                    select the appropriate JSPEngine component. 
  +                    The default is a JSPEngine working with Tomcat's JSP servlet engine Jasper.
  +                    You may override the cocoon.roles by your own my.roles, as described 
  +                    in the <link href="faqs.html">FAQs</link>.
  +                  </p>
  +                  <p>The JSPEngine component of Tomcat's JSPEngine is implemented in JSPEngineImpl. 
  +                    If you want to use another JSPEngine component, you may specify it in a my.roles file.
  +                    The following sample specify in file WEB-INF/my.roles a JSPEngine workging with WebLogicServer:
  +                  </p>
  +<source>
  +  <![CDATA[
  +<?xml version="1.0"?>
  +<role-list>
  +  <role name="org.apache.cocoon.components.jsp.JSPEngine"
  +    shorthand="jsp-engine"
  +    default-class="org.apache.cocoon.components.jsp.JSPEngineImplWLS"/>
  +</role-list>
  +  ]]>
  +</source>
  +                  <p>Defining the file my.roles this way you must ensure that your 
  +                    cocoon.xconf refernces my.roles, like that:
  +                  </p>
  +<source>
  +  <![CDATA[
  +   ...
  +   <cocoon version="2.0" user-roles="WEB-INF/my.roles">
  +   ...
  +  ]]>
  +</source>
  +
  +                  <p>Currently there are tree JSPEngine components available:
  +                  </p>
  +                  <table>
  +                    <tr><th>JSPEngine</th><th>ServletEngine</th></tr>
  +                    <tr><td>JSPEngineImpl</td><td>Tomcat, generic jsp servlet class</td></tr>
  +                    <tr><td>JSPEngineImplWLS</td><td>WebLogic 5.1, 6.0(?)</td></tr>
  +                    <tr><td>JSPEngineImplNamedDispactcherInclude</td><td>Generic JSP Servlet</td></tr>
  +                  </table>
  +                  <p>The next sections describe the settings of the JSPEngine components.
  +                  </p>
  +                  <s2 title="JSPEngineImpl">
  +                    <p>This JSPEngine is the default engine selected in cocoon.roles. 
  +                      By default it uses Tomcats' JASPER  JSP servlet engine.
  +                    </p>
  +                    <p>Running under a different JSP servlet engine, you can try to change the settings
  +                      in cocoon.xconf, by modifying parameter name servlet-class to your needs.
  +                    </p>
  +<source><![CDATA[
  +  <jsp-engine>
  +    <parameter name="servlet-class" value="my.servlet.MyJspServletOfMyServletEngine"/>
  +  </jsp-engine>
  +  ]]>
  +</source>                    
  +                    <p>JSPEngineImpl instances directly the JSP servlet engine class, and services
  +                      HttpRequest to this instance.
  +                    </p>
  +                    <p>JSPEngineImplNamedDispatcherInclude delegates the selection of a JSP servlet engine
  +                      instance to the servlet engine. It selects by servlet-name, and not by servlet-class.
  +                      This is the key differences of these two implementations.
  +                    </p>
  +                  </s2>
  +                  <s2 title="JSPEngineImplWLS">
  +                    <p>This JSPEngine is implemented especially for WebLogic 5.1. WebLogic 6.0, and WebLogic 6.1
  +                      may work, too. JSPEngineImplWLS finds the named request dispatch for jsp, the jsp response
  +                      is piped into Cocoon2.
  +                    </p>
  +                    <p>The name of the JSP servlet is by default set to '*.jsp'. This is the default servlet name
  +                      of the JSP servlet engine under WLS. You may adopt the parameter servlet-name to your needs.
  +                    </p>
  +                    <p>If you want to specify a different JSP servlet name, you can change the settings
  +                      in cocoon.xconf, by modifying the parameter servlet-name.
  +                    </p>
  +<source><![CDATA[
  +  <jsp-engine>
  +    <parameter name="servlet-name" value="MyNameOfMyJspServletOfMyServletEngine"/>
  +  </jsp-engine>
  +  ]]>
  +</source>
  +                  </s2>
  +                  <s2 title="JSPEngineImplNamedDispatcherInclude">
  +                    <p>This JSPEngine is implemented like JSPEnginImplWLS without using any WebLogic classes.
  +                      You may try to use this JSPEngine if JSPEngineImpl does not meet your requirements.
  +                    </p>
  +                    <p>The name of the JSP servlet is by default set to '*.jsp'. This is the default servlet name
  +                      of the jsp servlet engine under WLS. You may adopt the parameter servlet-name to your needs.
  +                    </p>
  +                    <p>If you want to specify a different JSP servlet name, you can change the settings
  +                      in cocoon.xconf, by modifying the parameter servlet-name.
  +                    </p>
  +<source><![CDATA[
  +  <jsp-engine>
  +    <parameter name="servlet-name" value="MyNameOfMyJspServletOfMyServletEngine"/>
  +  </jsp-engine>
  +  ]]>
  +</source>
  +                  </s2>
  +                </s1>
   	</body>
   </document>
  
  
  
  1.3.2.22  +1 -0      xml-cocoon2/xdocs/site-book.xml
  
  Index: site-book.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/xdocs/site-book.xml,v
  retrieving revision 1.3.2.21
  retrieving revision 1.3.2.22
  diff -u -r1.3.2.21 -r1.3.2.22
  --- site-book.xml	2001/08/13 10:38:22	1.3.2.21
  +++ site-book.xml	2001/09/05 22:18:18	1.3.2.22
  @@ -69,6 +69,7 @@
     <page id="caching" label="Caching" source="caching.xml"/>
     <page id="mrustore" label="MRU Store" source="mrustore.xml"/>
     <page id="sessions" label="Sessions" source="sessions.xml"/>
  +  <page id="catalog" label="Entity Catalogs" source="catalog.xml"/>
     <page id="datasources" label="Using Databases" source="datasources.xml"/>
     <page id="extending" label="Extending C2" source="extending.xml"/>
     <page id="avalon" label="Avalon" source="avalon.xml"/>
  
  
  
  1.1.2.4   +25 -0     xml-cocoon2/xdocs/status-generator.xml
  
  Index: status-generator.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/xdocs/status-generator.xml,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- status-generator.xml	2001/07/19 14:20:01	1.1.2.3
  +++ status-generator.xml	2001/09/05 22:18:18	1.1.2.4
  @@ -35,6 +35,31 @@
        ]]>
   </source>
   		</s1>
  +                <s1 title="DTD">
  +                <p>XML generated by status generator uses namespace 
  +                  <code>http://apache.org/cocoon/status/2.0</code>. The DTD of XML
  +                  generated by status generator:
  +                </p>
  +<source><![CDATA[
  +<!ELEMENT statusinfo (group|value)*>
  +
  +<!ATTLIST statusinfo
  +   date CDATA #IMPLIED
  +   host CDATA #IMPLIED
  +>
  +
  +<!ELEMENT group (group|value)*>
  +<!ATTLIST group
  +   name CDATA #IMPLIED
  +>
  +
  +<!ELEMENT value (line)+>
  +<!ATTLIST value
  +   name CDATA #REQUIRED
  +
  +<!ELEMENT line (#PCDATA)+>
  +]]></source>
  +                </s1>
   		<s1 title="Example">
   		<p>The current status generator outputs information about the jvm:</p>
   <source>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.1   +0 -0      xml-cocoon2/xdocs/catalog.xml
  
  Index: catalog.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/xdocs/catalog.xml,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  
  
  

----------------------------------------------------------------------
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