[xsl] HTML: unordered list within unordered list

Subject: [xsl] HTML: unordered list within unordered list
From: Rich Garcia <rchgrca@xxxxxxxxx>
Date: Sat, 27 Apr 2002 17:47:31 -0700 (PDT)
Folks,

I'm trying to generate the following HTML output:
<ul>
  <li>item1</li>
  <li>item2</li>
  <li>
    <ul>
      <li type="circle">item2a</li>
      <li type="circle">item2b</li>
    <ul>
  </li>
  <li>item3</li>
  <li>item4</li>
</ul>

My xml looks like:
<Property type="bullet">item1</Property>
<Property type="bullet">item2</Property>
<Property type="bullet"
icon="circle">item2a</Property>
<Property type="bullet"
icon="circle">item2b</Property>
<Property type="bullet">item3</Property>
<Property type="bullet">item4</Property>

My templates look like:

<xsl:call-template name="showbullets"/>

<xsl:template name="showbullets">
  <xsl:if test="Property/@type = 'bullet'">
    <xsl:call-template name="ul"/>
  </xsl:if>
</xsl:template>

<!-- creates <ul> -->
<xsl:template name="ul">
  <ul><xsl:call-template name="li"/></ul>
</xsl:template>
  
<!-- creates unorder list bullets <li> -->
<xsl:template name="li">
  <xsl:for-each select="Property">
    <li>
      <xsl:if test="@icon='circle'">
        <xsl:attribute
name="type">circle</xsl:attribute>
      </xsl:if>
      <xsl:value-of select="@name"/><xsl:value-of
select="."/><xsl:text> </xsl:text><xsl:value-of
select="@yeargraduated"/>
    </li>
  </xsl:for-each>
</xsl:template>

Any suggestions?  I'm drawing a blank...

__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

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


Current Thread