XSL page update URL changer?

R

RigasMinho

Hello,
I have an issue where i have a link in a web page using XSL - for
example says its
<a href="http://www.test.com/&testme=03/27/2007"
target="_blank">Test</
a>

notice the date is engrained into the url -


now say i have the web page load up tomorrow i want the web page url
to be
<a href="http://www.test.com/&testme=03/28/2007"
target="_blank">Test</
a>


and change the url in the xsl format / html format to change
dynamically as the web page loads up.


Is this even possible in XSL?
 
J

Joseph Kesselman

RigasMinho said:
and change the url in the xsl format / html format to change
dynamically as the web page loads up.

There's nothing built into XSLT 1.0 which will return today's date.
You'd need to use the EXSLT date function, *IF* your processor supports
that set of "standardized nonstandard extensions". Or pass the date in
from outside as a stylesheet parameter.

(Date functions have been added to XSLT 2.0, but I presume you don't
want to rely on a 2.0 processor being available.)

Personal question: The server should know today's date. Why are you
trying to pass the date to the server?
 
R

RigasMinho

There's nothing built into XSLT 1.0 which will return today's date.
You'd need to use the EXSLT date function, *IF* your processor supports
that set of "standardized nonstandard extensions". Or pass the date in
from outside as a stylesheet parameter.

(Date functions have been added to XSLT 2.0, but I presume you don't
want to rely on a 2.0 processor being available.)

Personal question: The server should know today's date. Why are you
trying to pass the date to the server?

Cause the company i work for is asking for something ridiculously
stupid
They want it to make it easier on the user to just click on a link
where the date is engraiined automatically into the link

So basically if i want to do anything i would rely on XSLT 2.0 -
interesting

I mean all they want technically is the user to click on a link that
is changed as the web page loads up. I've never even heard about this
on any web page before -
 
J

Joseph Kesselman

RigasMinho said:
I mean all they want technically is the user to click on a link that
is changed as the web page loads up. I've never even heard about this
on any web page before -

Make the change in the server before you send the page out. Or have the
server consult its own time and date information when it gets the
response back. XSLT is good for many things, but this is not one where
it's the best answer.
 
S

Simon Brooke

Cause the company i work for is asking for something ridiculously
stupid
They want it to make it easier on the user to just click on a link
where the date is engraiined automatically into the link

So basically if i want to do anything i would rely on XSLT 2.0 -
interesting

I mean all they want technically is the user to click on a link that
is changed as the web page loads up. I've never even heard about this
on any web page before -

Have the URL point to a directory on the server. In that directory, have
files which are named by date (e.g., '20070328.html'). Have a cron job
which, early each morning, deletes the old index.html symbolic link if
present and creates a new 'index.html' symbolic link to today's file. Then
clicking on the link will always get you today's file.

Or, of course, have some more sophisticated dynamic content engine, but
what I've suggested above can be implemented in half a dozen lines of
shell script.

--
(e-mail address removed) (Simon Brooke) http://www.jasmine.org.uk/~simon/
Das Internet is nicht fuer gefingerclicken und giffengrabben... Ist
nicht fuer gewerken bei das dumpkopfen. Das mausklicken sichtseeren
keepen das bandwit-spewin hans in das pockets muss; relaxen und
watchen das cursorblinken. -- quoted from the jargon file
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top