Re: [xsl] Using saxon:assign and testing content of variable

Subject: Re: [xsl] Using saxon:assign and testing content of variable
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 20 Sep 2005 22:43:35 +0100
> First what is the proper way to reset the variable to be empty and 
> hopefully no nodes in the node-set? Does a simple <saxon:assign 
> name="pageNumber"/> do it?

ther's no "proper" way to reset a variable in a functional
language saxon:assign really cuts across the whole declarative language
paradigm and really once you use something like that you aren't really
using XSLT at all.

However I don't understand your comment

> What I'm at a loss for is the proper test in the <choice> to see if there 
> is content in $pageNumber.

You don't need to test this you know exactly the content of the variable
                               <fo:leader leader-pattern="dots" 
leader-length="1in" />
                               <fo:basic-link 
internal-destination="{generate-id()}">
                                     <fo:page-number-citation 
ref-id="{generate-id()}" />
                                </fo:basic-link>

so it is a result tree fragment corresponding to those elements.

I can't really tell from the small fragment that you posted but I
suspect that you are trying to get XSLT to process page numbers and
other values calculated by an FO engine. That never works,the XSLT
process does not know _anything_ about XSLFO and XSLFO does not know
_anything_ about XSLT. As far as the xslt is concerned there is nothing
special about  <fo:page-number-citation>  it could just as well be
<jhgifgi> it's just an element node in a result tree. XSLT has to
construct the entire FO document to be processed and teh XSLT
transformation finishes before the FO engine starts.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread