Skip to content

Instantly share code, notes, and snippets.

View gimsieke's full-sized avatar

Gerrit Imsieke gimsieke

View GitHub Profile
@gimsieke
gimsieke / dtdanalyzer
Created November 3, 2012 14:20
dtdanalyzer frontend script for Cygwin + Windows Java
#!/bin/bash
cygwin=false;
case "`uname`" in
CYGWIN*) cygwin=true;
esac
# Figure out DTDANALYZER_HOME, which is the directory in which this script
# resides.
DTDANALYZER_HOME="$( cd -P "$(dirname $( readlink -f "${BASH_SOURCE[0]}" ))" && pwd )"
@gimsieke
gimsieke / gist:3846098
Created October 6, 2012 20:58
IDML madness
<!-- Remove a Br at the end of a story, a footnote, or a table cell (with no content after it).
These Brs have been inserted in the previous pass, after each paragraph, and they should
be removed as they insert additional and unwanted empty lines.
Ok, the pattern's predicate looks weird. Suggestions on how to simplify it? -->
<xsl:template mode="xml2idml:storify_content-n-cleanup"
match="Br[for $scoper in ancestor::*[idml2xml:is-scope-origin(.)][1]
(: a let statement might come in handy here – if only for the sake of syntactic sweetness :)
return
current() is (
$scoper//*[name() = $idml2xml:idml-scope-terminal-names]