Subject: Re: [xsl] Table of contents - for-each question From: David Carlisle <davidc@xxxxxxxxx> Date: Tue, 24 Jan 2006 16:50:00 GMT |
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]| * [@level="series"]| * [@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 ________________________________________________________________________
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Table of contents - for-each , llobash | Thread | Re: [xsl] Table of contents - for-e, David Carlisle |
[xsl] Table of contents - for-each , llobash | Date | Re: [xsl] Accessing external variab, viniciuscamara |
Month |