Added ability for XSLT to be aware of current date.

svn path=/trunk/; revision=3381
This commit is contained in:
jonas 2003-03-09 21:41:53 +00:00
parent 37bcaba6c4
commit 62b751fcfe
2 changed files with 8 additions and 45 deletions

View File

@ -1,45 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<title>Free Software Foundation Europe - Sweden</title>
</head>
<body>
<div> <!-- The header will be inserted here -->
<!-- Begin page content -->
<center>
<h1>FSF Europe - Sweden</h1>
</center>
<p>
Welcome to the home page of the Swedish part of the
<a href="{$fsfeurope}">Free Software Foundation Europe</a>.
</p>
<h3>News</h3>
<p>
</p>
<!-- End page content -->
</div> <!-- The footer will be inserted here -->
Last update:
<!-- timestamp start -->
$Date$ $Author$
<!-- timestamp end -->
</body>
</html>
<!--
Local Variables: ***
mode: xml ***
End: ***
-->

View File

@ -26,6 +26,7 @@ use File::Basename;
use XML::LibXSLT;
use XML::LibXML;
use File::Copy;
use POSIX qw(strftime);
# This defines the focuses and their respective preferred / original
# language. For example, it says that we should have a focus called
@ -57,6 +58,8 @@ our %languages = (
sv => 'Svenska',
);
our $current_date = strftime "%Y-%m-%d", localtime;
#
# Parse the command line options. We need two; where to put the finished
# pages and what to use as base for the input.
@ -164,6 +167,11 @@ while (my ($file, $langs) = each %bases) {
my $root = $dom->createElement("buildinfo");
$dom->setDocumentElement($root);
#
# Set the current date, to use for comparision in the XSLT.
#
$root->setAttribute("date", $current_date);
#
# Find original language. It's en, unless we're in the country specific
# se/, fr/, de/ and so on, directories.