xsl-list
[Top] [All Lists]

Re: combining two variables to generate XPATH

2002-12-17 22:36:43
"Robert Koberg" <rob(_at_)koberg(_dot_)com> wrote in message
news:ADECJLDNBFNBOJBLKCMOKEFPDMAA(_dot_)rob(_at_)koberg(_dot_)com(_dot_)(_dot_)(_dot_)
Hi bix,

I think everyone is getting caught up in your explicit question :)
and not
understanding what you want, or perhaps I am missing something...

Based on previous examples:
concat($node,'/',$type,'/item') -- assuming $type is the name of an
element
select="'someBranch'" -- assuming 'someBranch' is the name of an
element

this is very simple to solve in XSLT 1.0, as I posted earlier:

<xsl:template name="foo">
  <xsl:param name="node"/>
  <xsl:param name="branch" select="'someBranch'"/>
  <xsl:for-each select="$node/*[name()=$branch]/leaf">
    <xsl:value-of select="@id" />
  </xsl:for-each>
</xsl:template>

best,
-Rob

This is what I advised him to do in one of the newsgroups about a week
ago. But obviously this person has some other requirements.

How long will need 1000 people to guess?

From my empirical observations more than 50% of the messages and time
taken goes in clarifying the formulation of a problem -- some never get
explained well.




=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list