Commit dde94952 authored by Wendell Piez's avatar Wendell Piez
Browse files

Touchups to touchup XSLT

parent 84d4d6d2
......@@ -10,18 +10,24 @@
<!-- Note the default namespace for matching (given above) is
"http://www.w3.org/1999/xhtml" -->
<!-- The results will have XML syntax but no XML declaration or DOCTYPE declaration
<!-- The results will have XML syntax but no XML declaration or DOCTYPE declaration
(as permitted by HTML5). -->
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
<!-- XSweet: provides a "bridge filter" for final tuning of HTML contents; a generalized sub-editorial preprocessor supporting string replacement. [3b] -->
<!-- Input: HTML -->
<!-- Output: A copy of the input, with text munges and other "tuning" -->
<!-- Limitation: doesn't handle overlap; any inline markup splitting strings will also inhibit string replacement. -->
<xsl:output method="xml" indent="no" omit-xml-declaration="yes"/>
<xsl:mode on-no-match="shallow-copy"/>
<!-- The replacements will be made in order so earlier matches take precedence. -->
<xsl:variable name="replacements">
<xsw:match replace="&#x2026;" >\.\.\.</xsw:match><!-- replace three dots with horizontal ellipsis -->
<xsw:match replace="&#x2013;$1">-(\d)</xsw:match><!-- replace hyphen+digit with en dash + digit -->
<xsw:match replace="&#x20;" >\s+</xsw:match><!-- replace runs of spaces with single space -->
<xsw:match replace="&#x2026;" >\.\.\.</xsw:match> <!-- replace three dots with horizontal ellipsis -->
<xsw:match replace="&#x2013;$1">-(\d)</xsw:match> <!-- replace hyphen+digit with en dash + digit -->
<xsw:match replace="&#x20;" >\s+</xsw:match> <!-- replace runs of spaces with single space -->
<xsw:match replace="&#x2014;" >\s*&#x2014;\s*</xsw:match><!-- omit whitespace around em dashes -->
</xsl:variable>
<xsl:template match="text()">
......@@ -34,4 +40,5 @@
</xsl:next-iteration>
</xsl:iterate>
</xsl:template>
</xsl:stylesheet>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment