From dca7becfa77c80d5ffc13025db6619c9202b63b5 Mon Sep 17 00:00:00 2001 From: Martin Goik <goik@hdm-stuttgart.de> Date: Fri, 22 Dec 2017 17:47:16 +0100 Subject: [PATCH] Strip IDEA promo string --- bin/stripIdeaPromo | 12 +++++++++ ws/Docbook/Preprocess/Extra/svgStripPromo.xsl | 27 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100755 bin/stripIdeaPromo create mode 100644 ws/Docbook/Preprocess/Extra/svgStripPromo.xsl diff --git a/bin/stripIdeaPromo b/bin/stripIdeaPromo new file mode 100755 index 000000000..0b78fe8ad --- /dev/null +++ b/bin/stripIdeaPromo @@ -0,0 +1,12 @@ +#!/bin/sh + +java -cp "/usr/share/hdm-docbook-xsl/docbook-xsl-1.79.2/tools/lib/saxon9he.jar:/usr/share/java/xercesImpl.jar" \ + -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl \ + -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration \ + net.sf.saxon.Transform \ +-s:$1 \ + -xsl:/usr/share/hdm-docbook-xsl/Preprocess/Extra/svgStripPromo.xsl + + + +#end diff --git a/ws/Docbook/Preprocess/Extra/svgStripPromo.xsl b/ws/Docbook/Preprocess/Extra/svgStripPromo.xsl new file mode 100644 index 000000000..37f3d7b35 --- /dev/null +++ b/ws/Docbook/Preprocess/Extra/svgStripPromo.xsl @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:xs="http://www.w3.org/2001/XMLSchema" + exclude-result-prefixes="xs svg" + version="2.0"> + + <xsl:output indent="yes"/> + + <xsl:template match="/ | @* | node()"> + <xsl:copy> + <xsl:apply-templates select="@* | node()" /> + </xsl:copy> + </xsl:template> + + <xsl:template match="svg:g[svg:path[6653 <= string-length(@d)]]"> + <xsl:message> + <xsl:text>Purged g[path/@d=</xsl:text> + <xsl:value-of select="svg:path[1]/@d"/> + <xsl:text>]</xsl:text> + </xsl:message> + <xsl:text>-----------------------</xsl:text> + </xsl:template> + + + +</xsl:stylesheet> \ No newline at end of file -- GitLab