Altova Mailing List Archives


Re: [xsl] current-dateTime()

From: Michael Ludwig <mlu@------------->
To:
Date: 4/18/2008 2:47:00 PM
Robert Koberg schrieb:
You could make a call with the document function (in a non-functional
way :) ) to a back end that uses a custom uri resolver that, when
receives a certain href, logs/writes the /real/ current-dateTime and
returns <nothing/>.

That would probably not work. I tested this the other day, just out of
curiosity, calling a script that incremented a number, and found that
the result was cached when using LibXSLT, Saxon and Xalan.

mludwig@forelle:~/Werkstatt/xsl > expand -t2 ~/www/xml.php
<?php
$fnam = 'xml.php.dat';
if (file_exists($fnam)) {
  $i = file_get_contents($fnam);
  file_put_contents($fnam, $i + 1);
}
else {
  $i = 0;
  file_put_contents($fnam, $i);
}
echo "<Int>$i</Int>\n";

mludwig@forelle:~/Werkstatt/xsl > expand -t2 document-function-en.xsl

<?xml version="1.0" encoding="UTF-8"?>

<xsl:transform version="1.0"

  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output indent="yes"/>

  <xsl:variable name="url" select="'http://localhost/mlu/xml.php'"/>

  <xsl:template match="/">

    <Urmel>

      <Prozessor>

        <xsl:value-of select="system-property('xsl:vendor')"/>

      </Prozessor>

      <Frage> Is the result of the call to document() cached? </Frage>

      <xsl:copy-of select="document($url)"/>

      <xsl:copy-of select="document($url)"/>

      <xsl:copy-of select="document($url)"/>

      <Antwort> Yes, it is. LibXSLT, Xalan and Saxon cache the 
result.</Antwort>

    </Urmel>

  </xsl:template>

</xsl:transform>



mludwig@forelle:~/Werkstatt/xsl > xsltproc document-function-en.xsl 
urmel.xml

<?xml version="1.0"?>

<Urmel>

  <Prozessor>libxslt</Prozessor>

  <Frage> Is the result of the call to document() cached? </Frage>

  <Int>52</Int>

  <Int>52</Int>

  <Int>52</Int>

  <Antwort> Yes, it is. LibXSLT, Xalan and Saxon cache the 
result.</Antwort>

</Urmel>



Michael

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.