|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Variable confusion
Hi,
First post to this list so please be kind!
I have a stylesheet with a global variable, the value of which is taken from
the input source.
It seems the first time I run a transform the variable is set correctly but
on subsequent transforms it is not and it retains it's first value.
The stylesheet starts like this...
<?xml version="1.0"?>
<!DOCTYPE storpres [<!ENTITY pound "£"><!ENTITY space " ">]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" encoding="UTF-8"/>
<xsl:variable name="pageNum" select="/storpres/est/general/trans-page"/>
<xsl:variable name="transactions-per-page">20</xsl:variable>
...
The first time I perform a transform the /storpres/est/general/trans-page is
1 and this is what is in $pageNum
The second time I run the transform the input xml is changed so
/storpres/est/general/trans-page is 2 but $pageNum is still 1?
to prove it, later in the stylesheet I have...
alert('pageNum='+<xsl:value-of select="$pageNum"/>+
' trans-page='+<xsl:value-of
select="storpres/est/general/trans-page"/>);
This tells me pageNum=1 but trans-page=2.
I understand xsl:variable is immutable within the stylesheet but not why I
can't change its value for subsequent transforms.
Has anyone any ideas why this is happening?
---
regards
Tim Tompkins
Legal Disclaimer:-
Internet communications are not secure and therefore the
Barclays Group does not accept legal responsibility for the
contents of this message. Although the Barclays Group
operates anti-virus programmes, it does not accept
responsibility for any damage whatsoever that is caused
by viruses being passed. Any views or opinions presented
are solely those of the author and do not necessarily
represent those of the Barclays Group.
Replies to this e-mail may be monitored by the Barclays
Group for operational or business reasons.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








