:choose CSS-class?

Here should go questions about transforming XML with XSLT and FOP.
Tiramma
Posts: 7
Location: Oslo, Norway

:choose CSS-class?

Mon Apr 11, 2005 10:59 am

Hi all!

I have something of a basic question. It seems I was even more out of practice than I thought when I took on this job ...

The XSLT below generates a menu in the form of an Unordered List. I've managed to make it appear where I want it, but I also need to assign a different .CLASS to each LIst item (1 to 8). Can someone help?

Code: Select all

<xsl:template name="MENU">
<!-- Applies the horisontal menu -->
<div id="horimeny">
<div id="meny">
<ul>
<xsl:apply-templates select="/DOCUMENT/BODY/ARTICLES/ACTION/FOLDERS/*[PARENT = $INTERNETROOT]" mode="MAIN_MENU"/>
</ul>
</div><!-- END #meny -->
</div><!-- END #horimeny -->
</xsl:template>

<xsl:template match="FOLDERS/*" mode="MENU">
<xsl:variable name="url">
<xsl:choose>
<xsl:when test="starts-with(LABEL, 'http://')"><xsl:value-of select="LABEL"/></xsl:when>
<xsl:otherwise><xsl:value-of select="URL/text()"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>

<xsl:variable name="pos" select="count(preceding-sibling::FOLDER[ATTRIBUTES/ATTRIBUTE[LABEL = 'menu_new']/VALUE = 'Horisontalmeny'])"/>

<li>
<xsl:if test="contains($PATH, concat(',', ID, ','))">
<xsl:attribute name="class">
<xsl:text>current</xsl:text>
<xsl:if test="$pos = 0 or LABEL = 'home'"><xsl:text> first</xsl:text></xsl:if>
<xsl:if test="not(following-sibling::FOLDER[ATTRIBUTES/ATTRIBUTE[LABEL = 'menu_new']/VALUE = 'Horisontalmeny'])"><xsl:text> last</xsl:text></xsl:if>
</xsl:attribute>
</xsl:if>
<!--<xsl:value-of select="$pos"/>-->
<a href="{$url}"><span><xsl:apply-templates select="NAME/text()"/></span></a>
</li>


I'd also like to me rid of the submenu here ... I've managed it temporarily by using "display: none" in the CSS, but that's hardly the way to do it!

I hope someone can help me out -- I'd be ever so greatful:)
The knuckles! The horrible knuckles!
Tiramma
Posts: 7
Location: Oslo, Norway

Mon Apr 11, 2005 1:28 pm

I've been told it's a bit hard to understand what I want to achive, so I'll try to explain that more clearly:

I need an unordered list where each list item can be given a different class, something like this:

Code: Select all

<ul>
<li class="red">Item 1</li>
<li class="blue">Item 2</li>
...
<li class="yellow">Item 8</li>
</ul>


I can generate the unordered list fine, but I haven't figured out yet how to assign a different class to each list item. I hope someone can help me:)
The knuckles! The horrible knuckles!
george
Site Admin
Posts: 2100

Mon Apr 11, 2005 3:28 pm

Hi,

It is still hard to understand what you want.
Please try to post a cut down sample showing

the XML document
the stylesheet
your current result
the expected result

Best Regards,
George
Tiramma
Posts: 7
Location: Oslo, Norway

Mon Apr 11, 2005 3:55 pm

Hm -- sorry about that ... I hope the code below helps.

I've pared things down to four menu items, for brevity, but there should really be eight.

This is the XML:

Code: Select all

