Project

Profile

Help

dynamically refer to elements

Added by Anonymous over 19 years ago

Legacy ID: #2865948 Legacy Poster: Jim Neff (neffland_2000)

First off, I'm sorry if this is the wrong place to put this question. I'm new to XSLT and I am also an idiot, so I have two strikes against me already ... I need to dynamically refer to an element. For example: <xsl:value-of select="$other_context/{content}"/> Where content is the name of an element in the current context. I want to dynamically access an element in the variable $other_context, which i have passed into this template by using the element <xsl:with-param name="other_context" select="."/> from the calling apply-template element. I fully expected the {content} to work but when I run it through saxon I get Unexpected token "{" in path expression Can someone please direct me to how I am supposed to do this? Thank you, Jim Neff


Replies (1)

RE: dynamically refer to elements - Added by Anonymous over 19 years ago

Legacy ID: #2866582 Legacy Poster: Michael Kay (mhkay)

XSLT coding questions are best asked on the xsl-list at mulberrytech.com. The coding idiom you are looking for is select="*[name()=$param]" Michael Kay

    (1-1/1)

    Please register to reply