[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Breadcrumbs XSL code

Subject: Re: Breadcrumbs XSL code
From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Date: Wed, 21 Jun 2006 18:01:35 +0530
xsl breadcrumbs
Hi Bernie,
  Please try this stylesheet:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html" />

   <xsl:template match="/root">
       <html>
           <head>
              <title/>
           </head>
           <body>
              <xsl:call-template name="GenerateBreadcrumbs">
                 <xsl:with-param name="x" select="breadCrumbs" />
	  <xsl:with-param name="y" select="breadCrumbsUrls" />
              </xsl:call-template>
            </body>
       </html>
    </xsl:template>

   <xsl:template name="GenerateBreadcrumbs">
       <xsl:param name="x" />
       <xsl:param name="y" />

         <xsl:choose>
             <xsl:when test="$y != ''">
                <xsl:choose>
	    <xsl:when test="contains($y,',')">
                      <a href="{substring-before($y,
',')}"><xsl:value-of select="substring-before($x, ',')"
/></a><xsl:text> </xsl:text> &gt;
	    </xsl:when>
	    <xsl:otherwise>
                      <a href="{$y}"><xsl:value-of
select="substring-before($x, ',')" /></a><xsl:text> </xsl:text> &gt;
	    </xsl:otherwise>
	 </xsl:choose>
                <xsl:call-template name="GenerateBreadcrumbs">
                   <xsl:with-param name="x"
select="substring-after($x, ',')" />
	    <xsl:with-param name="y" select="substring-after($y, ',')" />
	  </xsl:call-template>
              </xsl:when>
              <xsl:otherwise>
                 <xsl:value-of select="$x" />
              </xsl:otherwise>
         </xsl:choose>
   </xsl:template>

</xsl:stylesheet>

Regards,
Mukul

On 6/21/06, Bernie <berniecc@xxxxxxxxx> wrote:
With the next XML:

 <?xml version="1.0" encoding="utf-8"?>
 <root>
  <breadCrumbs>Home page,Section 1,Chapter2</breadCrumbs>
  <breadCrumbsUrls>linkToHome.html,linkToSec1.html</breadCrumbsUrls>
 </root>

can you tell me the XSL code to produce the next HTML?

<a href="linkToHome.html">Home page</a> &gt; <a
href="linkToSec1.html">Section 1</a> &gt; Chapter 2

Thank you very much in advance.
Bernie

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.