cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: xml-cocoon2/webapp/stylesheets dynamic-page2html.xsl
Date Fri, 25 May 2001 14:26:00 GMT
dims        01/05/25 07:26:00

  Modified:    .        build.sh
               src/org/apache/cocoon Cocoon.java Constants.java
               src/org/apache/cocoon/components/language/generator
                        ProgramGenerator.java ProgramGeneratorImpl.java
               src/org/apache/cocoon/generation ServerPagesGenerator.java
               src/org/apache/cocoon/servlet CocoonServlet.java
               src/org/apache/cocoon/sitemap Handler.java
               src/org/apache/cocoon/transformation TraxTransformer.java
               src/org/apache/cocoon/util IOUtils.java
               webapp/docs/samples/xsp simple.xsp
               webapp/stylesheets dynamic-page2html.xsl
  Log:
  - fix build.sh
  - fix classloader in CocoonServlet for ClassCastException
  - fix XSP Engine to use Source instead of File
  - fix TraxTransformer to set the system id's instead of the URIResolver
    (URIResolver failed even for /cocoon/xsp/simple.xsp)
  
  Revision  Changes    Path
  1.2       +2 -2      xml-cocoon2/build.sh
  
  Index: build.sh
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/build.sh,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build.sh	2001/05/09 20:49:26	1.1
  +++ build.sh	2001/05/25 14:25:58	1.2
  @@ -2,7 +2,7 @@
   # -----------------------------------------------------------------------------
   # build.sh - Unix Build Script for Apache Cocoon
   #
  -# $Id: build.sh,v 1.1 2001/05/09 20:49:26 giacomo Exp $
  +# $Id: build.sh,v 1.2 2001/05/25 14:25:58 dims Exp $
   # -----------------------------------------------------------------------------
   
   # ----- Verify and Set Required Environment Variables -------------------------
  @@ -18,7 +18,7 @@
   
   # ----- Set Up The Runtime Classpath ------------------------------------------
   
  -CP=$JAVA_HOME/lib/tools.jar:$ANT_HOME/lib/ant_1_3.jar:$ANT_HOME/lib/ant_1_3-optional.jar:./lib/xerces_1_3_1.jar:./lib/xalan-2.0.1.jar
  +CP=$JAVA_HOME/lib/tools.jar:$ANT_HOME/lib/ant_1_3.jar:$ANT_HOME/lib/ant_1_3-optional.jar:./lib/xerces_1_3_1.jar:./lib/xalan-2.1.0.jar
    
   # ----- Make sure Ant script is executable ------------------------------------
   
  
  
  
  1.3       +3 -5      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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Cocoon.java	2001/05/22 14:30:31	1.2
  +++ Cocoon.java	2001/05/25 14:25:58	1.3
  @@ -53,7 +53,7 @@
    *
    * @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.2 $ $Date: 2001/05/22 14:30:31 $
  + * @version CVS $Revision: 1.3 $ $Date: 2001/05/25 14:25:58 $
    */
   public class Cocoon extends AbstractLoggable implements ThreadSafe, Component, Initializable,
