diff options
author | Mike Gerwitz <gerwitzm@lovullo.com> | 2016-10-25 11:40:08 -0400 |
---|---|---|
committer | Mike Gerwitz <gerwitzm@lovullo.com> | 2016-10-25 11:40:08 -0400 |
commit | 0c2ef00e517a14593c0283bc9738c23bebd450b3 (patch) | |
tree | 4ff6fbbe1e5c4c96d375c81ab6476c35850d72df | |
parent | 5a9fb0d142103f954a73d69e8bd7c6a9158d287b (diff) | |
download | tame-0c2ef00e517a14593c0283bc9738c23bebd450b3.tar.gz tame-0c2ef00e517a14593c0283bc9738c23bebd450b3.tar.bz2 tame-0c2ef00e517a14593c0283bc9738c23bebd450b3.zip |
lv:classify/@desc whitespace normalization during macropass
This allows for nice formatting with newlines (to avoid excessively long
lines) without affecting the output.
* src/current/include/preproc/expand.xsl
(preproc:expand lv:classify/@desc): Normalize lv:classify/@desc whitespace
-rw-r--r-- | src/current/include/preproc/expand.xsl | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/current/include/preproc/expand.xsl b/src/current/include/preproc/expand.xsl index 018da81..c8b2459 100644 --- a/src/current/include/preproc/expand.xsl +++ b/src/current/include/preproc/expand.xsl @@ -497,7 +497,8 @@ </xsl:attribute> </xsl:if> - <xsl:sequence select="@*" /> + <xsl:apply-templates mode="preproc:expand" + select="@*" /> <!-- force @keep on @terminate --> <xsl:if test="@terminate='true'"> @@ -510,6 +511,24 @@ </xsl:template> +<!-- + Normalize whitespace for class descriptions +--> +<xsl:template mode="preproc:expand" priority="5" + match="lv:classify/@desc"> + <xsl:attribute name="desc" + select="normalize-space( . )" /> +</xsl:template> + +<!-- + All other class attributes are copied verbatim +--> +<xsl:template mode="preproc:expand" priority="1" + match="lv:classify/@*"> + <xsl:sequence select="." /> +</xsl:template> + + <!-- default lv:match/@on short-hand to assert on a value of TRUE --> <xsl:template match="lv:match[ not( @value or @anyOf |