Suppose you want compound words that contain hyphens (or any other
criteria) to be wrapped with inline elements (such as the HTML <code>
element).
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="3.0">
<xsl:template match="text()">
<xsl:variable name="txt">
<xsl:next-match/>
</xsl:variable>
<xsl:analyze-string regex="(\w|\-)+" select="$txt">
<xsl:matching-substring>
<!-- A word -->
<xsl:choose>
<xsl:when test="contains(., '-')">
<!-- A compound word -->
<code class="compound-word">
<xsl:value-of select="."/>
</code>
</xsl:when>
<xsl:otherwise>
<!-- A simple word -->
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:matching-substring>
<xsl:non-matching-substring>
<!-- Not a word -->
<xsl:value-of select="."/>
</xsl:non-matching-substring>
</xsl:analyze-string>
</xsl:template>
</xsl:stylesheet>com.oxygenxml.pdf.css.xsl.merged2merged XSLT extension
point:<publishing-template>
...
<pdf>
...
<xslt>
<extension
id="com.oxygenxml.pdf.css.xsl.merged2merged"
file="xslt/merged2mergedExtension.xsl"/>
</xslt>