]> granicus.if.org Git - docbook-dsssl/commitdiff
An XSLT2 stylehseet to obfuscate the text of a DocBook document so that you can submi...
authorKeith Fahlgren <abdelazer@users.sourceforge.net>
Wed, 11 Feb 2009 20:58:08 +0000 (20:58 +0000)
committerKeith Fahlgren <abdelazer@users.sourceforge.net>
Wed, 11 Feb 2009 20:58:08 +0000 (20:58 +0000)
xsl/epub/bin/spec/epub_realbook_spec.rb
xsl/epub/bin/spec/tools/obfuscate_regression_submission.xsl [new file with mode: 0644]

index f62f6f149c298c6791d23b452f5c64b00c175dde..a57149f71e674c146e2eef51d2c6a3d8ccb5a340 100755 (executable)
@@ -14,7 +14,7 @@ require 'spec'
 
 require 'docbook'
 
-$DEBUG = true
+$DEBUG = false
 
 TESTDOCSDIR = File.expand_path(File.join(File.dirname(__FILE__), 'files'))
 
diff --git a/xsl/epub/bin/spec/tools/obfuscate_regression_submission.xsl b/xsl/epub/bin/spec/tools/obfuscate_regression_submission.xsl
new file mode 100644 (file)
index 0000000..fb7ffac
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
+  <xsl:output method="xml" omit-xml-declaration="no" doctype-public="-//OASIS//DTD DocBook XML V4.4//EN" doctype-system="http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" indent="no"/>
+<!-- Use this tool to obfuscate the text of a docment that you want to use as a test cast -->
+  <xsl:template match="@*|*|comment()|processing-instruction()">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()"/>
+    </xsl:copy>
+  </xsl:template>
+  <xsl:template match="text()">
+    <xsl:value-of select="replace(replace(., '[a-z]', 'x'), '[0-9]', 'd')"/>
+  </xsl:template>
+</xsl:stylesheet>