Hi Joe and Michael,
Thanks for your suggestions. The idea 2 suggested by
Joe worked for me. Now I'm wondering about the easier
idea 1 you've talked about where I can search for the
desired node by an attribute instead of the name of
the node itself (provided ofcourse I change my config
file for that). Can you guide me on that?
Date: Fri, 24 Mar 2006 15:21:57 -0000
From: "Joe Fawcett" <joefawcett(_at_)hotmail(_dot_)com>
Subject: Re: [xsl] Using a variable as the xml node -
----- Original Message -----
From: "bharathi kongara" <bharathikongara(_at_)yahoo(_dot_)com>
Sent: Friday, March 24, 2006 2:58 PM
Subject: [xsl] Using a variable as the xml node -
ignore my previous
I've been playing with this problem from yesterday,
tried all sort of solutions, but no use.
Here is the problem:
In my xsl, I'm referring to a configuration file
is an xml file.
and the xsl file is:
key1 refers to the 1000 in the name of the config
key2 refers to the 100 or 200 ... in the nodes in
They will come from a stored procedue.
Now my problem is, I've to refer to the 100 node or
200 node etc which depends on the key2.
I'm doing this - define a vraible for refrerring to
the node based on key2.
When I'm referring to the "loc" variable in the xsl
later as $loc, it is putting in the string
"$Config/ConfigFile/100Code" instead of substituting
the value "Hundred" from that node. But it works
I directly use the $Config/ConfigFile/100Code
Any ideas? Any help is greatly appreciated.
Thanks in Advance,
Idea 1, change your XML, it is much easier to handle
<Code key="00">Two Hundred</Code>
If you must stick with what you have then you need to
use XPath like
following which are not very elegant:
<xsl:variable name="key2" select="path to key2 goes
$Config/ConfigFile/*[name() = $key2]
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>