You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Roytman, Alex" <ro...@peacetech.com> on 2000/08/24 02:40:05 UTC
Stylesheet level variables - SourceTree is not accessible
Hello,
I am having some problems with global variables referencing source tree
nodes.
I define a global variable $council to store external XML from
http://localhost/myservlet?council-id=<value> URL
<xsl:variable name="council"
select="document(concat('http://localhost/myservlet?council-id=',
/xsum/@council-id)/councils/council[1]"/>
/xsum/@council-id in concat() returns empty result and of course the
document() call fails because of invalid URL
(all works fine when I define this variable inside of <xsl:template>)
I noticed that the URL gets loaded twice - once for variable definition
(fails) and second time when I use $council variable (succeeds)
Am I right that Source tree is not available on stylesheet level and global
variables are calculated later when referenced first time?
If NOT, why /xsum/@council-id returns blank when used for stylesheet level
variables?
If YES, why value for $council variable gets calculated on variable
definition?
Or may be I missed something very simple?
Thank you in advance
Alex