This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: how to walk nodes


<xsl:for-each select="ancestor::component/@name">
  <xsl:value-of select="."/>
  <xsl:if test="position()!=last()">/</xsl:if>
</xsl:for-each>

Mike Kay

> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of 
> Dmitri Ilyin
> Sent: 13 September 2001 16:32
> To: XSL-List@lists. mulberrytech. com (E-mail)
> Subject: [xsl] how to walk nodes
> 
> 
> Hi *,
> 
> I'd like to build a template that gives me "path" of parent nodes
> for example:
> 
> XML
> <components>
>   <component name="comp1">
>     <some_node1>
>       <component name="comp2">
>       </component>
>     </some_node1>
>     <some_node2>
>       <some_node3>
>         <component name="comp3">
>           <some_node>
>         </component>
>       </some_node3>
>     </some_node2>
>   </component>
> </components>
> 
> XSL
> <xsl:template match="some_node">
>   hier walk through parent nodes
> </xsl:template>
> 
> output:
> 
> "comp1/comp3"
> 
> all parent nodes are named "component" and can not be 
> children of each other
> 
> thanks for advise
> 
> Dmitri
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]