<DOCUMENT>
   <BODY>
   (...)
      <ARTICLES>
         <ACTION ID="50">
            <FOLDERS>
               <FOLDER>
                  <NAME>Item 1</NAME>
                  <ID>151</ID>
                  <PARENT>148</PARENT>
                  <URL>./?module=Articles;action=ArticleFolder.publicOpenFolder;ID=151</URL>
                  <DEPTH>1</DEPTH>
                  <PRI>5</PRI>
               </FOLDER>
               <FOLDER>
                  <NAME>Item 2</NAME>
                  <ID>164</ID>
                  <PARENT>148</PARENT>
                  <URL>./?module=Articles;action=ArticleFolder.publicOpenFolder;ID=164</URL>
                  <DEPTH>1</DEPTH>
                  <PRI>13</PRI>
               </FOLDER>
               <FOLDER>
                  <NAME>Item 3</NAME>
                  <ID>150</ID>
                  <PARENT>148</PARENT>
                  <URL>./?module=Articles;action=ArticleFolder.publicOpenFolder;ID=150</URL>
                  <DEPTH>1</DEPTH>
                  <PRI>14</PRI>
               </FOLDER>
               <FOLDER>
                  <NAME>Item 4</NAME>
                  <ID>170</ID>
                  <PARENT>148</PARENT>
                  <URL>./?module=Articles;action=ArticleFolder.publicOpenFolder;ID=170</URL>
                  <DEPTH>1</DEPTH>
                  <PRI>15</PRI>
               </FOLDER>
            </FOLDERS>
         </ACTION>
      </ARTICLES>
   (...)
   </BODY>
</DOCUMENT>


The XSLT you can see above, but I'll include it here anyway:

Code: Select all

<xsl:template name="MENU">
<div id="horimeny">

<div id="meny">
<ul>
<xsl:apply-templates select="/DOCUMENT/BODY/ARTICLES/ACTION/FOLDERS/*[PARENT = $INTERNETROOT]" mode="MAIN_MENU"/>
</ul>
</div><!-- END #meny -->

</div><!-- END #horimeny -->
</xsl:template>

<xsl:template match="FOLDERS/*" mode="MENU">
<xsl:variable name="url">
  <xsl:choose>
    <xsl:when test="starts-with(LABEL, 'http://')"><xsl:value-of select="LABEL"/></xsl:when>
    <xsl:otherwise><xsl:value-of select="URL/text()"/></xsl:otherwise>
  </xsl:choose>
</xsl:variable>

<xsl:variable name="pos" select="count(preceding-sibling::FOLDER[ATTRIBUTES/ATTRIBUTE[LABEL = 'menu_new']/VALUE = 'Horisontalmeny'])"/>

<li>
  <xsl:if test="contains($PATH, concat(',', ID, ','))">
    <xsl:attribute name="class">
      <xsl:text>current</xsl:text>
      <xsl:if test="$pos = 0 or LABEL = 'home'"><xsl:text> first</xsl:text></xsl:if>
      <xsl:if test="not(following-sibling::FOLDER[ATTRIBUTES/ATTRIBUTE[LABEL = 'menu_new']/VALUE = 'Horisontalmeny'])"><xsl:text> last</xsl:text></xsl:if>
    </xsl:attribute>   
  </xsl:if>
  <!--<xsl:value-of select="$pos"/>-->
  <a href="{$url}"><span><xsl:apply-templates select="NAME/text()"/></span></a>
</li>

  <xsl:if test="../*[PARENT = current()/ID] and contains($PATH, concat(',', ID, ','))">
    <ul>
      <xsl:apply-templates select="/DOCUMENT/BODY/ARTICLES/ACTION/FOLDERS/*[PARENT=current()/ID]" mode="MENU"/>
    </ul>
  </xsl:if>
</xsl:template>


This is the HTML it is currently generating:

Code: Select all

<div id="horimeny">
    <div id="meny">
        <ul>
        <li><a href="./?module=Articles;action=ArticleFolder.publicOpenFolder;ID=151">Item 1</a></li>
        <li><a href="./?module=Articles;action=ArticleFolder.publicOpenFolder;ID=164">Item 2</a></li>
        <li><a href="./?module=Articles;action=ArticleFolder.publicOpenFolder;ID=150">Item 3</a></li>
        <li><a href="./?module=Articles;action=ArticleFolder.publicOpenFolder;ID=170">Item 4</a></li>
        (...)
        </ul>
    </div>
</div>


And this is the HTML I need:

Code: Select all

<div id="horimeny">
    <div id="meny">
        <ul>
        <li class="red"><a href="./?module=Articles;action=ArticleFolder.publicOpenFolder;ID=151">Item 1</a></li>
        <li class="turk"><a href="./?module=Articles;action=ArticleFolder.publicOpenFolder;ID=164">Item 2</a></li>
        <li class="yell"><a href="./?module=Articles;action=ArticleFolder.publicOpenFolder;ID=150">Item 3</a></li>
        <li class="blue"><a href="./?module=Articles;action=ArticleFolder.publicOpenFolder;ID=170">Item 4</a></li>
        (...)
        </ul>
    </div>
