You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2010/02/11 16:40:33 UTC

svn commit: r909028 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/builder/xml/ components/camel-spring/src/main/java/org/apache/camel/component/xslt/ components/camel-spring/src/test/java/org/apache/camel/component/xslt/ components/camel...

Author: davsclaus
Date: Thu Feb 11 15:40:28 2010
New Revision: 909028

URL: http://svn.apache.org/viewvc?rev=909028&view=rev
Log:
CAMEL-2463: xslt component now supports using xsl:include where the included files is loaded from classpath and relative according to the endpoint configured location.

Added:
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XsltUriResolver.java   (with props)
    camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeClasspathTest.java
      - copied, changed from r908925, camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeTest.java
    camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeRelativeOtherTest.java   (with props)
    camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeRelativeTest.java   (with props)
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/staff_other_template.xsl
      - copied, changed from r908925, camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_template.xsl
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include_classpath.xsl
      - copied, changed from r908925, camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include.xsl
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include_relative.xsl   (with props)
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include_relative_other.xsl   (with props)
Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XsltBuilder.java
    camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/xslt/XsltComponent.java
    camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/MainTest.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XsltBuilder.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XsltBuilder.java?rev=909028&r1=909027&r2=909028&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XsltBuilder.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XsltBuilder.java Thu Feb 11 15:40:28 2010
@@ -23,13 +23,14 @@
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
-
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.transform.Result;
 import javax.xml.transform.Source;
 import javax.xml.transform.Templates;
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.URIResolver;
 import javax.xml.transform.stream.StreamSource;
 
 import org.apache.camel.Exchange;
@@ -53,6 +54,7 @@
     private Templates template;
     private ResultHandlerFactory resultHandlerFactory = new StringResultHandlerFactory();
     private boolean failOnNullBody = true;
+    private URIResolver uriResolver;
 
     public XsltBuilder() {
     }
@@ -156,6 +158,14 @@
         return this;
     }
 
+    /**
+     * Sets a custom URI resolver to be used
+     */
+    public XsltBuilder uriResolver(URIResolver uriResolver) {
+        setUriResolver(uriResolver);
+        return this;
+    }
+
     // Properties
     // -------------------------------------------------------------------------
 
@@ -198,10 +208,15 @@
      * @throws TransformerConfigurationException is thrown if creating a XSLT transformer failed.
      */
     public void setTransformerSource(Source source) throws TransformerConfigurationException {
+        TransformerFactory factory = converter.getTransformerFactory();
+        if (getUriResolver() != null) {
+            factory.setURIResolver(getUriResolver());
+        }
+
         // Check that the call to newTemplates() returns a valid template instance.
         // In case of an xslt parse error, it will return null and we should stop the
         // deployment and raise an exception as the route will not be setup properly.
-        Templates templates = converter.getTransformerFactory().newTemplates(source);
+        Templates templates = factory.newTemplates(source);
         if (templates != null) {
             setTemplate(templates);
         } else {
@@ -242,6 +257,14 @@
         this.converter = converter;
     }
 
+    public URIResolver getUriResolver() {
+        return uriResolver;
+    }
+
+    public void setUriResolver(URIResolver uriResolver) {
+        this.uriResolver = uriResolver;
+    }
+
     // Implementation methods
     // -------------------------------------------------------------------------
 
@@ -269,6 +292,11 @@
      * Configures the transformer with exchange specific parameters
      */
     protected void configureTransformer(Transformer transformer, Exchange exchange) {
+        if (uriResolver == null) {
+            uriResolver = new XsltUriResolver(exchange.getContext().getClassResolver(), null);
+        }
+        transformer.setURIResolver(uriResolver);
+
         transformer.clearParameters();
 
         addParameters(transformer, exchange.getProperties());

Added: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XsltUriResolver.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XsltUriResolver.java?rev=909028&view=auto
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XsltUriResolver.java (added)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XsltUriResolver.java Thu Feb 11 15:40:28 2010
@@ -0,0 +1,101 @@
+/**
+ * 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.camel.builder.xml;
+
+import java.io.File;
+import java.io.InputStream;
+import javax.xml.transform.Source;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.URIResolver;
+import javax.xml.transform.stream.StreamSource;
+
+import org.apache.camel.spi.ClassResolver;
+import org.apache.camel.util.FileUtil;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Camel specific {@link javax.xml.transform.URIResolver} which is capable of loading files
+ * from the classpath and file system.
+ * <p/>
+ * Use prefix <tt>classpath:</tt> or <tt>file:</tt> to denote either classpath or file system.
+ * If no prefix is provided then the prefix from the <tt>location</tt> parameter is used.
+ * If it neither has a prefix then <tt>classpath:</tt> is used.
+ * <p/>
+ * This implementation <b>cannot</b> load files over http.
+ *
+ * @version $Revision$
+ */
+public class XsltUriResolver implements URIResolver {
+
+    private static final transient Log LOG = LogFactory.getLog(XsltUriResolver.class); 
+
+    private final ClassResolver resolver;
+    private final String location;
+
+    public XsltUriResolver(ClassResolver resolver, String location) {
+        this.resolver = resolver;
+        this.location = location;
+    }
+
+    public Source resolve(String href, String base) throws TransformerException {
+        if (ObjectHelper.isEmpty(href)) {
+            throw new TransformerException("include href is empty");
+        }
+
+        if (LOG.isTraceEnabled()) {
+            LOG.trace("Resolving URI with href: " + href + " and base: " + base);
+        }
+
+        if (href.startsWith("classpath:")) {
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Resolving URI from classpath: " + href);
+            }
+
+            String name = ObjectHelper.after(href, ":");
+            InputStream is = resolver.loadResourceAsStream(name);
+            if (is == null) {
+                throw new TransformerException("Cannot find " + name + " in classpath");
+            }
+            return new StreamSource(is);
+        }
+
+        if (href.startsWith("file:")) {
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Resolving URI from file: " + href);
+            }
+
+            String name = ObjectHelper.after(href, ":");
+            File file = new File(name);
+            return new StreamSource(file);
+        }
+
+        // okay then its relative to the starting location from the XSLT component
+        String path = FileUtil.onlyPath(location);
+        if (ObjectHelper.isEmpty(path)) {
+            // default to use classpath: location
+            path = "classpath:" + href;
+            return resolve(path, base);
+        } else {
+            // default to use classpath: location
+            path = "classpath:" + path + File.separator + href;
+            return resolve(path, base);
+        }
+    }
+    
+}

