[Yanel-commits] rev 44431 - public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/resources

guillaume at wyona.com guillaume at wyona.com
Thu Aug 27 12:24:58 CEST 2009


Author: guillaume
Date: 2009-08-27 12:24:58 +0200 (Thu, 27 Aug 2009)
New Revision: 44431

Modified:
   public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/resources/BasicXMLResource.java
Log:
XSLT imports and includes with relative URLS finally work! :)
(Was only tested with 'yanelrepo' and 'yanelhtdocs' protocols, but this should also work for all others.)

Issue: 6382


Modified: public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/resources/BasicXMLResource.java
===================================================================
--- public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/resources/BasicXMLResource.java	2009-08-27 10:19:23 UTC (rev 44430)
+++ public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/resources/BasicXMLResource.java	2009-08-27 10:24:58 UTC (rev 44431)
@@ -273,11 +273,11 @@
                 if (xsltPaths[i].startsWith("file:")) {
                     // TODO: Handle "file:" in SourceResolver
                     log.info("Scheme: file (" + xsltPaths[i] + ")");
-                    xsltHandlers[i] = tf.newTransformerHandler(new StreamSource(new java.io.FileInputStream(xsltPaths[i].substring(5))));
+                    xsltHandlers[i] = tf.newTransformerHandler(new StreamSource(new java.io.FileInputStream(xsltPaths[i].substring(5)), xsltPaths[i]));
                 } else if (schemeEndIndex >= 0) {
                     String scheme = xsltPath.substring(0, schemeEndIndex);
                     log.info("Scheme: " + scheme + " (" + xsltPath + ")");
-                    xsltHandlers[i] = tf.newTransformerHandler(uriResolver.resolve(xsltPath, null));
+                    xsltHandlers[i] = tf.newTransformerHandler(uriResolver.resolve(xsltPath, xsltPath));
                     /*XXX BACKWARD-COMPATIBILITY from now on we
                         throw new SourceException("No resolver could be loaded for scheme: " + scheme);
                     instead of simply only doing



More information about the Yanel-commits mailing list