</div>


I hope this makes it clearer ...:)
The knuckles! The horrible knuckles!
george
Site Admin
Posts: 2100

Mon Apr 11, 2005 4:23 pm

Hmmm... I ment a working/valid stylesheet. I made some changes to make it compilable and to give result close to what you say you get. After that I noticed that it does not enter in the xsl:if that generates the class attribute but I cannot tell why because that test checks a variable that is not even declared in your stylesheet.
Anyway, I added a couple of class values in the stylesheet then output one depending on the folder order number.

Code: Select all

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:data="data" exclude-result-prefixes="data">
   
    <xsl:variable name="PATH"/>
    <xsl:variable name="classes" select="count(document('')/*/data:classes/data:class)"/>
   
    <data:classes>
       
        <data:class>red</data:class>
        <data:class>turk</data:class>
        <data:class>yell</data:class>
        <data:class>blue</data:class>       
    </data:classes>
   
    <xsl:template name="MENU">
        <div id="horimeny">
           
            <div id="meny">
                <ul>
                    <xsl:apply-templates select="/DOCUMENT/BODY/ARTICLES/ACTION/FOLDERS/*"/>
                </ul>
            </div><!-- END #meny -->
           
        </div><!-- END #horimeny -->
    </xsl:template>
   
    <xsl:template match="FOLDERS/*">
       
        <xsl:variable name="url">
            <xsl:choose>
                <xsl:when test="starts-with(LABEL, 'http://')"><xsl:value-of select="LABEL"/></xsl:when>
                <xsl:otherwise><xsl:value-of select="URL/text()"/></xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
       
        <xsl:variable name="pos" select="count(preceding-sibling::FOLDER) + 1"/>
       
        <li>
            <xsl:attribute name="class">
                <xsl:value-of select="document('')/*/data:classes/data:class[($pos -1 )mod $classes + 1]"/>
            </xsl:attribute>                       
            <a href="{$url}"><span><xsl:apply-templates select="NAME/text()"/></span></a>
        </li>
       
        <xsl:if test="../*[PARENT = current()/ID] and contains($PATH, concat(',', ID, ','))">
            <ul>
                <xsl:apply-templates select="/DOCUMENT/BODY/ARTICLES/ACTION/FOLDERS/*[PARENT=current()/ID]"/>
            </ul>
        </xsl:if>
    </xsl:template>
</xsl:stylesheet>


Regards,
George
Tiramma
Posts: 7
Location: Oslo, Norway

Mon Apr 11, 2005 9:38 pm

Unfortunately I can neither give you a complete stylesheet nor test your suggestion right now, seeing as the production server is down:\ I'll be back when it is up and running again!
The knuckles! The horrible knuckles!
Tiramma
Posts: 7
Location: Oslo, Norway

Mon Apr 11, 2005 10:08 pm

The good news is the server is back up, the bad news is it didn't work when I tried to do as you suggested:\ I'm not sure I did it right, though ...

I'm including the full XSLT sheet as it was originally below, in case that helps any (crossing my fingers):

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output method="html" indent="no" encoding="iso-8859-1" doctype-public="-//W3C//DTD HTML 4.01 Strict//EN" doctype-system="http://www.w3.org/TR/html4/strict.dtd"/>

<xsl:variable name="defaultStyleWrapping">false</xsl:variable>

<xsl:variable name="INTERNETROOT" select="/DOCUMENT/BODY/ARTICLES/ACTION/FOLDERS/FOLDER[LABEL='internett']/ID"/>

<!--
==========================================================================
Start menu templates, be careful when modifying
==========================================================================
-->

<xsl:variable name="CURRENT_FOLDER_ID" select="(/DOCUMENT/BODY/ARTICLES/ACTION/FOLDER_CONTENTS/PARENT/FOLDER/ID|/DOCUMENT/BODY/ARTICLES/ACTION/ARTICLE/FOLDER_ID)[1]"/>

<xsl:variable name="CURRENT_TOP_FOLDER_ID">
  <xsl:value-of select="/DOCUMENT/BODY/ARTICLES/ACTION/FOLDERS/FOLDER[contains($PATH, concat(',', ID, ',')) and number(DEPTH) = 1]/ID"/>
