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]

Nodeset displayed as <ul>-list


I would like build my website with XML/XSL. The navigation should
automaticly generated with XSL. So I have written the structure from my
website in XML. A example:

  <tree>
    <nav id="123" title="Page 1"/>
    <nav id="124" title="Page 2">
      <nav group="section 1"/>  
      <nav id="125" title="Page 4">
        <nav id="126" title="Page 5"/>
        <nav id="127" title="Page 6"/>
        <nav id="128" title="Page 7"/>
      </nav>
      <nav id="129" title="Page 8">
        <nav id="130" title="Page 9"/>
      </nav>
      .
      .
      <nav group="section 2"/>
      <nav id="131" title="Page 11"/>
      .
      .
    </nav>
  </tree>

Ok now I would describe you my intention. The "id"-attribute its only for
selection. The "title"-attribute should be the text whos displayed in the
navigation-list. The "group"-attribute is only used as a seperator.

Now i would select a node-set as follows:

      <xsl:for-each select="id($navid)/ancestor::* |
id($navid)/ancestor::*/child::*">
        <xsl:if test="count(ancestor::*) &gt;= $sd and count(ancestor::*)
&lt;= $ed">
          <xsl:if test="boolean(@title)">
            <xsl:value-of select="@title"/>
          </xsl:if>
          <xsl:if test="boolean(@group)">
            <b><xsl:value-of select="@group"/></b>
          </xsl:if>
          <br/>
        </xsl:if>
      </xsl:for-each>

$navid is the id which tag I select - $sd is the start-depth and $ed is the
end-depth of the node-set.

Now my problem: In this case all "title" will right displayed and in the
right order. But I would like also display the structure of the node-set in
a list(<ul>, <li>). How must I redesign the code to display the structure
right?

I have tried to create the list like the example in "XSLT Programmers
Reference" (Page 302) but it will not worked in cocoon. The <xsl:text
disable-output-escaping="yes"> dont work.

Can you please help me?   


- Conny -


 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]