On 9/18/06, <b class="gmail_sendername">Robert Hart</b> <<a href="mailto:Robert.Hart@burohappold.com">Robert.Hart@burohappold.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>> Try moving it all inside the first template:<br>><br>> <xsl:template match="/rules"><br>> <!-- put it here --><br>> </xsl:template><br><br>This was the first thing I tried. Unfortunately it then fails later when the
<br>variables are used for something else... would appear they only have scope<br>within the node they're defined in.... stupid.</blockquote><div><br>Ah yes. Variables defined at the top level have global scope, so putting them inside the main template restricts their scope to just that template. Duh.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> Alternatively invert it. So that you have:<br>><br>> <xsl:variable ...>
<br>> <xsl:choose><br>> ...<br>> </xsl:variable><br>><br>> although this means that the conditions will be repeated for each of<br>bllat, bllon, trlat,<br>> trlon which is ugly.<br><br><br>Will give this a try later.
</blockquote><div><br>I hope this works for you..<br> <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Rob<br><br><br><br>This message has been scanned for viruses by MailControl -
<a href="http://www.mailcontrol.com">www.mailcontrol.com</a><br></blockquote></div><br>