servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r640833 - in /servicemix/smx3/trunk/deployables/serviceengines/servicemix-saxon/src: main/java/org/apache/servicemix/saxon/XsltEndpoint.java test/resources/default.xsl test/resources/transform.xsl
Date Tue, 25 Mar 2008 14:39:38 GMT
Author: gnodet
Date: Tue Mar 25 07:39:37 2008
New Revision: 640833

URL: http://svn.apache.org/viewvc?rev=640833&view=rev
Log:
SM-1286: Saxon does not resolve xsl imports / includes relative to the location

Added:
    servicemix/smx3/trunk/deployables/serviceengines/servicemix-saxon/src/test/resources/default.xsl
Modified:
    servicemix/smx3/trunk/deployables/serviceengines/servicemix-saxon/src/main/java/org/apache/servicemix/saxon/XsltEndpoint.java
    servicemix/smx3/trunk/deployables/serviceengines/servicemix-saxon/src/test/resources/transform.xsl

Modified: servicemix/smx3/trunk/deployables/serviceengines/servicemix-saxon/src/main/java/org/apache/servicemix/saxon/XsltEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/deployables/serviceengines/servicemix-saxon/src/main/java/org/apache/servicemix/saxon/XsltEndpoint.java?rev=640833&r1=640832&r2=640833&view=diff
==============================================================================
--- servicemix/smx3/trunk/deployables/serviceengines/servicemix-saxon/src/main/java/org/apache/servicemix/saxon/XsltEndpoint.java
(original)
+++ servicemix/smx3/trunk/deployables/serviceengines/servicemix-saxon/src/main/java/org/apache/servicemix/saxon/XsltEndpoint.java
Tue Mar 25 07:39:37 2008
@@ -129,16 +129,16 @@
     }
 
     protected Source createXsltSource(Resource res) throws Exception {
+        String url = null;
+        try {
+            url = res.getURL().toURI().toString();
+        } catch (Exception e) {
+            // Ignore
+        }
         if (useDomSourceForXslt) {
-            String url = null;
-            try {
-                url = res.getURL().toURI().toString();
-            } catch (Exception e) {
-                // Ignore
-            }
             return new DOMSource(parse(res), url);
         } else {
-            return new StreamSource(res.getInputStream());
+            return new StreamSource(res.getInputStream(), url);
         }
     }
 

Added: servicemix/smx3/trunk/deployables/serviceengines/servicemix-saxon/src/test/resources/default.xsl
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/deployables/serviceengines/servicemix-saxon/src/test/resources/default.xsl?rev=640833&view=auto
==============================================================================
--- servicemix/smx3/trunk/deployables/serviceengines/servicemix-saxon/src/test/resources/default.xsl
(added)
+++ servicemix/smx3/trunk/deployables/serviceengines/servicemix-saxon/src/test/resources/default.xsl
Tue Mar 25 07:39:37 2008
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+    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.
+
+-->
+<xsl:stylesheet
+  xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
+  version='1.0'>
+
+  <xsl:template match="/">
+    <transformed>
+      <xsl:copy>
+        <xsl:copy-of select="attribute::*"/>
+        <xsl:apply-templates/>
+      </xsl:copy>
+    </transformed>
+  </xsl:template>
+
+</xsl:stylesheet>

Modified: servicemix/smx3/trunk/deployables/serviceengines/servicemix-saxon/src/test/resources/transform.xsl
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/deployables/serviceengines/servicemix-saxon/src/test/resources/transform.xsl?rev=640833&r1=640832&r2=640833&view=diff
==============================================================================
--- servicemix/smx3/trunk/deployables/serviceengines/servicemix-saxon/src/test/resources/transform.xsl
(original)
+++ servicemix/smx3/trunk/deployables/serviceengines/servicemix-saxon/src/test/resources/transform.xsl
Tue Mar 25 07:39:37 2008
@@ -21,6 +21,8 @@
   xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
   version='1.0'>
 
+  <xsl:import href="default.xsl" />
+
   <xsl:output method="xml" indent="yes" encoding="ISO-8859-1"/>
 
   <xsl:template match="/">



Mime
View raw message