Disposable, Modifiable, Processor, Contextualizable {
       /** The application context */
  @@ -311,12 +311,11 @@
               programGenerator = (ProgramGenerator) this.componentManager.lookup(Roles.PROGRAM_GENERATOR);
               urlFactory = (URLFactory) this.componentManager.lookup(Roles.URL_FACTORY);
               environment.setURLResolver(new org.apache.cocoon.environment.FactoryURLResolver(urlFactory));
  -            File sourceFile = environment.resolve(sitemapFileName).getFile();
               String markupLanguage = "sitemap";
               String programmingLanguage = "java";
   
               getLogger().debug("Sitemap regeneration begin:" + sitemapFileName);
  -            CompiledComponent smap = (CompiledComponent) programGenerator.load(sourceFile,
markupLanguage, programmingLanguage, environment);
  +            CompiledComponent smap = (CompiledComponent) programGenerator.load(sitemapFileName,
markupLanguage, programmingLanguage, environment);
               getLogger().debug("Sitemap regeneration complete");
   
               if (smap != null) {
  @@ -347,11 +346,10 @@
               programGenerator = (ProgramGenerator) this.componentManager.lookup(Roles.PROGRAM_GENERATOR);
               urlFactory = (URLFactory) this.componentManager.lookup(Roles.URL_FACTORY);
               environment.setURLResolver(new org.apache.cocoon.environment.FactoryURLResolver(urlFactory));
  -            File sourceFile = environment.resolve(fileName).getFile();
               String markupLanguage = "xsp";
               String programmingLanguage = "java";
   
  -            CompiledComponent xsp = (CompiledComponent) programGenerator.load(sourceFile,
markupLanguage, programmingLanguage, environment);
  +            CompiledComponent xsp = (CompiledComponent) programGenerator.load(fileName,
markupLanguage, programmingLanguage, environment);
               getLogger().debug("XSP generation complete:" + xsp);
   
               this.componentManager.release((Component) programGenerator);
  
  
  
  1.3       +3 -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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Constants.java	2001/05/23 12:32:16	1.2
  +++ Constants.java	2001/05/25 14:25:58	1.3
  @@ -10,7 +10,7 @@
   
   /**
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.2 $ $Date: 2001/05/23 12:32:16 $
  + * @version CVS $Revision: 1.3 $ $Date: 2001/05/25 14:25:58 $
    */
   
   public interface Constants {
  @@ -38,9 +38,9 @@
       String XSP_PREFIX          = "xsp";
       String XSP_URI             = "http://apache.org/xsp";
       String XSP_REQUEST_PREFIX  = "xsp-request";
  -    String XSP_REQUEST_URI     = XSP_URI + "/request";
  +    String XSP_REQUEST_URI     = XSP_URI + "/request/2.0";
       String XSP_RESPONSE_PREFIX = "xsp-response";
  -    String XSP_RESPONSE_URI    = XSP_URI + "/response";
  +    String XSP_RESPONSE_URI    = XSP_URI + "/response/2.0";
   
       String XML_NAMESPACE_URI = "http://www.w3.org/XML/1998/namespace";
   
  
  
  
  1.3       +2 -2      xml-cocoon2/src/org/apache/cocoon/components/language/generator/ProgramGenerator.java
  
  Index: ProgramGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/generator/ProgramGenerator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ProgramGenerator.java	2001/05/22 14:32:08	1.2
  +++ ProgramGenerator.java	2001/05/25 14:25:58	1.3
  @@ -16,7 +16,7 @@
    * documents writeen in a <code>MarkupLanguage</code>
    *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
  - * @version CVS $Revision: 1.2 $ $Date: 2001/05/22 14:32:08 $
  + * @version CVS $Revision: 1.3 $ $Date: 2001/05/25 14:25:58 $
    */
   public interface ProgramGenerator extends Component {
     /**
  @@ -32,7 +32,7 @@
      * @exception Exception If an error occurs during generation or loading
      */
     CompiledComponent load(
  -    File file, String markupLanguage, String programmingLanguage,
  +    String fileName, String markupLanguage, String programmingLanguage,
       SourceResolver resolver
     ) throws Exception;
   
  
  
  
  1.3       +15 -16    xml-cocoon2/src/org/apache/cocoon/components/language/generator/ProgramGeneratorImpl.java
  
  Index: ProgramGeneratorImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/generator/ProgramGeneratorImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ProgramGeneratorImpl.java	2001/05/22 14:32:10	1.2
  +++ ProgramGeneratorImpl.java	2001/05/25 14:25:58	1.3
  @@ -37,6 +37,7 @@
   import org.apache.cocoon.components.language.programming.ProgrammingLanguage;
   import org.apache.cocoon.components.store.Store;
   import org.apache.cocoon.environment.SourceResolver;
  +import org.apache.cocoon.environment.Source;
   import org.apache.cocoon.util.IOUtils;
   import org.apache.log.Logger;
   import org.w3c.dom.Document;
  @@ -47,7 +48,7 @@
   /**
    * The default implementation of <code>ProgramGenerator</code>
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
  - * @version CVS $Revision: 1.2 $ $Date: 2001/05/22 14:32:10 $
  + * @version CVS $Revision: 1.3 $ $Date: 2001/05/25 14:25:58 $
    */
   public class ProgramGeneratorImpl extends AbstractLoggable
       implements ProgramGenerator, Contextualizable, Composable, Configurable, ThreadSafe,
Disposable {
  @@ -73,9 +74,6 @@
       /** The working directory */
       protected File workDir;
   
  -    /** The context root */
  -    protected String rootPath;
  -
       /** The root package */
       protected String rootPackage;
   
  @@ -83,7 +81,6 @@
       public void contextualize(Context context) throws ContextException {
           if (this.workDir == null) {
               this.workDir = (File) context.get(Constants.CONTEXT_WORK_DIR);
  -            this.rootPath = (String) context.get(Constants.CONTEXT_ROOT_PATH);
           }
       }
   
  @@ -125,19 +122,20 @@
        * @return The loaded program instance
        * @exception Exception If an error occurs during generation or loading
        */
  -    public CompiledComponent load(File file,
  +    public CompiledComponent load(String fileName,
                                     String markupLanguageName,
                                     String programmingLanguageName,
                                     SourceResolver resolver)
           throws Exception {
  +
  +        Source source = resolver.resolve(fileName);
   
  -        // Create filesystem store
           // Set filenames
  -        String filename = IOUtils.getFullFilename(file);
           StringBuffer contextFilename = new StringBuffer(this.rootPackage.replace('.', File.separatorChar));
           contextFilename.append(File.separator);
  -        contextFilename.append(IOUtils.getContextFilePath(this.rootPath, filename));
  +        contextFilename.append(fileName);
           String normalizedName = IOUtils.normalizedFilename(contextFilename.toString());
  +
           // Ensure no 2 requests for the same file overlap
           Class program = null;
           CompiledComponent programInstance = null;
  @@ -157,7 +155,7 @@
                   markupLanguage = (MarkupLanguage)this.markupSelector.select(markupLanguageName);
                   programmingLanguage = (ProgrammingLanguage)this.languageSelector.select(programmingLanguageName);
                   programmingLanguage.setLanguageName(programmingLanguageName);
  -                program = generateResource(file, normalizedName, markupLanguage, programmingLanguage,
resolver);
  +                program = generateResource(fileName, normalizedName, markupLanguage, programmingLanguage,
resolver);
               } catch (LanguageException le) {
                   getLogger().debug("Language Exception", le);
                   throw new ProcessingException("Language Exception", le);
  @@ -182,7 +180,7 @@
            * be queried for changes!!!
            */
   
  -        if (programInstance != null && programInstance.modifiedSince(file.lastModified()))
{
  +        if (programInstance != null && programInstance.modifiedSince(source.getLastModified()))
{
               // Release the component.
               release(programInstance);
   
  @@ -205,7 +203,7 @@
                       markupLanguage = (MarkupLanguage)this.markupSelector.select(markupLanguageName);
                       programmingLanguage = (ProgrammingLanguage)this.languageSelector.select(programmingLanguageName);
                       programmingLanguage.setLanguageName(programmingLanguageName);
  -                    program = generateResource(file, normalizedName, markupLanguage, programmingLanguage,
resolver);
  +                    program = generateResource(fileName, normalizedName, markupLanguage,
programmingLanguage, resolver);
                   } catch (LanguageException le) {
                       getLogger().debug("Language Exception", le);
                       throw new ProcessingException("Language Exception", le);
  @@ -221,16 +219,17 @@
           return programInstance;
       }
   
  -    private Class generateResource(File file,
  +    private Class generateResource(String fileName,
                                      String normalizedName,
                                      MarkupLanguage markupLanguage,
                                      ProgrammingLanguage programmingLanguage,
                                      SourceResolver resolver)
           throws Exception {
  +
  +        // Input Source
  +        InputSource is = new InputSource(resolver.resolve(fileName).getInputStream());
           // Generate code
  -        String code = markupLanguage.generateCode(
  -                                                  new InputSource(
  -                                                                  new FileReader(file)),
normalizedName, programmingLanguage, resolver);
  +        String code = markupLanguage.generateCode(is, normalizedName, programmingLanguage,
resolver);
           String encoding = markupLanguage.getEncoding();
           // Format source code if applicable
           CodeFormatter codeFormatter = programmingLanguage.getCodeFormatter();
  
  
  
  1.4       +2 -12     xml-cocoon2/src/org/apache/cocoon/generation/ServerPagesGenerator.java
  
  Index: ServerPagesGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/generation/ServerPagesGenerator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ServerPagesGenerator.java	2001/05/22 14:41:16	1.3
  +++ ServerPagesGenerator.java	2001/05/25 14:25:59	1.4
  @@ -46,7 +46,7 @@
    * delegating actual SAX event generation.
    *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
  - * @version CVS $Revision: 1.3 $ $Date: 2001/05/22 14:41:16 $
  + * @version CVS $Revision: 1.4 $ $Date: 2001/05/25 14:25:59 $
    */
   public class ServerPagesGenerator
     extends ServletGenerator
  @@ -138,16 +138,6 @@
   
       this.inputSource = this.resolver.resolve(super.source);
   
  -    if (this.inputSource.isFile() == false) {
  -      throw new ResourceNotFoundException("Not a file: " + this.inputSource.getSystemId());
  -    }
  -
  -    File file = this.inputSource.getFile();
  -
  -    if (!file.canRead()) {
  -      throw new ResourceNotFoundException("Can't read file: " + this.inputSource.getSystemId());
  -    }
  -
       if (this.markupLanguage == null) {
           this.markupLanguage = this.parameters.getParameter(
             "markup-language", DEFAULT_MARKUP_LANGUAGE
  @@ -159,7 +149,7 @@
   
       try {
         generator = (XSPGenerator)
  -        programGenerator.load(file, this.markupLanguage, this.programmingLanguage, this.resolver);
  +        programGenerator.load(super.source, this.markupLanguage, this.programmingLanguage,
this.resolver);
       } catch (Exception e) {
         getLogger().warn("ServerPagesGenerator.generate()", e);
         throw new ResourceNotFoundException(e.getMessage(), e);
  
  
  
  1.6       +2 -2      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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CocoonServlet.java	2001/05/23 21:27:35	1.5
  +++ CocoonServlet.java	2001/05/25 14:25:59	1.6
  @@ -57,7 +57,7 @@
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
    * @author <a href="mailto:nicolaken@supereva.it">Nicola Ken Barozzi</a> Aisa
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.5 $ $Date: 2001/05/23 21:27:35 $
  + * @version CVS $Revision: 1.6 $ $Date: 2001/05/25 14:25:59 $
    */
   
   public class CocoonServlet extends HttpServlet {
  @@ -156,7 +156,7 @@
         * get the classloader to use for Cocoon instantiation
         */
        protected RepositoryClassLoader buildInitClassLoader() {
  -         return new RepositoryClassLoader(new URL[] {}, Thread.currentThread().getContextClassLoader());
  +         return new RepositoryClassLoader(new URL[] {}, this.getClass().getClassLoader());
        }
   
       /**
  
  
  
  1.5       +18 -15    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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Handler.java	2001/05/23 09:03:56	1.4
  +++ Handler.java	2001/05/25 14:25:59	1.5
  @@ -32,6 +32,7 @@
   import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.environment.FactoryURLResolver;
   import org.apache.cocoon.environment.URLResolver;
  +import org.apache.cocoon.environment.Source;
   import org.xml.sax.InputSource;
   import org.xml.sax.SAXException;
   
  @@ -41,7 +42,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.4 $ $Date: 2001/05/23 09:03:56 $
  + * @version CVS $Revision: 1.5 $ $Date: 2001/05/25 14:25:59 $
    */
   public class Handler extends AbstractLoggable
   implements Runnable, Configurable, Composable, Contextualizable, Processor, Disposable
{
  @@ -55,8 +56,8 @@
       private ComponentManager manager;
   
       /** the source of this sitemap */
  -    private String source;
  -    private File sourceFile;
  +    private String sourceFileName;
  +    private Source source;
   
       /** the URLFactory */
       private URLFactory urlFactory;
  @@ -98,10 +99,10 @@
           this.context = context;
       }
   
  -    protected Handler (String source, boolean check_reload)
  +    protected Handler (String sourceFileName, boolean check_reload)
       throws FileNotFoundException {
           this.check_reload = check_reload;
  -        this.source = source;
  +        this.sourceFileName = sourceFileName;
       }
   
       protected boolean available () {
  @@ -111,7 +112,7 @@
       protected boolean hasChanged () {
           if (available()) {
               if (check_reload) {
  -                return sitemap.modifiedSince(this.sourceFile.lastModified());
  +                return sitemap.modifiedSince(this.source.getLastModified());
               }
               return false;
           }
  @@ -125,20 +126,16 @@
       protected synchronized void regenerateAsynchronously (Environment environment)
       throws Exception {
           String s;
  -        if (this.source.charAt(this.source.length() - 1) == '/') {
  -            s = this.source + "sitemap.xmap";
  -        } else {
  -            s = this.source;
  +        if (this.sourceFileName.charAt(this.sourceFileName.length() - 1) == '/') {
  +            this.sourceFileName = this.sourceFileName + "sitemap.xmap";
           }
           try {
               environment.setURLResolver(this.urlResolver);
  -            this.sourceFile = environment.resolve(s).getFile();
  +            this.source = environment.resolve(this.sourceFileName);
           } finally {
               environment.setURLResolver(null);
           }
  -        if (!this.sourceFile.canRead()) {
  -            throw new FileNotFoundException ("file " + this.sourceFile.toString() + " not
found or cannot be opened for reading");
  -        }
  +
           if (!this.isRegenerationRunning) {
               isRegenerationRunning = true;
               regeneration = new Thread (this);
  @@ -218,7 +215,13 @@
               XSLTFactoryLoader.setLogger(getLogger());
   
               programGenerator = (ProgramGenerator) this.manager.lookup(Roles.PROGRAM_GENERATOR);
  -            smap = (Sitemap) programGenerator.load(this.sourceFile, markupLanguage, programmingLanguage,
environment);
  +
  +            try {
  +                environment.setURLResolver(this.urlResolver);
  +                smap = (Sitemap) programGenerator.load(this.sourceFileName, markupLanguage,
programmingLanguage, environment);
  +            } finally {
  +                environment.setURLResolver(null);
  +            }
   
               if (this.sitemap != null) {
                  programGenerator.release((CompiledComponent) this.sitemap);
  
  
  
  1.6       +8 -32     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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TraxTransformer.java	2001/05/23 17:02:31	1.5
  +++ TraxTransformer.java	2001/05/25 14:25:59	1.6
  @@ -20,7 +20,6 @@
   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;
  @@ -100,10 +99,10 @@
    * @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.5 2001/05/23 17:02:31 bloritsch Exp $
  + * @version CVS $Id: TraxTransformer.java,v 1.6 2001/05/25 14:25:59 dims Exp $
    */
   public class TraxTransformer extends ContentHandlerWrapper
  -implements Transformer, Composable, Recyclable, Configurable, Cacheable, Disposable, URIResolver
{
  +implements Transformer, Composable, Recyclable, Configurable, Cacheable, Disposable {
   
       private static final String FILE = "file:";
   
  @@ -144,7 +143,9 @@
           Templates templates = getTemplates();
           if(templates == null) {
               getLogger().debug("Creating new Templates in " + this + " for " + this.inputSource.getSystemId());
  -            templates = getTransformerFactory().newTemplates(new SAXSource(new InputSource(this.inputSource.getReader())));
  +            InputSource is = new InputSource(this.inputSource.getReader());
  +            is.setSystemId(this.inputSource.getSystemId());
  +            templates = getTransformerFactory().newTemplates(new SAXSource(is));
               putTemplates (templates);
           } else {
               getLogger().debug("Reusing Templates in " + this + " for " + this.inputSource.getSystemId());
  @@ -154,7 +155,9 @@
           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());
  -            templates = getTransformerFactory().newTemplates(new SAXSource(new InputSource(this.inputSource.getReader())));
  +            InputSource is = new InputSource(this.inputSource.getReader());
  +            is.setSystemId(this.inputSource.getSystemId());
  +            templates = getTransformerFactory().newTemplates(new SAXSource(is));
               putTemplates (templates);
               handler = getTransformerFactory().newTransformerHandler(templates);
           }
  @@ -216,7 +219,6 @@
           if(tfactory == null)  {
               tfactory = (SAXTransformerFactory) TransformerFactory.newInstance();
               tfactory.setErrorListener(new TraxErrorHandler(getLogger()));
  -            tfactory.setURIResolver(this);
           }
           return tfactory;
       }
  @@ -511,30 +513,4 @@
           this.resolver = null;
           super.recycle();
       }
  -
  -    /**
  -     * 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 {
  -        try {
  -            return new javax.xml.transform.stream.StreamSource(this.resolver.resolve(href).getReader());
  -        } catch (IOException e) {
  -            throw new javax.xml.transform.TransformerException(e);
  -        } catch (SAXException e) {
  -            throw new javax.xml.transform.TransformerException(e);
  -        }
  -    }
  -
   }
  
  
  
  1.2       +5 -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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- IOUtils.java	2001/05/09 20:49:33	1.1
  +++ IOUtils.java	2001/05/25 14:25:59	1.2
  @@ -28,7 +28,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.1 $ $Date: 2001/05/09 20:49:33 $
  + * @version CVS $Revision: 1.2 $ $Date: 2001/05/25 14:25:59 $
    */
   public class IOUtils {
   
  @@ -158,6 +158,10 @@
      * @return The transformed filename
      */
     public static String normalizedFilename(String filename) {
  +    if(File.separatorChar == '\\')
  +        filename = filename.replace('/','\\');
  +    else
  +        filename = filename.replace('\\','/');
       String[] path = StringUtils.split(filename, File.separator);
       int start = (path[0].length() == 0) ? 1 : 0;
   
  
  
  
  1.3       +1 -2      xml-cocoon2/webapp/docs/samples/xsp/simple.xsp
  
  Index: simple.xsp
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/docs/samples/xsp/simple.xsp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- simple.xsp	2001/05/23 12:32:20	1.2
  +++ simple.xsp	2001/05/25 14:26:00	1.3
  @@ -4,8 +4,7 @@
             language="java"
             xmlns:xsp="http://apache.org/xsp"
             xmlns:xsp-request="http://apache.org/xsp/request/2.0"
  -          xmlns:xsp-response="http://apache.org/xsp/response/2.0"
  -      xmlns:log="http://apache.org/xsp/log/2.0"
  +          xmlns:log="http://apache.org/xsp/log/2.0"
   >
   
     <page>
  
  
  
  1.3       +0 -1      xml-cocoon2/webapp/stylesheets/dynamic-page2html.xsl
  
  Index: dynamic-page2html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/stylesheets/dynamic-page2html.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- dynamic-page2html.xsl	2001/05/23 12:32:21	1.2
  +++ dynamic-page2html.xsl	2001/05/25 14:26:00	1.3
  @@ -4,7 +4,6 @@
     version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:xsp-request="http://apache.org/xsp/request/2.0"
  -  xmlns:xsp-response="http://apache.org/xsp/response/2.0"
   >
   
     <xsl:include href="page/simple-page2html.xsl"/>
  
  
  

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


Mime
View raw message