I would like to change the XPath Expression to point the language that is in curLanguage. I tried select="priority-key[level=$curPrio]/$curLanguage" select="priority-key[level=$curPrio]/{$curLanguage}" select="priority-key[level=$curPrio]/'{$curLanguage}'"
but without success. How does the correct XPath look like? ;-) stw
ps: Disabled smiles. - m [ June 29, 2004: Message edited by: Madhav Lakkapragada ]
Hi Nimchi, thx for taking the time to reply. From your reply I see, that I didn't phrase my question clearly. The xpath actually does work well. What I want to achieve is to replace English by the content that is in $curLanguage. This is a very fundamental problem for me: how to construct an xPath expression where the name of a node is a variable. I tried to poke around with the name() function but no luck. The w3school tutorials didn't answer this question too (or I missed it). ;-) stw
Porky Liu
Greenhorn
Joined: Jan 30, 2002
Posts: 22
posted
0
maybe you can get all the element under priority-key, and then get the correct element with xsl:if test current() = $whatever, just like this
It's not easy, but I do think it can work
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Hi Porky Liu,
thx for your reply. I did a little reevaluating of XLST concepts. You actually can't compare a node to a string. So the solution is to look for something that is a string inside the node. The riddle is solved when you use the name() function. to the answer is:
;-) stw [ July 07, 2004: Message edited by: Stephan H. Wissel ]
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.