Search

Hello, XSLT professionals! For example, i have such xml:

<item id=1 handle=1/>
<item id=2 handle=2>
  <parent><item id=1/></parent>
</item>
<item id=3 handle=3>
  <parent><item id=2/></parent>
</item>
<item id=4 handle=4>
  <parent><item id=3/></parent>
</item>
<currentItem id=4/>

How can i get set of items for output "Breadcumbs" in this way:

<xsl:for-each select="<SET>">
  <xsl:value-of select="@handle"/>/
</xsl:for-each>

Must be like "1/2/3/4/"

if you don't have the ability to restructure your xml into something a bit more logical, you can probably get away with something like this:

<xsl:for-each select="item[@id &lt;= /currentItem/@id]">
    <xsl:value-of select="@handle">/
</xsl:for-each>

this hasn't been tested, but it should point you in the right direction. you may want to give an absolute path to currentItem

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details