]> granicus.if.org Git - docbook-dsssl/commitdiff
This makefile downloads Jeni Tennison's "Markup Utility"
authorMichael Smith <xmldoc@users.sourceforge.net>
Mon, 27 Mar 2006 05:10:40 +0000 (05:10 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Mon, 27 Mar 2006 05:10:40 +0000 (05:10 +0000)
stylesheet, then runs it through the modify.xsl file to alter the
value of the "punctuation" variable.

contrib/tools/tennison/Makefile [new file with mode: 0644]
contrib/tools/tennison/modify.xsl [new file with mode: 0644]

diff --git a/contrib/tools/tennison/Makefile b/contrib/tools/tennison/Makefile
new file mode 100644 (file)
index 0000000..c3e8a1e
--- /dev/null
@@ -0,0 +1,25 @@
+# $Id$
+
+DOWNLOAD_URL ?= http://www.jenitennison.com/xslt/utilities
+DOWNLOAD_FILENAME ?= markup.xsl
+
+WGET ?= wget
+WGET_OPTS ?=
+
+XSLTPROC=xsltproc
+XSLTPROCFLAGS=
+
+MODIFY_XSL=modify.xsl
+
+all: modified-$(DOWNLOAD_FILENAME)
+
+$(DOWNLOAD_FILENAME):
+       $(WGET) $(DOWNLOAD_URL)/$@
+
+modified-$(DOWNLOAD_FILENAME): $(DOWNLOAD_FILENAME)
+       $(XSLTPROC) $(XSLTPROCFLAGS) $(MODIFY_XSL) $< > $@
+
+clean:
+       $(RM) $(DOWNLOAD_FILENAME)
+       $(RM) modified-$(DOWNLOAD_FILENAME)
+
diff --git a/contrib/tools/tennison/modify.xsl b/contrib/tools/tennison/modify.xsl
new file mode 100644 (file)
index 0000000..9cfa499
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version='1.0'?>
+<!DOCTYPE xsl:stylesheet [
+<!ENTITY tab "&#x9;">
+<!ENTITY lf "&#xA;">
+<!ENTITY cr "&#xD;">
+<!ENTITY nbsp "&#160;">
+]>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"
+               version='1.0'>
+
+  <xsl:output method="xml"
+             indent="no"
+              />
+  
+  <xsl:template match="node() | @*">
+    <xsl:copy>
+      <xsl:apply-templates select="@* | node()"/>
+    </xsl:copy>
+  </xsl:template>
+  <!-- * this template modifies the value of the "punctuation" variable -->
+  <!-- * from the original markup.xsl so that it does not contain the -->
+  <!-- * dot/period character -->
+  <xsl:template match="*[local-name = 'variable'][@name = 'punctuation']">
+    <xsl:element name="xsl:variable">
+      <xsl:attribute name="name">
+           <!-- * remove dot from the list of punctuation chars -->
+        <xsl:text>,:;!?&tab;&cr;&lf;&nbsp; &quot;'()[]&lt;>{}</xsl:text>
+      </xsl:attribute>
+    </xsl:element>
+  </xsl:template>
+  
+</xsl:stylesheet>