</xsl:variable>

<xsl:variable name="CURRENT_SECOND_FOLDER_ID">
  <xsl:value-of select="/DOCUMENT/BODY/ARTICLES/ACTION/FOLDERS/FOLDER[contains($PATH, concat(',', ID, ',')) and number(DEPTH) = 2]/ID"/>
</xsl:variable>
 
<xsl:param name="PATH">
  <xsl:call-template name="TRACE_FOLDER_TO_ROOT">
    <!-- Specify id below to tell script what folder ID to use as basis for menu location -->
    <xsl:with-param name="id" select="(/DOCUMENT/BODY/ARTICLES/ACTION/FOLDER_CONTENTS/PARENT/FOLDER/ID|/DOCUMENT/BODY/ARTICLES/ACTION/ARTICLE/FOLDER_ID)[1]"/>
  </xsl:call-template>
</xsl:param>

<xsl:template name="TRACE_FOLDER_TO_ROOT">
<!-- Trace current folder ID to top folder -->
<xsl:param name="id"/>
<xsl:param name="str"/>
<xsl:variable name="parent" select="/DOCUMENT/BODY/ARTICLES/ACTION/FOLDERS/FOLDER[ID=$id]/PARENT"/>
<xsl:variable name="newstr" select="concat($str, ',', $id, ',')"/>
<xsl:choose>
  <xsl:when test="$parent and /DOCUMENT/BODY/ARTICLES/ACTION/FOLDERS/FOLDER[ID=$parent]">
  <!-- Recurse -->
    <xsl:call-template name="TRACE_FOLDER_TO_ROOT">
      <xsl:with-param name="id" select="$parent"/>
      <xsl:with-param name="str" select="$newstr"/>
    </xsl:call-template>
  </xsl:when>
  <xsl:otherwise>
  <!-- We're at top -->
    <xsl:value-of select="$newstr"/>
  </xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="FOLDERS/*" mode="MENU">
<xsl:variable name="MYPARENT" select="PARENT"/>
<!-- Is folder or parent hidden? -->
<xsl:variable name="HIDDEN" select="ATTRIBUTES/ATTRIBUTE[LABEL='hidden']/VALUE = 'true'"/>
<xsl:if test="not($HIDDEN) and (not(PARENT) or contains($PATH, concat(',', PARENT, ',')))">
  <!-- We're either at root or have a parent in path -->
  <xsl:apply-templates select="." mode="WRITE"/>
</xsl:if>
</xsl:template>

<xsl:template match="FOLDERS/*" mode="LEFTMENU">
<xsl:variable name="MYPARENT" select="PARENT"/>
<!-- Is folder or parent hidden? -->
<xsl:variable name="HIDDEN" select="ATTRIBUTES/ATTRIBUTE[LABEL='hidden']/VALUE = 'true'"/>
<xsl:if test="not($HIDDEN) and (not(PARENT) or contains($PATH, concat(',', PARENT, ',')))">
  <!-- We're either at root or have a parent in path -->
  <xsl:apply-templates select="." mode="LEFTWRITE"/>
</xsl:if>
</xsl:template>


<!--
==========================================================================
End menu templates
==========================================================================
-->

<xsl:template name="MENU">
<!-- Applies the horisontal menu -->
<div id="horimeny">

<div id="nav">
<a href=""><img src="files/nav-eng.gif" alt="In English" width="14" height="14" /></a> &#160;
<a href="./"><img src="files/nav-hjem.gif" alt="Hjem" width="13" height="14" /></a> &#160;
<a href="mailto:post@energi.no"><img src="files/nav-kontakt.gif" alt="Kontakt" width="13" height="14" /></a>
</div><!-- END #nav -->

<div id="meny">
<ul>
<xsl:apply-templates select="/DOCUMENT/BODY/ARTICLES/ACTION/FOLDERS/*[PARENT = $INTERNETROOT]" mode="MAIN_MENU"/>
</ul>
</div><!-- END #meny -->

</div><!-- END #horimeny -->
</xsl:template>

