xsl-list
[Top] [All Lists]

[xsl] Looping through a list of items

2013-08-15 09:39:09
This is a DITA related problem, I'll try to break it down into something 
sensical for the context of this list.

My XML structure ultimately consists of chapters and appendixes filled with 
child topics. 

Within an inline block I setup all the TOC links to the pages. I'm trying to do 
Chapter-Page numbering.

When I hit the child topics, within the transformation, $topicType is set to 
topicSimple.

I need some way to reference the parent to determine if the number should have 
a format of A or 1. 
Or if I could simply access the previously used number I'd be set.

Because I'm within an inline, I can't set a marker.

Let me know if this problem is too DITA specific for this list. I feel there's 
got to be a simple solution to this but my XSLT skills aren't quite there yet.

<xsl:variable name="tocItemContent">
<fo:basic-link>
<fo:inline >
    <xsl:if test="not($topicType='topicPart')">
        <xsl:for-each select="key('map-id', @id)[1]">
          <xsl:choose>
            <xsl:when test="$topicType='topicAppendix'">
              <xsl:number format="A" count="*[contains(@class, ' 
bookmap/appendix ')]"/>
            </xsl:when>
            <xsl:when test="$topicType='topicChapter'">
              <xsl:number format="1" count="*[contains(@class, ' 
bookmap/chapter ')]"/>
            </xsl:when>
            <xsl:otherwise>

// $topicType="topicSimple" here, I need to use the chapter|appendix 
number|letter that was last used.

            </xsl:otherwise>
          </xsl:choose>
        </xsl:for-each>-</xsl:if>
    <fo:page-number-citation>
        <xsl:attribute name="ref-id">
            <xsl:call-template name="generate-toc-id"/>
        </xsl:attribute>
    </fo:page-number-citation>
</fo:inline>
</fo:basic-link>
</xsl:variable>

AVIS : Ce courrier et ses pieces jointes sont destines a leur seul destinataire 
et peuvent contenir des informations confidentielles appartenant a bioMerieux. 
Si vous n'etes pas destinataire, vous etes informe que toute lecture, 
divulgation, ou reproduction de ce message et des pieces jointes est 
strictement interdite. Si vous avez recu ce message par erreur merci d'en 
prevenir l'expediteur et de le detruire, ainsi que ses pieces jointes.
NOTICE: This message and attachments are intended only for the use of their 
addressee and may contain confidential information belonging to bioMerieux. If 
you are not the intended recipient, you are hereby notified that any reading, 
dissemination, distribution, or copying of this message, or any attachment, is 
strictly prohibited. If you have received this message in error, please notify 
the original sender immediately and delete this message, along with any 
attachments.



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


<Prev in Thread] Current Thread [Next in Thread>
  • [xsl] Looping through a list of items, KAATMAN Matthew <=