Hello Adam,

My apologies for the lack of clarity. I was trying to use the value I have
calcualted for the $targetNode variable to select a node in my XML document.

If I had an xml source like the following, I would like to be able to
'dynamically' select nodes for processing.

...


The xslt template to do the processing:

<xsl:template name="createOptionList">
   <xsl:param name="parentNode" select="string()" />
   <xsl:param name="childNode" select="string()" />

<xsl:variable name="targetNode" select="concat(name($listNode),'/',$listItem)" />

   <xsl:for-each select="$targetNode" >
       ... do the processing ....
   </xsl:for-each>
</xsl:template>

if you know the path as exact as above (i.e. step by step) you can simply do something like


<xsl:for-each select="*[name() = $listNode]/*[name() = $listItem]">

For example if parameters parentNode = "foo" and childNode = "bar", then
$targetNode would evaluate to the string "foo/bar". I would want the 'for-each'
statement to select all the "bar" nodes under the "foo" parent node.

I think the only step I am missing is how to write a xpath node selection query
that can take a string parameter as its argument.

If you want to evaluate more complex XPathes and can't find a work around the are processor specific extension functions like http://xml.apache.org/xalan-j/extensionslib.html#evaluate or a bit more common http://www.exslt.org/dyn/functions/evaluate/index.html.


Regards,

Joerg


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to