<xsl:template match="FOLDERS/*" mode="MENU">
<xsl:variable name="url">
  <xsl:choose>
    <xsl:when test="starts-with(LABEL, 'http://')"><xsl:value-of select="LABEL"/></xsl:when>
    <xsl:otherwise><xsl:value-of select="URL/text()"/></xsl:otherwise>
  </xsl:choose>
</xsl:variable>

<xsl:variable name="pos" select="count(preceding-sibling::FOLDER[ATTRIBUTES/ATTRIBUTE[LABEL = 'menu_new']/VALUE = 'Horisontalmeny'])"/>

<li>
  <!-- xsl:if test="contains($PATH, concat(',', ID, ','))" -->
    <xsl:attribute name="class">
      <xsl:text>item</xsl:text><xsl:value-of select="$pos"/>
    </xsl:attribute>
  <!-- /xsl:if -->
<!--<xsl:value-of select="$pos"/>-->
<a href="{$url}"><span><xsl:apply-templates select="NAME/text()"/></span></a>
</li>
</xsl:template>

<xsl:template name="MAIN_MENU">
<!-- Applies the main menu -->
<div id="leftmeny">
<ul>
<xsl:apply-templates select="/DOCUMENT/BODY/ARTICLES/ACTION/FOLDERS/*[PARENT = $INTERNETROOT]" mode="MAIN_MENU"/>
</ul>
</div>
</xsl:template>

<xsl:template match="FOLDERS/*" mode="MAIN_MENU">
<xsl:variable name="url">
  <xsl:choose>
    <xsl:when test="starts-with(LABEL, 'http://')"><xsl:value-of select="LABEL"/></xsl:when>
    <xsl:otherwise><xsl:value-of select="URL/text()"/></xsl:otherwise>
  </xsl:choose>
</xsl:variable>

<xsl:variable name="pos" select="count(preceding-sibling::FOLDER[ATTRIBUTES/ATTRIBUTE[LABEL = 'menu_new']/VALUE = 'Venstremeny'])"/>

<li>
  <xsl:if test="contains($PATH, concat(',', ID, ','))">
    <xsl:attribute name="class">
      <xsl:text>current</xsl:text>
      <xsl:if test="$pos = 0 or LABEL = 'home'"><xsl:text> first</xsl:text></xsl:if>
      <xsl:if test="not(following-sibling::FOLDER[ATTRIBUTES/ATTRIBUTE[LABEL = 'menu_new']/VALUE = 'Venstremeny'])"><xsl:text> last</xsl:text></xsl:if>
    </xsl:attribute>   
  </xsl:if>
  <!--<xsl:value-of select="$pos"/>-->
  <a href="{$url}"><xsl:apply-templates select="NAME/text()"/></a>

  <xsl:if test="../*[PARENT = current()/ID] and contains($PATH, concat(',', ID, ','))">
    <ul>
      <xsl:apply-templates select="/DOCUMENT/BODY/ARTICLES/ACTION/FOLDERS/*[PARENT=current()/ID]" mode="MAIN_MENU"/>
    </ul>
  </xsl:if>
</li>
</xsl:template>

<xsl:template match="FOLDERS/*" mode="SUB_MENU">
<xsl:variable name="url">
  <xsl:choose>
    <xsl:when test="starts-with(LABEL, 'http://')"><xsl:value-of select="LABEL"/></xsl:when>
    <xsl:otherwise><xsl:value-of select="URL/text()"/></xsl:otherwise>
  </xsl:choose>
</xsl:variable>

<xsl:variable name="pos" select="count(preceding-sibling::FOLDER[ATTRIBUTES/ATTRIBUTE[LABEL = 'menu_new']/VALUE = 'Undermeny'])"/>

<li>
  <xsl:if test="contains($PATH, concat(',', ID, ','))">
    <xsl:attribute name="class">
      <xsl:text>current</xsl:text>
      <xsl:if test="$pos = 0"><xsl:text> first</xsl:text></xsl:if>
    </xsl:attribute>
   
  </xsl:if>
  <a href="{$url}"><xsl:apply-templates select="NAME/text()"/></a>

  <xsl:if test="../*[PARENT = current()/ID] and contains($PATH, concat(',', ID, ','))">
    <ul>
      <xsl:apply-templates select="/DOCUMENT/BODY/ARTICLES/ACTION/FOLDERS/*[PARENT=current()/ID]" mode="MAIN_MENU"/>
    </ul>
  </xsl:if>
