This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: time from server to document


excellant, not enough people post back their solutions after picking
brains.....

----- Original Message -----
From: "Jarkko Moilanen" <Jarkko.Moilanen@uta.fi>


> Hi!
>
> Our solution to time and date prob is:
> (Xalan C and linux)
>
> 1. Use parameters in Xalan
>
> #!/bin/sh
> #  This script is done for bash unix shell, but can be translated
> #  easily for other skripting languages too
> #
> #
> #Path to Xalan executable
> XALAN="/usr/local/xml-xalan/c/bin/Xalan"
> #
> #
> # Used file
> #
> FILE=$QUERY_STRING
> #
> #
> #All used paths
> XMLFILE="/var/www/xslt/$FILE.xml"
> XSLFILE="/var/www/xslt/$FILE.xsl"
> OUTFILE="/var/www/xslt/xmlout/$FILE.xml"
> #
> #
> #Parameters to Xalan
> #
> #
> DATE="`date +"%d/%m/%Y %T"`"       #Day and time
> TEST="hipsu!"
>    #Another param
> #
>
> #
> # Do the processing
> #
> $XALAN -p date1 "'$DATE'" -p hipsu "'$TEST'" -o $OUTFILE $XMLFILE $XSLFILE
> #
> #
> # Lets print it all out
> #
> echo "Content-type: text/xml"
> echo ""
> cat $OUTFILE
> #
> #EOF
>
>
>
> 2. In the xsl file:
>
> <xsl:output method="xml" indent="yes" standalone="no" />
>
> HERE WE DECLARE THE PARAMETER. PARAM NEEDS TO BE OUTSIDE TEMPLATE MATCH.
>
>   <xsl:param name="date1" select="'$date1'"/>
>   DONT KNOW IS IT NECESSARY TO SELECT IT HERE???!!!

no u could just do <xsl:param name="date1"/>

though i have experienced in some earlier XSLT processors some different
behavior.


cheers, jim fuller


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]