Hi Tony,

> ><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>
> >
> >        
> >Any advice, greatly appreciated.
> >  
> >
> 
> 
> 
> Adam,
> 
> I'm not too sure what you're trying to do. Are you trying to create an 
> element named with the value of $targetNode? Or are you trying to apply 
> your templates to the nodes named in the value of $targetNode?
> 
> If all you're trying to do is create a new named $targetNode, all you'd 
> have to do is:
> 
>  <xsl:element name="$targetNode"">foo</xsl:element>
> 
> So, again, I'm not to sure what you're trying to accomplish.. perhaps an 
> xslt list can help.
> 
> Tony
> 

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.

<root>
   <foo>
      <bar />
      <bar />
      <bar />
   </foo>

   <dog>
      <eatcat />
      <eatcat />
      <eatcat />
   </dog>
</root>


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>

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.


Thanks for your time Tony.


Ad.


=====
Adam Flegman - Senior Software Engineer

Mobile:     (0414) 375 735
Phone:     (07) 5547 8530
Facsimile: (07) 5547 8532
Email #1: [EMAIL PROTECTED] 
Email #2: [EMAIL PROTECTED]

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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

Reply via email to