</li>
</xsl:template>

<xsl:template match="FOLDERS/*[DEPTH &gt; 2]" mode="MAIN_MENU">
<xsl:variable name="url">
  <xsl:choose>
    <xsl:when test="starts-with(LABEL, 'http://')"><xsl:value-of select="LABEL"/></xsl:when>
    <xsl:otherwise><xsl:value-of select="URL/text()"/></xsl:otherwise>
  </xsl:choose>
</xsl:variable>

<li>
  <xsl:if test="contains($PATH, concat(',', ID, ','))">
    <xsl:attribute name="class"><xsl:text>current</xsl:text></xsl:attribute>
  </xsl:if>
  <a href="{$url}"><xsl:apply-templates select="NAME/text()"/></a>

  <xsl:if test="../*[PARENT = current()/ID] and contains($PATH, concat(',', ID, ','))">
    <ul>
      <xsl:apply-templates select="/DOCUMENT/BODY/ARTICLES/ACTION/FOLDERS/*[PARENT=current()/ID]" mode="MAIN_MENU"/>
    </ul>
  </xsl:if>
</li>
</xsl:template>

<xsl:template match="FOLDERS/*[ATTRIBUTES/ATTRIBUTE[LABEL = 'hidden']/VALUE = 'true']" mode="QUICK_LINKS"/>
<xsl:template match="FOLDERS/*[ATTRIBUTES/ATTRIBUTE[LABEL = 'hidden']/VALUE = 'true']" mode="MAIN_MENU"/>
<xsl:template match="FOLDER[ATTRIBUTES/ATTRIBUTE[LABEL = 'hidden']/VALUE = 'true']" mode="submenuitem"/>

<xsl:template match="FOLDERS/*[ATTRIBUTES/ATTRIBUTE[LABEL = 'menu_new']/VALUE = 'Skjul']" mode="QUICK_LINKS"/>
<xsl:template match="FOLDERS/*[ATTRIBUTES/ATTRIBUTE[LABEL = 'menu_new']/VALUE = 'Skjul']" mode="MAIN_MENU"/>
<xsl:template match="FOLDER[ATTRIBUTES/ATTRIBUTE[LABEL = 'menu_new']/VALUE = 'Skjul']" mode="submenuitem"/>

</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2005. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios/><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition></MapperMetaTag>
</metaInformation>
-->
The knuckles! The horrible knuckles!
Tiramma
Posts: 7
Location: Oslo, Norway

Tue Apr 12, 2005 1:21 pm

All solved:) In case you want to know, this is the bit that did it:

Code: Select all

<xsl:template match="FOLDERS/*" mode="MAIN_MENU">
<xsl:variable name="url">
  <xsl:choose>
    <xsl:when test="starts-with(LABEL, 'http://')"><xsl:value-of select="LABEL"/></xsl:when>
    <xsl:otherwise><xsl:value-of select="URL/text()"/></xsl:otherwise>
  </xsl:choose>
</xsl:variable>

<xsl:variable name="pos" select="count(preceding-sibling::FOLDER[ATTRIBUTES/ATTRIBUTE[LABEL = 'menu_new']/VALUE = 'Venstremeny'])"/>

<li class="">
    <xsl:attribute name="class">
      <xsl:choose>
        <xsl:when test="not(following-sibling::FOLDER[ATTRIBUTES/ATTRIBUTE[LABEL = 'menu_new']/VALUE = 'Horisontalmeny'])"><xsl:text>item</xsl:text><xsl:value-of select="$pos"/></xsl:when>
        <xsl:otherwise><xsl:text>item</xsl:text><xsl:value-of select="$pos"/></xsl:otherwise>
      </xsl:choose>
    </xsl:attribute>
  <a href="{$url}"><xsl:apply-templates select="NAME/text()"/></a>

  <xsl:if test="../*[PARENT = current()/ID] and contains($PATH, concat(',', ID, ','))">
    <ul>
      <xsl:apply-templates select="/DOCUMENT/BODY/ARTICLES/ACTION/FOLDERS/*[PARENT=current()/ID]" mode="MAIN_MENU"/>
    </ul>
  </xsl:if>
</li>
</xsl:template>
The knuckles! The horrible knuckles!

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 2 guests