Greg,
I think you are hitting some caching issue: the result of the transformation is cached, and not reloaded. Of course this is not what you would like to happen.
In general, XSLT transformations are side-effect-free, which means that for a set of given inputs, and a given stylesheet, the output will always be the same. This changes when you introduce a function such as random() or current-dateTime().
Ideally, I think you would want a generic mechanism to tell that the output of a processor must never be cached. Right now there is no such mechanism. So you need a way of making sure the stylesheet is read. I can see a few workarounds:
1. Put a debug attribute on the data output of the stylesheet. For this, you have to actually use an XPL file for the view, and call your stylesheet from there. The drawback: you output debug information!
2. Making sure the input of the view is not static. For example, if it reads something from the SQL processor, its output will never be cached. Drawback: doesn't work if you don't use something like the SQL processor!
3. The XSLT transformer checks on the document() function, and doesn't cache if there are dynamic document references. So try in your view to put something like this:
<xsl:variable name="nocache1" select="''"/> <xsl:variable name="nocache2" select="document($nocache1)"/>
-Erik
Gregory Blajian wrote:
Does anyone know what aspects of the view are evaluated every time the page is invoked? I am trying to use the following as my “view” element in the page flow:
<xsl:if test="true()">
<xsl:variable name="myRandNum" select="math:random()" xmlns:math="java:java.lang.Math"/>
<xsl:variable name="myDate">
<xsl:value-of select="current-dateTime()"/>
</xsl:variable>
<xhtml:input type="hidden" id="gen_rand_num" value="{$myRandNum}_{$myDate}"/>
</xsl:if>
It works, but it only seems to be evaluated once every so many hours instead of every time the page is called/invoked. That is, the random number and date are generated then every subsequent call to the page gives the same random number and date. Obviously, this isn’t what I want to happen, I would prefer it generate a new random number and the current time every time the page is visited/called/invoked/refreshed. Any ideas?
Greg
------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_idU88&alloc_id065&op=click _______________________________________________ orbeon-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/orbeon-user
