Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <gerwitzm@lovullo.com>2016-10-31 13:22:46 -0400
committerMike Gerwitz <gerwitzm@lovullo.com>2016-10-31 13:22:57 -0400
commit7508ac0063581d50a32c431abf6c96127a29f66d (patch)
tree4ff6fbbe1e5c4c96d375c81ab6476c35850d72df
parentea3ae797b342c53943fa0cf472fc1100cbc96049 (diff)
parent0c2ef00e517a14593c0283bc9738c23bebd450b3 (diff)
downloadtame-7508ac0063581d50a32c431abf6c96127a29f66d.tar.gz
tame-7508ac0063581d50a32c431abf6c96127a29f66d.tar.bz2
tame-7508ac0063581d50a32c431abf6c96127a29f66d.zip
lv:classify/@desc whitespace normalization
-rw-r--r--src/current/include/preproc/expand.xsl67
1 files changed, 20 insertions, 47 deletions
diff --git a/src/current/include/preproc/expand.xsl b/src/current/include/preproc/expand.xsl
index 31f331b..c8b2459 100644
--- a/src/current/include/preproc/expand.xsl
+++ b/src/current/include/preproc/expand.xsl
@@ -488,52 +488,6 @@
<xsl:variable name="self" select="." />
<xsl:copy>
- <!-- we just want to add an attribute that allows easy referencing of this
- @yields set type, which will be a matrix if any matches match on a
- matrix of values, otherwise it will be a vector -->
- <xsl:attribute name="set">
- <xsl:variable name="params"
- select="root(.)//lv:param[ @name=$self//lv:match/@on ]" />
-
- <xsl:choose>
- <!-- XXX: This does not work properly with classes depending on other
- classes -->
- <xsl:when test="$params/@set = 'matrix'">
- <xsl:text>matrix</xsl:text>
- </xsl:when>
-
- <!-- XXX: remove this when the above is fixed...note also that we have
- to check for lv:join since it hasn't necessarily been preprocessed
- yet...what a mess. Also note that, since templates and other things
- may not have been expanded, we also fail this test if the
- classification does not match on either a param or another
- classification (since then things will get more complicated)-->
- <xsl:when test="
- not(
- $self//lv:match
- or $self//lv:join
- )
- or (
- not( $params/@set )
- and not(
- .//lv:match[ @on=root(.)/lv:classify/@yields ]
- )
- and not( .//lv:join )
- and (
- $params
- or .//lv:match[ @on=root(.)/lv:classify ]
- )
- )
- ">
- <!-- output nothing; it's just a scalar -->
- </xsl:when>
-
- <xsl:otherwise>
- <xsl:text>vector</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
-
<!-- if there is no @yields attribute, then generate one -->
<xsl:if test="not( @yields )">
<xsl:attribute name="yields">
@@ -543,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'">
@@ -556,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