1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output
encoding="ISO-8859-15"
method="xml"
indent="yes" />
<xsl:template match="/">
<result>
<xsl:apply-templates select="//lettrine"/>
</result>
</xsl:template>
<xsl:template match="lettrine">
<lettrine>
<xsl:value-of select="."/>
<xsl:variable name = "B" >
<xsl:for-each select="./following-sibling::*">
<xsl:if test="name() = 'separateur'">
<xsl:value-of select="position()"/><xsl:text>;</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:variable name = "C" >
<xsl:value-of select="substring-before($B,';')"/>
</xsl:variable>
<xsl:apply-templates select="./following-sibling::*[position() < $C]"/>
</lettrine>
</xsl:template>
</xsl:stylesheet> |
Partager