From f38e6c896b88193cc38fae0fe5be07a2e9e864ea Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Fri, 8 Dec 2017 14:44:26 -0500 Subject: [PATCH] Add template barriers for metadata This (hopefully) prevents metadata from leaking outside of template expansions where they are not wanted. * src/current/include/preproc/macros.xsl (preproc:macropass): Strip cruft (new barrier nodes) on final pass. * src/current/include/preproc/template.xsl (preproc:expand-template): Enclose template expansion in preproc:tpl-barrier (which is stripped on the final pass). (preproc:apply-template)[lv:param-meta]: Document template. "Hoist" node (set attribute) if not contained within lv:param-copy. (preproc:gen-param-value)[lv:param-inherit]: Consider hoisted nodes behind barrier. --- src/current/include/preproc/macros.xsl | 7 +-- src/current/include/preproc/template.xsl | 67 +++++++++++++++++++----- 2 files changed, 57 insertions(+), 17 deletions(-) diff --git a/src/current/include/preproc/macros.xsl b/src/current/include/preproc/macros.xsl index 234632f5..38721fd7 100644 --- a/src/current/include/preproc/macros.xsl +++ b/src/current/include/preproc/macros.xsl @@ -2,7 +2,7 @@ + - + diff --git a/src/current/include/preproc/template.xsl b/src/current/include/preproc/template.xsl index 7e80f599..6d7644e3 100644 --- a/src/current/include/preproc/template.xsl +++ b/src/current/include/preproc/template.xsl @@ -305,21 +305,23 @@ template; this inlines it as if it were copied and pasted directly into the XML, much like a C macro --> - + + - - - + + + - - - + + + + + + + + + + + + + + + + + + + + @@ -579,7 +612,11 @@ - + + + + + @@ -985,6 +1022,8 @@