Propchange: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XsltUriResolver.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XsltUriResolver.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/xslt/XsltComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/xslt/XsltComponent.java?rev=909028&r1=909027&r2=909028&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/xslt/XsltComponent.java (original)
+++ camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/xslt/XsltComponent.java Thu Feb 11 15:40:28 2010
@@ -19,13 +19,14 @@
 import java.util.Map;
 
 import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.URIResolver;
 
 import org.apache.camel.Endpoint;
 import org.apache.camel.builder.xml.XsltBuilder;
+import org.apache.camel.builder.xml.XsltUriResolver;
 import org.apache.camel.component.ResourceBasedComponent;
 import org.apache.camel.converter.jaxp.XmlConverter;
 import org.apache.camel.impl.ProcessorEndpoint;
-import org.apache.camel.util.CamelContextHelper;
 import org.springframework.core.io.Resource;
 
 /**
@@ -80,6 +81,11 @@
         if (factory != null) {
             xslt.getConverter().setTransformerFactory(factory);
         }
+
+        // set resolver before input stream as resolver is used when loading the input stream
+        URIResolver resolver = new XsltUriResolver(getCamelContext().getClassResolver(), remaining);
+        xslt.setUriResolver(resolver);
+
         xslt.setTransformerInputStream(resource.getInputStream());
         configureXslt(xslt, uri, remaining, parameters);
         return new ProcessorEndpoint(uri, this, xslt);

Copied: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeClasspathTest.java (from r908925, camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeClasspathTest.java?p2=camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeClasspathTest.java&p1=camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeTest.java&r1=908925&r2=909028&rev=909028&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeTest.java (original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeClasspathTest.java Thu Feb 11 15:40:28 2010
@@ -23,9 +23,9 @@
 /**
  * @version $Revision$
  */
-public class XsltIncludeTest extends ContextTestSupport {
+public class XsltIncludeClasspathTest extends ContextTestSupport {
 
-    public void testXsltInclude() throws Exception {
+    public void testXsltIncludeClasspath() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(1);
         // the include file has the span style so check that its there
@@ -40,10 +40,10 @@
             @Override
             public void configure() throws Exception {
                 from("file:src/test/data/?fileName=staff.xml&noop=true")
-                    .to("xslt:org/apache/camel/component/xslt/staff_include.xsl")
+                    .to("xslt:org/apache/camel/component/xslt/staff_include_classpath.xsl")
                     .to("log:foo")
                     .to("mock:result");
             }
         };
     }
-}
+}
\ No newline at end of file

