xsl-list
[Top] [All Lists]

Re: Table of contents - for-each question

2006-01-24 09:50:00

It's pretty hard to guess what you code is doing without seeing a sample
input. Also "The for-each statement - in bold below" your mail is sent
as text/plain so there are no font changes (not that my mail reader
shows font changes anyway) I guess you mean this for-each:

<xsl:for-each select='* [head]| * [(_at_)level="series"]| * 
[(_at_)level="subseries"]'>

That selects all child elements with the specified head child or
attributes, but are all the elements you want children of the current
node or are some of them further down the input tree?

Perhaps it's just an artifact of you simplifying for posting but this:

  <xsl:param name='htype'>
            <xsl:choose>
                  <xsl:when test='$levels="3"'>
                        <xsl:text>div</xsl:text>
                  </xsl:when>

<!-- if test result = no -->

                  <xsl:otherwise>
                        <xsl:text>div</xsl:text>
                  </xsl:otherwise>
            </xsl:choose>
      </xsl:param>

always evaluates to div

so


                  <xsl:element name='{$htype}'>


<!-- attribute style for htype. indentation and size for each htype output
here. -->

                        <xsl:attribute name='style'>
                        <xsl:text>text-indent:</xsl:text>

                        <xsl:value-of select='$hindent'/>
                        <xsl:text>pt;</xsl:text>
                        </xsl:attribute>



could be written

<div style="text-indent:{$hindent}pt;">


________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--~------------------------------------------------------------------
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>