|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: declaring global variable in XSL!
On Tuesday, August 21, 2001 5:58 AM Tim Watts wrote: > Also, I think I remember somone saying recently that you cannot declare a > *global* variable based on a condition. Sorry, that was me in mode="wrong-end-of stick", drawing an incorrect conclusion from the correct premiss that the XSLT content model doesn't allow <xsl:if> or <xsl:choose> at the top level of the sheet, where global assignments need to be made. In a follow-up, Oleg drew my attention to the extremely rich content model of <xsl:variable> and pointed out that the way to achieve conditional initialisation of a global was to generate an RTF by using <xsl:choose> within the content of a <xsl:variable> at top level. As a result I think I now understand why and how the two possible methods of initialising a variable are significantly different. Other responses off-list confirmed that the technique I had figured out myself was OK for my particular case, namely using the union operator on two node sets, where one set will always be empty if the condition that interested me is true. But that's much less general than the RTF approach. Michael --------------------------------------------------------- Michael Beddow http://www.mbeddow.net/ XML and the Humanities page: http://xml.lexilog.org.uk/ --------------------------------------------------------- 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








