Thanks Chriztian, adding the single quotes worked.
Although I think I could have avoided the hassle if I just tried what I intended to do in the first place. I was using that text string to check what I wanted to do was possible. But I intended to get the value of contentName from a macro parameter. When I actually did that, it worked fine.
Select child node with specific name
OK I'm stumped. I want to select a specific child node something like this
but make the selected node dynamic. This works
<xsl:value-of select="$settingsNode/descendant-or-self::*[name() = 'orangeBoxContent']" />
but if I try doing this
<xsl:value-of select="$settingsNode/descendant-or-self::*[name() = $contentName]" />
it doesn't even though $contentName is set to "orangeBoxContent". I feel like I'm so close but just don't know what I'm missing to get it to work.
btw this is a snippet of the xml structure
Hi suzyb,
When you set the contentName variable/param, remember to use single quotes:
Was that it?
Oh, and by the way - when it's a direct child, just use a slash to select it:
/Chriztian
Thanks Chriztian, adding the single quotes worked.
Although I think I could have avoided the hassle if I just tried what I intended to do in the first place. I was using that text string to check what I wanted to do was possible. But I intended to get the value of contentName from a macro parameter. When I actually did that, it worked fine.
is working on a reply...