[Home] [By Thread] [By Date] [Recent Entries]
OK, sorry. Because of the way the mailer destroys indentation, I misread
your question and assumed you were asking the commonly asked question
about how to create hierarchic sections.
I think you can do this with <xsl:function name="f:is-heading" as="xs:boolean"> <xsl:param name="e" as="element()"/> <xsl:sequence select="matches(local-name($e), 'h[1-9]')"/> </xsl:function> <xsl:template match="body"> <xsl:apply-templates select="* except (*[f:is-heading(.)]/following-sibling::*[1])"/> </xsl:template> <xsl:template match="body/*"> <xsl:copy-of select="."/> </xsl:template> <xsl:template match="body/*/is-heading(.)" priority="10"> <div> <xsl:copy-of select=".|following-sibling::*[1]"/> </div> </xsl:template> On 18/01/2011 13:46, Matthieu Ricaud-Dussarget wrote:
I can't help feeling there must be better ways of doing that... Michael Kay Saxonica
|

Cart



