cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@socialchange.net.au
Subject RE: Cocoon
Date Sat, 06 Jan 2001 13:33:39 GMT


> Hi,
> 
> this is my code to get the .xml file's lastModified date.

Everything ends in .xml ;)

Is this your calling XSP page, or a taglib? It looks like a taglib.

> [---------------------
>   <xsl:template match="document/spec">
>     <spec>
>       <document-filename><xsl:value-of
> select="$filename"/></document-filename>
>       <xsp:logic>
>         String _u = new String(<request:get-request-uri/>);
>         <xsp:content>
>           <last-modified>
>             <xsp:expr>(new Date((new
> File(_u)).lastModified())).toString()</xsp:expr></last-modified>
>         </xsp:content>
>       </xsp:logic>
>       <xsl:apply-templates/>
>     </spec>
>   </xsl:template>
> ---------------------]
> 
> this doesn't work for <request:get-request-uri/>,
> because it is only the request path and the File object
> need the absolute path or a right working relative one.
> 
> If I use <xsl:value-of select="$filename"/> instead,
> the File object would get the absolute path.
> But unfortunatly, I am using here Win2k and the path
> seperator is the '\\' and not '/'.
> My example $filename looks like C:\Eigene Dateien\projects\eko\htdocs\gb.xml
> and as you can see there're alot of '\\'. But Java
> thinks that this is a format character ('\E', '\p', '\e', '\h', '\g')

Something like this might help:
<xsl:value-of select="translate($filename,'\','/')"/>

Mime
View raw message