On Mon, 8 Jul 2002, Nigel Peck wrote:
> I seem to have a problem with XSP, when I open the following
>
> <xsp:page language="Perl" xmlns:xsp="http://apache.org/xsp/core/v1">
> <xsp:expr>scalar localtime</xsp:expr>
> </xsp:page>
This is perhaps the most confusing part of XSP.
In XSP there are two "sections" to the page.
1. The global "stuff"
2. The local "stuff"
Global stuff is executed ONCE per httpd child process. At the time the
page is compiled (i.e. every time it changes). Global stuff NEVER
contributes to the output.
Local stuff is executed on every hit. The local stuff is the only part
that contributes to the output.
Now by default, stuff is global. You need to actually start a non-XSP tag
to make it local. So your example above has to change to:
<xsp:page ...>
<page>
<xsp:expr>scalar localtime</xsp:expr>
</page>
</xsp:page>
Now, this is sometimes seen as a bit of a pain. What if you don't have
global stuff? Well you can do that by ommitting the outer <xsp:page> tag,
but make sure you include your xsp namespaces:
<page xmlns:xsp="http://apache.org/xsp/core/v1">
<xsp:expr>scalar localtime</xsp:expr>
</page>
Hope that helps.
--
<!-- Matt -->
<:->Get a smart net</:->
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]