Test Coverage Report
Stylesheet: /Users/cmarchand/devel/gitlab_oxiane/cmarchand/mdtohtml-2023/src/main/inits/md-to-html/src/main/xsl/md-to-pivot.xsl
module: /Users/cmarchand/devel/gitlab_oxiane/cmarchand/mdtohtml-2023/src/main/inits/md-to-html/src/main/xsl/md-to-pivot.xsl;
35 lines
01: <?xml version="1.0" encoding="UTF-8"?>
02: <xsl:transform
03: xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
04: xmlns:prv="top:marchand:md-to-pivot:private"
05: xmlns:xs="http://www.w3.org/2001/XMLSchema"
06: version="3.0">
07:
08: <xsl:template match=".[prv:isTitle1(.)]" mode="to-pivot">
09: <title><xsl:sequence select="prv:extractTitleContent(.)"/></title>
10: </xsl:template>
11: <xsl:template match=".[prv:isTitle2(.)]" mode="to-pivot">
12: <title-chapter><xsl:sequence select="prv:extractTitleContent(.)"/></title-chapter>
13: </xsl:template>
14: <xsl:template match=".[prv:isTitle3(.)]" mode="to-pivot">
15: <title-exercise><xsl:sequence select="prv:extractTitleContent(.)"/></title-exercise>
16: </xsl:template>
17: <xsl:function name="prv:extractTitleContent">
18: <xsl:param name="input" as="xs:string"/>
19: <xsl:value-of select="replace($input, '^#+\s*','')"/>
20: </xsl:function>
21:
22: <xsl:function name="prv:isTitle1" as="xs:boolean">
23: <xsl:param name="input" as="xs:string"/>
24: <xsl:sequence select="starts-with($input,'# ')"/>
25: </xsl:function>
26: <xsl:function name="prv:isTitle2" as="xs:boolean">
27: <xsl:param name="input" as="xs:string"/>
28: <xsl:sequence select="starts-with($input,'## ')"/>
29: </xsl:function>
30: <xsl:function name="prv:isTitle3" as="xs:boolean">
31: <xsl:param name="input" as="xs:string"/>
32: <xsl:sequence select="starts-with($input,'### ')"/>
33: </xsl:function>
34:
35: </xsl:transform>