ricardo 00/01/06 15:32:43
Modified: src/org/apache/cocoon/processor/xsp/library/java util.xsl
Log:
1.3:Added <util:get-file-contents>
Revision Changes Path
1.3 +27 -0 xml-cocoon/src/org/apache/cocoon/processor/xsp/library/java/util.xsl
Index: util.xsl
===================================================================
RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/processor/xsp/library/java/util.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- util.xsl 2000/01/06 17:56:45 1.2
+++ util.xsl 2000/01/06 23:32:43 1.3
@@ -88,6 +88,33 @@
} </xsp:logic>
</xsl:template>
+ <!-- Include file contents as text -->
+ <xsl:template match="util:get-file-contents">
+ <!-- Retrieve "filename" parameter as either attribute or element -->
+ <xsl:variable name="filename">
+ <xsl:choose>
+ <!-- As attribute (String constant) -->
+ <xsl:when test="@filename">"<xsl:value-of select="@filename"/>"</xsl:when>
+ <!-- As nested (presumably dynamic) element -->
+ <xsl:when test="util:filename">
+ <!-- Recursively evaluate nested expression -->
+ <xsl:call-template name="get-nested-content">
+ <xsl:with-param name="content" select="util:filename"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsp:expr>
+ XSPUtil.getFileContents(
+ XSPUtil.relativeFilename(
+ String.valueOf(<xsl:copy-of select="$filename"/>),
+ request
+ )
+ )
+ </xsp:expr>
+ </xsl:template>
+
<xsl:template match="util:counter">
<xsl:choose>
<xsl:when test="@scope = 'session'">
|