Index: main/plugin-web/src/org/ametys/web/transformation/xslt/AmetysXSLTHelper.java
===================================================================
--- main/plugin-web/src/org/ametys/web/transformation/xslt/AmetysXSLTHelper.java	(revision 36854)
+++ main/plugin-web/src/org/ametys/web/transformation/xslt/AmetysXSLTHelper.java	(working copy)
@@ -17,6 +17,8 @@
 package org.ametys.web.transformation.xslt;
 
 import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
@@ -33,6 +35,7 @@
 import org.apache.cocoon.environment.Request;
 import org.apache.cocoon.environment.Response;
 import org.apache.cocoon.xml.dom.DOMBuilder;
+import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.excalibur.source.SourceResolver;
@@ -43,7 +46,7 @@
 import org.xml.sax.SAXException;
 
 import org.ametys.cms.repository.Content;
-import org.ametys.plugins.explorer.resources.Resource;
+import org.ametys.cms.transformation.ImageResolverHelper;
 import org.ametys.plugins.explorer.resources.ResourceCollection;
 import org.ametys.plugins.explorer.resources.dom.ResourceCollectionElement;
 import org.ametys.plugins.repository.AmetysObjectIterable;
@@ -51,6 +54,7 @@
 import org.ametys.plugins.repository.UnknownAmetysObjectException;
 import org.ametys.plugins.repository.metadata.CompositeMetadata;
 import org.ametys.plugins.repository.metadata.CompositeMetadata.MetadataType;
+import org.ametys.plugins.repository.metadata.Resource;
 import org.ametys.plugins.repository.metadata.UnknownMetadataException;
 import org.ametys.runtime.config.Config;
 import org.ametys.runtime.group.Group;
@@ -255,6 +259,18 @@
     }
     
     /**
+     * Computes the base 64 representation of the image at the specified path. <br>
+     * @param path the path of the image
+     * @return the base 64-encoded image
+     * @throws IOException if an error occurs while trying to get the file
+     */
+    public static String skinBase64 (String path) throws IOException
+    {
+        FileSource source = (FileSource) _sourceResolver.resolveURI("skin://resources/" + path);
+        return _getResourceBase64(source); 
+    }
+    
+    /**
      * Computes the URI for the given resource in the current site's skin.<br>
      * If the URI is requested by the front-office, it will be absolutized.
      * @param path the resource path.
@@ -320,6 +336,20 @@
     }
     
     /**
+     * Computes the base 64 representation of the image at the specified path in the given plugin.<br>
+     * @param plugin the plugin's name.
+     * @param path the resource path.
+     * @return the base 64 encoding for the given resource.
+     * @throws IOException if an error occurs when trying to get the file
+     * @throws MalformedURLException if the url is invalid
+     */
+    public static String pluginResourceBase64(String plugin, String path) throws MalformedURLException, IOException
+    {
+        FileSource source = (FileSource) _sourceResolver.resolveURI("plugin:" + plugin + "://resources/" + path);
+        return _getResourceBase64(source); 
+    }
+
+    /**
      * Computes the URI for the given resource in the given plugin.<br>
      * If the URI is requested by the front-office, it will be absolutized.
      * @param plugin the plugin name.
@@ -351,6 +381,34 @@
     }
     
     /**
+     * Get the base 64 encoding for the given source
+     * @param source the source 
+     * @return the base 64 encoding of the source
+     */
+    private static String _getResourceBase64(FileSource source)
+    {
+        if (source.exists())
+        {
+            InputStream dataIs = null;
+            try
+            {
+                dataIs = source.getInputStream();
+                return ImageResolverHelper.resolveImageAsBase64(dataIs, source.getMimeType(), 0, 0, 0, 0);
+            }
+            catch (Exception e)
+            {
+                throw new IllegalStateException(e);
+            }
+            finally
+            {
+                IOUtils.closeQuietly(dataIs);
+            }
+        }
+
+        return "";
+    }
+    
+    /**
      * Returns the current {@link RenderingContext}.
      * @return the current {@link RenderingContext}.
      */
@@ -588,7 +646,7 @@
      * This path is intended to be relative to the current skin's 'resources' directory.
      * @param path the path of the root {@link ResourceCollection}, relative to the current skin's 'resources' directory. Can be a file path to test its existance.
      * @return an Element containing files and folders. node name is 'collection' or 'resource' with an attribute 'name'. Return null if the path does not exits.
-     * @throws IOException if an error occured while listing files.
+     * @throws IOException if an error occurred while listing files.
      */
     public static Node skinResources(String path) throws IOException
     {
@@ -1053,7 +1111,7 @@
     /**
      * Return the front office user
      * @return The current connected user object or null
-     * @throws SAXException if a problem occured while getting the user
+     * @throws SAXException if a problem occurred while getting the user
      */
     public static Node user() throws SAXException
     {
