]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/on-line/xslt/resolve_topurl.xsl
Many modifications to avoid JavaScript security rules of
[helm.git] / helm / on-line / xslt / resolve_topurl.xsl
diff --git a/helm/on-line/xslt/resolve_topurl.xsl b/helm/on-line/xslt/resolve_topurl.xsl
new file mode 100644 (file)
index 0000000..fbd9d44
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                              xmlns:subst="http://www.cs.unibo.it/helm/subst">
+
+<xsl:output
+           method="html" 
+           encoding="ISO-8859-1" 
+           media-type="text/html" />
+
+<xsl:param name="topurl" select="''"/>
+
+<xsl:template match="subst:script">
+ <script language="{@language}" src="{concat($topurl,@src)}"></script>
+</xsl:template>
+
+<xsl:template match="subst:topurl">
+ <xsl:value-of select="$topurl"/>
+</xsl:template>
+
+<xsl:template match="/|*">
+ <xsl:copy>
+  <xsl:copy-of select="@*"/>
+  <xsl:apply-templates/>
+ </xsl:copy>
+</xsl:template>
+
+</xsl:stylesheet>