You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by re...@apache.org on 2008/02/07 20:21:29 UTC

svn commit: r619581 - in /cocoon/whiteboard/micro/core: cocoon-core/src/main/java/org/apache/cocoon/sitemap/ cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/ cocoon-sitemap/cocoon-sitemap-impl/src/main/java/o...

Author: reinhard
Date: Thu Feb  7 11:21:22 2008
New Revision: 619581

URL: http://svn.apache.org/viewvc?rev=619581&view=rev
Log:
load the tree processor using Spring. This unfortunatly can't be done by pure Spring mechanisms because the tree processor would be created to early and the servlet context (SSF) hasn't been set correctly at this point of time.

Added:
    cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapPathCalculator.java   (with props)
    cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/resources/META-INF/cocoon/spring/cocoon-sitemap-impl.xml
      - copied, changed from r619412, cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/resources/META-INF/cocoon/spring/CocoonEntryObjectModelProvider.xml
Removed:
    cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/resources/META-INF/cocoon/spring/CocoonEntryObjectModelProvider.xml
    cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/resources/META-INF/cocoon/spring/MapExpressionLanguageCompiler.xml
    cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/resources/META-INF/cocoon/spring/cocoon-sitemap-expression.xml
Modified:
    cocoon/whiteboard/micro/core/cocoon-core/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java
    cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java
    cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
    cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/resources/META-INF/cocoon/spring/cocoon-xml-avalon.xml

Modified: cocoon/whiteboard/micro/core/cocoon-core/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/core/cocoon-core/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java?rev=619581&r1=619580&r2=619581&view=diff
==============================================================================
--- cocoon/whiteboard/micro/core/cocoon-core/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java (original)
+++ cocoon/whiteboard/micro/core/cocoon-core/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java Thu Feb  7 11:21:22 2008
@@ -17,7 +17,6 @@
 package org.apache.cocoon.sitemap;
 
 import java.io.IOException;
-import java.net.URL;
 
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
@@ -25,13 +24,11 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.avalon.framework.container.ContainerUtil;
-import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.cocoon.Processor;
 import org.apache.cocoon.components.treeprocessor.TreeProcessor;
-import org.apache.cocoon.core.container.spring.avalon.AvalonUtils;
+import org.apache.cocoon.components.treeprocessor.sitemap.SitemapPathCalculator;
 import org.apache.cocoon.servlet.RequestUtil;
