You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Robert A. Lentz" <ra...@erols.com> on 2000/09/15 02:45:25 UTC
document() causing variables to be hidden?
Greetings,
Still quite new at this, so forgive me if I am misunderstanding...
I guess I understand why a node tree imported via document() would not be
able to see the tree into which it was imported, though I do not really
understand why.
But, I find it very odd that variables/parameters seem to get hidden, by
the document() function.
For an example, please see the attached files:
style_bug.xml - style sheet
bug_test.xml - source document
navigation-bug.xml - included document
(using version j1.2_D2, and sun's Java 1.3)
thank you,
-Robert
--
ralentz@erols.com
"It has been said that man is a rational animal. All my life
I have been searching for evidence which could support this."
-- Bertrand Russell
Xalan mailinglist archive
Posted by Eugen Kimmerstorfer <eu...@jk.uni-linz.ac.at>.
Hi!
When I try to access the mailinglist archive at
http://archive.covalent.net/xml/xalan-dev/2000/09/
I get an "Internal Server Error". Is the archive
down?
Thank you!
Eugen K.
Re: document() causing variables to be hidden?
Posted by Gary L Peskin <ga...@firstech.com>.
"Robert A. Lentz" wrote:
> I guess I understand why a node tree imported via document() would not be
> able to see the tree into which it was imported, though I do not really
> understand why.
>
> But, I find it very odd that variables/parameters seem to get hidden, by
> the document() function.
>
> For an example, please see the attached files:
Robert --
I'm not sure what your first statement means -- maybe you could give an
example to illustrate. Also, I'm not sure what you mean about
variables/parameters getting "hidden" by the document function.
However, maybe this will help.
When your xsl:apply-templates select="document($nav)/toc" mode="site"
gets executed, the XSLT processor will look for a template matching the
<toc> element. You haven't supplied such a template so a built-in
template gets invoked. The built-in template doesn't have an xsl:param
for your area parameter so that parameter is not used by the built-in
template.
The built-in template for an element simply does an xsl:apply-templates
on the child nodes of that element. So, in your case, it will invoke
the children of the <toc> element. There is one child, <nav-area>, so
the apply-templates process will look for a template matching nav-area
with mode="site". You have such a template and you have an xsl:param in
that template. However, since you are invoked by the built-in template,
no parameters will be passed to the nav-area template.
If you want to pass the parameter, change your XPath select expression
to document($nav)/toc/nav-area.
HTH,
Gary