Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-02-19 11:30:49 -0500
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-02-19 11:30:49 -0500
commit1f545a11ff08bf29595caad81ef997abc75a31af (patch)
tree1c28a76bf6bbbd9c6b51efd9725d8e2ffabdfa61
parentf15a1bb063ce52fed5aa122ea1436be2c1ee2b85 (diff)
downloadtame-1f545a11ff08bf29595caad81ef997abc75a31af.tar.gz
tame-1f545a11ff08bf29595caad81ef997abc75a31af.tar.bz2
tame-1f545a11ff08bf29595caad81ef997abc75a31af.zip
preproc: Expand templates in extracted classesv2.9.1
any/all blocks within classifications are extracted into their own classifications. When they have sibling nodes, the extracted classifications did not have their templates expanded. Ouch.
-rw-r--r--src/current/include/preproc/macros.xsl27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/current/include/preproc/macros.xsl b/src/current/include/preproc/macros.xsl
index 5b2a966..8b1bcde 100644
--- a/src/current/include/preproc/macros.xsl
+++ b/src/current/include/preproc/macros.xsl
@@ -202,15 +202,36 @@
<!--
+ We can't accurately determine how to rewrite classifications if tempaltes
+ have not yet been expanded.
+-->
+<xsl:template mode="preproc:macros" priority="9"
+ match="lv:classify[ t:* ]">
+ <xsl:copy>
+ <xsl:sequence select="@*" />
+
+ <xsl:apply-templates mode="preproc:macros"
+ select="*" />
+ </xsl:copy>
+
+ <preproc:repass src="lv:classify wait on template expansion" />
+</xsl:template>
+
+
+<!--
Classifications containing only an lv:any child node can be converted into
existential classifications
-->
-<xsl:template match="lv:classify[ lv:any and count(lv:*) = 1 ]" mode="preproc:macros" priority="8">
+<xsl:template mode="preproc:macros" priority="8"
+ match="lv:classify[
+ lv:any
+ and count( lv:* ) = 1
+ and not( preproc:tpl-barrier/lv:* ) ]">
<xsl:copy>
<xsl:sequence select="@*" />
<xsl:attribute name="any" select="'true'" />
- <xsl:sequence select="lv:any/*" />
+ <xsl:sequence select="*" />
</xsl:copy>
<preproc:repass src="lv:classify any" />
@@ -279,7 +300,7 @@
<xsl:template match="preproc:*" mode="preproc:class-groupgen" priority="2">
<xsl:copy>
<xsl:sequence select="@*" />
- <xsl:apply-templates select="node()" mode="preproc:class-extract" />
+ <xsl:apply-templates select="node()" mode="preproc:class-groupgen" />
</xsl:copy>
</xsl:template>