xsl-list
[Top] [All Lists]

Re: [xsl] grouping xhtml title with first sibling

2011-01-18 09:35:06
Thank you Michael, this looks more appropiate to my need ;-)

After adding the f prefix to :
<xsl:template match="body/*/f:is-heading(.)" priority="10">

I get an "Failed to compile stylesheet" error :
Error at xsl:template on line 23 column 63 of orphans.xsl:
XTSE0340: XSLT Pattern syntax error at char 7 on line 23 in {body/*/igs:is-heading(.}:
    Function call may appear only at the start of a pattern
Failed to compile stylesheet. 1 error detected.

Feeding function with node seems not to work on xsl:template?

Matthieu.

Le 18/01/2011 15:34, Michael Kay a écrit :
<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>


--
Matthieu Ricaud
IGS-CP
Service Livre numérique



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