[xsl] saxon:assign and xsl:result-document

Subject: [xsl] saxon:assign and xsl:result-document
From: "Richard Lewis" <richardlewis@xxxxxxxxxxxxxx>
Date: Fri, 28 Jan 2005 11:19:39 +0000
Hello XSL list,

I'm doing some transformations with Saxon (8.2B) from XML to SVG.

My stylesheets produce two output documents: one is a small HTML file
which includes a link to the (rendered) SVG and the SVG result (which is
the bulk) is generated through a named template and the
xsl:result-document element.

Because my SVG file includes quite a bit of variable text (i.e. the text
layout is dependent of the quantity of text) and because SVG has no
automatic 'wrapping' facility, I'm trying to use a global variable
called 'currentY' to keep track of the current position in the Y axis
while the SVG is being produced.

I'm using the saxon:assign instruction to alter the currentY variable as
necessary but it doesn't seem to be working: the <saxon:assign
name="currentY" select="$currentY+20" /> 'element' just appears in the
resultant SVG file but the variable is not altered.

I've got this:
<xsl:stylesheet xmlns:xsl="..." xmlns:saxon="http://saxon.sf.net";
version="2.0">
<xsl:output name="svg" method="xml" doctype-public="..."
doctype-system="..." />
<xsl:variable name="currentY" select="0" saxon:assignable="yes" />
....
<xsl:template name="generate-svg">
<xsl:result-document href="...svg" format="svg">
<svg x=".." ... extension-element-prefixes="saxon">
....
<saxon:assign name="currentY" select="$currentY+20" />
....

Any ideas what might be wrong?

Cheers,
Richard
-- 
  Richard Lewis
  richardlewis@xxxxxxxxxxxxxx

Current Thread