At first sight I'm not seeing a significant difference between the
performance of the pull and push versions of the stylesheet. What
figures are you seeing, and how are you obtaining them?
On 24/06/2012 09:24, David Rudel wrote:
I wrote up a simple test script that uses discard-document() and
keys in a way similar to how I use them in my work.
This example is just meant to test the passing of the nodes into
the child templates. In my actual script the work done in the
parent template is more substantial.
I've attached sample source/ancillary files if you want to see
their structure. The attached source (activities.xml) only has one
<teacher>, but in the equivalent file in my script might
have hundreds, each with her own separate gradebook file.
The basic idea behind this fake test is that a group of teachers
gives different activities (drill versus reading) on the first 90
days of the year. Some days giving one, some the other, some both
(in either order). The teacher also keeps a gradebook that tracks
what each student's gradeband is on various dates. The script
below works through the activities of each teacher and, for each
student, indicates what gradeband the student was next assessed as
being in. It also converts "pages read" into minutes for those
cases where the activity was reading.
In my actual use case, I might call 1000 teachers, each teacher
with her own "gradebook" file that I need to use when evaluating
students from that teacher. The the file is discarded when I move
on to the next teacher.
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xs xdt udf saxon math fn err exsl
<xsl:key name="gradeKey" match="students/student/change"
On Sun, Jun 24, 2012 at 1:03 AM, Michael
It's very difficult to be definitive about the effect this
> Just to be clear, I only had one saxon:discard-document
call in the
> program. As described in my previous email, I created a
> <xsl:variable name="ïnfo"
> and then I used the variable $info in various places.
when we can only see tiny fragments of your code. (It's not
if this variable is local or global...)
Just to explain what discard-document() does:
Saxon maintains (owned by the Transformer/Controller) a table
document URIs to document nodes. When you call the document()
Saxon looks to see if the URI is in this table, and if it is,
the corresponding document node. If it isn't, it reads and
resource found at that URI. The effect of
saxon:discard-document() is to
remove the entry for a document from this mapping table. (Of
a document is referenced from this table then the garbage
hold the document in memory; if it is not referenced from the
it becomes eligible for garbage collection. It won't be
collected if it's referenced from a global variable; but it
be absent from the table in the event that another call on
uses the same URI again.)
"A false conclusion, once arrived at and widely accepted is not
dislodged easily, and the less it is understood, the more
tenaciously it is held." - Cantor's Law of Preservation of
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
saxon-help mailing list archived at http://saxon.markmail.org/