Added: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeRelativeOtherTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeRelativeOtherTest.java?rev=909028&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeRelativeOtherTest.java (added)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeRelativeOtherTest.java Thu Feb 11 15:40:28 2010
@@ -0,0 +1,49 @@
+/**
+ * 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.camel.component.xslt;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+
+/**
+ * @version $Revision$
+ */
+public class XsltIncludeRelativeOtherTest extends ContextTestSupport {
+
+    public void testXsltIncludeRelativeOther() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedMessageCount(1);
+        // the include file has the span style so check that its there
+        mock.message(0).constant("<span style=\"color:yellow;\">48</span>");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("file:src/test/data/?fileName=staff.xml&noop=true")
+                    .to("xslt:org/apache/camel/component/xslt/staff_include_relative_other.xsl")
+                    .to("log:foo")
+                    .to("mock:result");
+            }
+        };
+    }
+}
\ No newline at end of file

Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeRelativeOtherTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeRelativeOtherTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeRelativeTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeRelativeTest.java?rev=909028&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeRelativeTest.java (added)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeRelativeTest.java Thu Feb 11 15:40:28 2010
@@ -0,0 +1,49 @@
+/**
+ * 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.camel.component.xslt;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+
+/**
+ * @version $Revision$
+ */
+public class XsltIncludeRelativeTest extends ContextTestSupport {
+
+    public void testXsltIncludeRelative() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedMessageCount(1);
+        // the include file has the span style so check that its there
+        mock.message(0).constant("<span style=\"font-size=22px;\">Minnie Mouse</span>");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("file:src/test/data/?fileName=staff.xml&noop=true")
+                    .to("xslt:org/apache/camel/component/xslt/staff_include_relative.xsl")
+                    .to("log:foo")
+                    .to("mock:result");
+            }
+        };
+    }
+}
\ No newline at end of file

Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeRelativeTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltIncludeRelativeTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/MainTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/MainTest.java?rev=909028&r1=909027&r2=909028&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/MainTest.java (original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/MainTest.java Thu Feb 11 15:40:28 2010
@@ -50,7 +50,8 @@
         CamelContext camelContext = contextList.get(0);
 
         MockEndpoint endpoint = camelContext.getEndpoint("mock:results", MockEndpoint.class);
-        endpoint.expectedMessageCount(2);
+        // in case we add more files in src/test/data
+        endpoint.expectedMinimumMessageCount(2);
         endpoint.assertIsSatisfied();
         List<Exchange> list = endpoint.getReceivedExchanges();
 

Copied: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/staff_other_template.xsl (from r908925, camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_template.xsl)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/staff_other_template.xsl?p2=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/staff_other_template.xsl&p1=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_template.xsl&r1=908925&r2=909028&rev=909028&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_template.xsl (original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/staff_other_template.xsl Thu Feb 11 15:40:28 2010
@@ -4,32 +4,15 @@
     <xsl:template match="staff/programmer">
         <html>
             <body>
-                <xsl:apply-templates select="name"/>
-                <xsl:apply-templates select="dob"/>
                 <xsl:apply-templates select="age"/>
                 <br/>
             </body>
         </html>
     </xsl:template>
 
-    <xsl:template match="name">
-        <span style="font-size=22px;">
-            <xsl:value-of select="."/>
-        </span>
-        <br/>
-    </xsl:template>
-
-    <xsl:template match="dob">
-        DOB:
-        <span style="color:blue;">
-            <xsl:value-of select="."/>
-        </span>
-        <br/>
-    </xsl:template>
-
     <xsl:template match="age">
         AGE:
-        <span style="color:green;">
+        <span style="color:yellow;">
             <xsl:value-of select="."/>
         </span>
         <br/>

Copied: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include_classpath.xsl (from r908925, camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include.xsl)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include_classpath.xsl?p2=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include_classpath.xsl&p1=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include.xsl&r1=908925&r2=909028&rev=909028&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include.xsl (original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include_classpath.xsl Thu Feb 11 15:40:28 2010
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 
-    <xsl:include href="file:src/test/resources/org/apache/camel/component/xslt/staff_template.xsl"/>
+    <xsl:include href="classpath:org/apache/camel/component/xslt/staff_template.xsl"/>
 
     <xsl:template match="staff/programmer">
         <html>

Added: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include_relative.xsl
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include_relative.xsl?rev=909028&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include_relative.xsl (added)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include_relative.xsl Thu Feb 11 15:40:28 2010
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+    <xsl:include href="staff_template.xsl"/>
+
+    <xsl:template match="staff/programmer">
+        <html>
+            <body>
+                <xsl:apply-templates select="name"/>
+                <xsl:apply-templates select="dob"/>
+                <xsl:apply-templates select="age"/>
+                <br/>
+            </body>
+        </html>
+    </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include_relative.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include_relative.xsl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include_relative.xsl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include_relative_other.xsl
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include_relative_other.xsl?rev=909028&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include_relative_other.xsl (added)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include_relative_other.xsl Thu Feb 11 15:40:28 2010
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+    <xsl:include href="../staff_other_template.xsl"/>
+
+    <xsl:template match="staff/programmer">
+        <html>
+            <body>
+                <xsl:apply-templates select="age"/>
+                <br/>
+            </body>
+        </html>
+    </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include_relative_other.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include_relative_other.xsl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/component/xslt/staff_include_relative_other.xsl
------------------------------------------------------------------------------
    svn:mime-type = text/xml