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] |
Other format: | [Raw text] |
] Currently, I have a template for the indents that looks like this: ] ] <xsl:template name="toc-indent"> ] <xsl:variable name="level" select="count(ancestor::part)"/> ] <xsl:choose> ] <xsl:when test="$level=0"><xsl:text ] disable-output-escaping="yes"></xsl:text></xsl:when> ] <xsl:when test="$level=1"><xsl:text ] disable-output-escaping="yes">&nbsp;&nbsp;</xsl:text></xsl:when> ] <xsl:when test="$level=2"><xsl:text ] disable-output-escaping="yes">&nbsp;&nbsp;&nbsp;&nbsp;</xsl: ] text></xsl:when> ] <xsl:when test="$level=3"><xsl:text ] disable-output-escaping="yes">&nbsp;&nbsp;&nbsp;&nbsp;&n ] bsp;&nbsp;</xsl:text></xsl:when> ] <xsl:when test="$level=4"><xsl:text ] disable-output-escaping="yes">&nbsp;&nbsp;&nbsp;&nbsp;&n ] bsp;&nbsp;&nbsp;&nbsp;</xsl:text></xsl:when> ] <xsl:when test="$level=5"><xsl:text ] disable-output-escaping="yes">&nbsp;&nbsp;&nbsp;&nbsp;&n ] bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text></xsl:when> ] <xsl:otherwise><xsl:text ] disable-output-escaping="yes">&nbsp;&nbsp;&nbsp;&nbsp;&n ] bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text></xsl:other ] wise> ] </xsl:choose> ] </xsl:template> ] ] It works, but it's not smart and far from beautiful. There is a better way ] to do it, isn't it? :-) it would probably be better not to use non breaking space and just indent with nested lists and css styling, but if you want to use nbsp looking at the faq or archives for this list will show that ] <xsl:text disable-output-escaping="yes">&nbsp; is not the recommended way of getting a non breaking space. just <xsl:text> </xsl:text> is all you need. you just want one of those for each ancestor part element, so that's <xsl:template name="toc-indent"> <xsl:for-each select="ancestor::part"> </xsl:for-each> </xsl:template> David _____________________________________________________________________ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Scanning Service. For further information visit http://www.star.net.uk/stats.asp or alternatively call Star Internet for details on the Virus Scanning Service. 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] |