-import org.springframework.beans.factory.BeanCreationException;
+import org.apache.cocoon.spring.configurator.WebAppContextUtils;
 
 /**
  * Use this servlet as an entry point to Cocoon. It wraps the {@link TreeProcessor}
@@ -41,15 +38,8 @@
  */
 public class SitemapServlet extends HttpServlet {
 
-    /**
-     * Name of the 'sitemap-path' servlet init parameter. Value should point
-     * to the location of sitemap file, defaults to '/sitemap.xmap'.
-     */
-    private static final String PARAM_SITEMAP_PATH = "sitemap-path";
-
-    private static final String DEFAULT_SITEMAP_PATH = "/sitemap.xmap";
-
-    protected RequestProcessor processor;
+    protected Processor processor;
+    protected RequestProcessor requestProcessor;
 
     /**
      * Initialize the servlet. The main purpose of this method is creating a
@@ -57,26 +47,17 @@
      */
     public void init() throws ServletException {
         super.init();
-        this.processor = new RequestProcessor(getServletContext());
     }
 
     /**
      * Process the incoming request using the Cocoon tree processor.
      */
-    protected void service(HttpServletRequest request, HttpServletResponse response)
-    throws ServletException, IOException {
-
-        this.processor.service(request, response);
-    }
-
-    /**
-     * @see javax.servlet.GenericServlet#destroy()
-     */
-    public void destroy() {
-        if (this.processor != null) {
-            this.processor.destroy();
+    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException,
+            IOException {
+        if(this.requestProcessor == null) {
+            this.requestProcessor = new RequestProcessor(getServletContext());
         }
-        super.destroy();
+        this.requestProcessor.service(request, response);
     }
 
     protected class RequestProcessor extends org.apache.cocoon.servlet.RequestProcessor {
@@ -90,28 +71,16 @@
         }
 
         protected Processor getProcessor() {
-            ServiceManager serviceManager =
-                (ServiceManager) this.cocoonBeanFactory.getBean(AvalonUtils.SERVICE_MANAGER_ROLE);
-
-            // create the tree processor
-            TreeProcessor processor;
+            TreeProcessor treeProcessor = (TreeProcessor) WebAppContextUtils.getCurrentWebApplicationContext().getBean(Processor.ROLE);
+            SitemapPathCalculator sitemapPathCalculator = new SitemapPathCalculator();
+            sitemapPathCalculator.setServletContext(this.servletContext);
             try {
-                processor = new TreeProcessor();
-                processor.setSitemapPath(this.calculateSitemapPath(this.servletContext));
-                ContainerUtil.service(processor, serviceManager);
-                ContainerUtil.initialize(processor);
+                treeProcessor.setSitemapPathCalculator(sitemapPathCalculator);
+                treeProcessor.initialize();
             } catch (Exception e) {
-                throw new BeanCreationException("Could not create TreeProcessor", e);
-            }
-
-            return processor;
-        }
-
-        protected void destroy() {
-            if (this.processor != null) {
-                ContainerUtil.dispose(this.processor);
-                this.processor = null;
+                throw new RuntimeException("Could not create TreeProcessor", e);
             }
+            return treeProcessor;
         }
 
         /**
@@ -121,28 +90,6 @@
             return RequestUtil.getCompleteBlockUri(request, response);
         }
 
-        /**
-         * Calculate the path to the sitemap based on the servlet init parameter
-         * {@link SitemapServlet#PARAM_SITEMAP_PATH} using the servlet context
-         * to resolve it. If there is no parameter set, the default value
-         * {@link SitemapServlet#DEFAULT_SITEMAP_PATH} is used.
-         *
-         * @param servletContext
-         * @return The calculated path to the sitemap.
-         * @throws IOException
-         *             if the URL can't be found.
-         */
-        private String calculateSitemapPath(final ServletContext servletContext) throws IOException {
-            String sitemapPath = getInitParameter(PARAM_SITEMAP_PATH);
-            if (sitemapPath == null) {
-                sitemapPath = DEFAULT_SITEMAP_PATH;
-            }
-            URL url = servletContext.getResource(sitemapPath);
-            if (url == null) {
-                throw new IOException("Couldn't find the sitemap " + sitemapPath + ".");
-            }
-            return url.toExternalForm();
-        }
 
     }
 }

Modified: cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java?rev=619581&r1=619580&r2=619581&view=diff
==============================================================================
--- cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java (original)
+++ cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java Thu Feb  7 11:21:22 2008
@@ -59,7 +59,7 @@
     /** The redirector */
     protected Redirector redirector;
 
-    /** The current component manager, as set by the last call to {@link #service}. */
+    /** The current component manager, as set by the last call to {@link #manager}. */
     private ServiceManager manager;
 
     /** Unified Object Model */

Modified: cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java?rev=619581&r1=619580&r2=619581&view=diff
==============================================================================
--- cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java (original)
+++ cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java Thu Feb  7 11:21:22 2008
@@ -18,39 +18,33 @@
 
 import java.io.IOException;
 import java.net.URL;
+
 import javax.xml.XMLConstants;
 import javax.xml.transform.stream.StreamSource;
 import javax.xml.validation.Schema;
 import javax.xml.validation.SchemaFactory;
 import javax.xml.validation.Validator;
 
-import org.apache.avalon.framework.activity.Disposable;
-import org.apache.avalon.framework.activity.Initializable;
-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.NamespacedSAXConfigurationHandler;
 import org.apache.avalon.framework.container.ContainerUtil;
-import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.avalon.framework.service.Serviceable;
-import org.apache.avalon.framework.thread.ThreadSafe;
-import org.apache.excalibur.source.Source;
-import org.apache.excalibur.source.SourceResolver;
-import org.apache.regexp.RE;
-
 import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.Processor;
 import org.apache.cocoon.components.flow.Interpreter;
 import org.apache.cocoon.components.source.util.SourceUtil;
 import org.apache.cocoon.components.treeprocessor.sitemap.FlowNode;
+import org.apache.cocoon.components.treeprocessor.sitemap.SitemapPathCalculator;
 import org.apache.cocoon.configuration.Settings;
 import org.apache.cocoon.environment.Environment;
 import org.apache.cocoon.environment.internal.EnvironmentHelper;
 import org.apache.cocoon.sitemap.SitemapExecutor;
 import org.apache.cocoon.sitemap.impl.DefaultExecutor;
 import org.apache.cocoon.util.AbstractLogEnabled;
-
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.source.SourceResolver;
+import org.apache.regexp.RE;
 import org.xml.sax.SAXException;
 
 /**
@@ -58,12 +52,9 @@
  *
  * @version $Id$
  */
-public class TreeProcessor extends AbstractLogEnabled implements ThreadSafe, Processor, Serviceable,
-        Disposable, Initializable {
+public class TreeProcessor extends AbstractLogEnabled implements Processor {
 
-    /**
-     * The component manager
-     */
+    /** The component manager */
     protected ServiceManager manager;
 
     /** The settings. */
@@ -102,20 +93,11 @@
         } catch (SAXException se) {
             throw new RuntimeException("Unable to parse sitemap schema.", se);
         }
+        this.sitemapExecutor =  new DefaultExecutor();
     }
 
     /**
-     * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
-     */
-    public void service(ServiceManager serviceManager) throws ServiceException {
-        this.manager = serviceManager;
-        this.resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
-        this.settings = (Settings) this.manager.lookup(Settings.ROLE);
-        this.sitemapExecutor = new DefaultExecutor();
-    }
-
-    /**
-     * @see org.apache.avalon.framework.activity.Initializable#initialize()
+     * Initialize the tree processor after all dependencies have been set.
      */
     public void initialize() throws Exception {
         this.source = this.resolver.resolveURI(this.sitemapPath);
@@ -129,19 +111,44 @@
         ContainerUtil.service(this.environmentHelper, this.manager);
     }
 
+    /**
+     * Set the Cocoon settings.
+     *
+     * @param settings
+     */
+    public void setSettings(Settings settings) {
+        this.settings = settings;
+    }
+
+    /**
+     * Set the {@link SourceResolver}.
+     * @param resolver
+     */
+    public void setSourceResolver(SourceResolver resolver) {
+        this.resolver = resolver;
+    }
 
     /**
-     * Set the path to the sitemap. It will be resolved by the Cocoon SourceResolver.
+     * Set the {@link ServiceManager}.
+     * @param manager
+     */
+    public void setServiceManager(ServiceManager manager) {
+        this.manager = manager;
+    }
+
+    /**
+     * Set the calculator to lookup the sitemap path.
      *
-     * @param sitemapPath
+     * @param sitemapPathCalculator
+     * @throws IOException if the sitemap can't be found.
      */
-    public void setSitemapPath(String sitemapPath) {
-        this.sitemapPath = sitemapPath;
+    public void setSitemapPathCalculator(SitemapPathCalculator sitemapPathCalculator) throws IOException {
+        this.sitemapPath = sitemapPathCalculator.calculateSitemapPath();
     }
 
     /**
      * Process the given <code>Environment</code> producing the output.
-     * @return If the processing is successfull <code>true</code> is returned.
+     * @return If the processing is successful <code>true</code> is returned.
      *         If not match is found in the sitemap <code>false</code>
      *         is returned.
      * @throws org.apache.cocoon.ResourceNotFoundException If a sitemap component tries
@@ -305,23 +312,11 @@
     /**
      * @see org.apache.avalon.framework.activity.Disposable#dispose()
      */
-    public void dispose() {
+    public void destroy() {
         // Dispose the concrete processor. No need to check for existing requests, as there
         // are none when a TreeProcessor is disposed.
         ContainerUtil.dispose(this.concreteProcessor);
         this.concreteProcessor = null;
-
-        if (this.manager != null) {
-            if (this.source != null) {
-                this.resolver.release(this.source);
-                this.source = null;
-            }
-            this.manager.release(this.resolver);
-            this.manager.release(this.settings);
-            this.resolver = null;
-            this.manager = null;
-            this.settings = null;
-        }
     }
 
     /**

Added: cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapPathCalculator.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapPathCalculator.java?rev=619581&view=auto
==============================================================================
--- cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapPathCalculator.java (added)
+++ cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapPathCalculator.java Thu Feb  7 11:21:22 2008
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.components.treeprocessor.sitemap;
+
+import java.io.IOException;
+import java.net.URL;
+
+import javax.servlet.ServletContext;
+
+public class SitemapPathCalculator {
+
+    /**
+     * Name of the 'sitemap-path' servlet init parameter. Value should point
+     * to the location of sitemap file, defaults to '/sitemap.xmap'.
+     */
+    private static final String PARAM_SITEMAP_PATH = "sitemap-path";
+
+    private static final String DEFAULT_SITEMAP_PATH = "/sitemap.xmap";
+
+    private ServletContext servletContext;
+
+    /**
+     * Calculate the path to the sitemap based on the servlet init parameter
+     * {@link SitemapServlet#PARAM_SITEMAP_PATH} using the servlet context
+     * to resolve it. If there is no parameter set, the default value
+     * {@link SitemapServlet#DEFAULT_SITEMAP_PATH} is used.
+     *
+     * @param servletContext
+     * @return The calculated path to the sitemap.
+     * @throws IOException
+     *             if the URL can't be found.
+     */
+    public String calculateSitemapPath() throws IOException {
+        String sitemapPath = this.servletContext.getInitParameter(PARAM_SITEMAP_PATH);
+        if (sitemapPath == null) {
+            sitemapPath = DEFAULT_SITEMAP_PATH;
+        }
+        URL url = this.servletContext.getResource(sitemapPath);
+        if (url == null) {
+            throw new IOException("Couldn't find the sitemap " + sitemapPath + ".");
+        }
+        return url.toExternalForm();
+    }
+
+    public void setServletContext(ServletContext servletContext) {
+        this.servletContext = servletContext;
+    }
+
+}

Propchange: cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapPathCalculator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapPathCalculator.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SitemapPathCalculator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/resources/META-INF/cocoon/spring/cocoon-sitemap-impl.xml (from r619412, cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/resources/META-INF/cocoon/spring/CocoonEntryObjectModelProvider.xml)
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/resources/META-INF/cocoon/spring/cocoon-sitemap-impl.xml?p2=cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/resources/META-INF/cocoon/spring/cocoon-sitemap-impl.xml&p1=cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/resources/META-INF/cocoon/spring/CocoonEntryObjectModelProvider.xml&r1=619412&r2=619581&rev=619581&view=diff
==============================================================================
--- cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/resources/META-INF/cocoon/spring/CocoonEntryObjectModelProvider.xml (original)
+++ cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/resources/META-INF/cocoon/spring/cocoon-sitemap-impl.xml Thu Feb  7 11:21:22 2008
@@ -16,15 +16,32 @@
   limitations under the License.
 -->
 <!-- SVN $Id$ -->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
 
-    <!-- ObjectModelEntry provider for 'cocoon' -->
-    <bean name="org.apache.cocoon.el.objectmodel.ObjectModelProvider/cocoon"
-          class="org.apache.cocoon.objectmodel.impl.CocoonEntryObjectModelProvider">
-        <property name="settings" ref="org.apache.cocoon.configuration.Settings"/>
-        <property name="processInfoProvider" ref="org.apache.cocoon.processing.ProcessInfoProvider"/>
-    </bean>
+  <!-- The Cocoon tree processor -->
+  <bean name="org.apache.cocoon.Processor" class="org.apache.cocoon.components.treeprocessor.TreeProcessor"
+    destroy-method="destroy" scope="prototype">
+    <property name="serviceManager" ref="org.apache.avalon.framework.service.ServiceManager"/>
+    <property name="settings" ref="org.apache.cocoon.configuration.Settings"/>
+    <property name="sourceResolver" ref="org.apache.excalibur.source.SourceResolver"/>
+  </bean>
 
-</beans>
\ No newline at end of file
+  <!-- ObjectModelEntry provider for 'cocoon' -->
+  <bean name="org.apache.cocoon.el.objectmodel.ObjectModelProvider/cocoon"
+    class="org.apache.cocoon.objectmodel.impl.CocoonEntryObjectModelProvider">
+    <property name="settings" ref="org.apache.cocoon.configuration.Settings"/>
+    <property name="processInfoProvider" ref="org.apache.cocoon.processing.ProcessInfoProvider"/>
+  </bean>
+
+  <bean name="org.apache.cocoon.components.treeprocessor.variables.VariableResolver"
+    class="org.apache.cocoon.components.treeprocessor.variables.StringTemplateParserVariableResolver" scope="prototype">
+    <property name="stringTemplateParser" ref="org.apache.cocoon.el.parsing.StringTemplateParser"/>
+    <property name="objectModel" ref="org.apache.cocoon.el.objectmodel.ObjectModel"/>
+  </bean>
+
+  <!-- An expression language compiler for the "map" language used in Cocoon sitemaps. -->
+  <bean name="org.apache.cocoon.el.ExpressionCompiler/map"
+    class="org.apache.cocoon.components.treeprocessor.variables.SitemapLanguageCompiler"/>
+
+</beans>

Modified: cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/resources/META-INF/cocoon/spring/cocoon-xml-avalon.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/resources/META-INF/cocoon/spring/cocoon-xml-avalon.xml?rev=619581&r1=619580&r2=619581&view=diff
==============================================================================
--- cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/resources/META-INF/cocoon/spring/cocoon-xml-avalon.xml (original)
+++ cocoon/whiteboard/micro/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/resources/META-INF/cocoon/spring/cocoon-xml-avalon.xml Thu Feb  7 11:21:22 2008
@@ -1,6 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN"
-    "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
 <!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
@@ -17,9 +15,11 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
+<!-- $Id$ -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
 
-<!-- @version $Id$ -->
-<beans>
   <bean name="org.apache.excalibur.xml.dom.DOMParser"
         class="org.apache.cocoon.core.xml.avalon.DefaultDOMParser" scope="singleton">
     <property name="parser" ref="org.apache.cocoon.core.xml.DOMParser"/>
@@ -34,4 +34,5 @@
         class="org.apache.cocoon.core.xml.avalon.DefaultResolver" scope="singleton">
     <property name="resolver" ref="org.xml.sax.EntityResolver"/>
   </bean>
+
 </beans>