In the XSLT processor, evaluating a variable
(TXpXslBaseVar) without a select attribute is done by
creating a result tree fragment ("RTF") and
re-directing output to a temporary XML filter.
However, if you try to use that variable later on, you
find that it has become corrupted. (This only appears
as a problem if the variable includes attributes.
Elements seem to be OK.)
The cause of this is that the temporary XML filter
containing the RTF is freed within the Evaluate procedure.
Work-round is to declare the XML filter as a property
of TXpXslBaseVar, and only free it when this object is
destroyed. Unfortunately, it has to be declared as
TCustomControl and then type-cast - otherwise you get
circular unit references.
Logged In: YES
user_id=966026
Originator: YES
25.4.2007: had to undo this change, since it causes problems when a variable is evaluated by recursively calling a template which defines the same variable and uses <xsl:value-of select="$varname"/> to "return" it to the calling routine. On reflection, Evaluate is called each time you need to know the value of a variable, so it shouldn't matter that it is calculated afresh each time this happens. Maybe the actual problem lies elsewhere.