@@ -149,17 +149,17 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
149149<xsl : variable name =" exercise-style" select =" 'static'" />
150150
151151<!-- Short-Circuit -->
152- <!-- Sometimes we only want to convert to a "version" (valid PreTeXt) via -->
153- <!-- the resolution of version support and customizations. Examples are -->
154- <!-- determining publisher variables (for generating something like LaTeX -->
155- <!-- images, when we do not process the whole source) or performiong -->
156- <!-- validation. We control this with an internal variable, which is not -->
157- <!-- documented as an author or publisher feature. When we select only -->
158- <!-- the production of the "version" tree, the choice of "exercise-style" -->
159- <!-- is irrelevant. -->
152+ <!-- Sometimes we only want to stop at an intermediate tree. For example, -->
153+ <!-- we may convert only to a "version" (valid PreTeXt) via resolution of -->
154+ <!-- version support and customizations, or stop at the tree that has -->
155+ <!-- @assembly-id attributes but has not yet loaded exercise components. -->
156+ <!-- We control this with internal variables, not documented as author or -->
157+ <!-- publisher features. When we stop this early, "exercise-style" is -->
158+ <!-- irrelevant. -->
160159
161160<!-- default is empty, so we ccan detect non-use -->
162161<xsl : param name =" assembly.version-only" select =" ''" />
162+ <xsl : param name =" assembly.assembly-id-only" select =" ''" />
163163
164164<!-- Set to 'yes' to enable diagnostic checks, such as -->
165165<!-- verifying coherence of @assembly-id and @unique-id. -->
@@ -186,6 +186,25 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
186186</xsl : variable >
187187<xsl : variable name =" b-version-only" select =" $version-only = 'yes'" />
188188
189+ <!-- convert to a boolean, with error-checking -->
190+ <xsl : variable name =" assembly-id-only" >
191+ <xsl : choose >
192+ <xsl : when test =" $assembly.assembly-id-only = ''" >
193+ <xsl : text >no</xsl : text >
194+ </xsl : when >
195+ <xsl : when test =" $assembly.assembly-id-only = 'yes'" >
196+ <xsl : text >yes</xsl : text >
197+ </xsl : when >
198+ <xsl : when test =" $assembly.assembly-id-only = 'no'" >
199+ <xsl : text >no</xsl : text >
200+ </xsl : when >
201+ <xsl : otherwise >
202+ <xsl : message >PTX:BUG: the internal parameter assembly.assembly-id-only received an unrecognized value of "<xsl : value-of select =" $assembly.assembly-id-only" />" (possible values are "yes" and "no")</xsl : message >
203+ </xsl : otherwise >
204+ </xsl : choose >
205+ </xsl : variable >
206+ <xsl : variable name =" b-assembly-id-only" select =" $assembly-id-only = 'yes'" />
207+
189208<!-- ################################################ -->
190209<!-- Controlling Two-Pass Extraction and Substitution -->
191210<!-- ################################################ -->
@@ -506,7 +525,13 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
506525<xsl : variable name =" assembly-label" select =" exsl:node-set($assembly-label-rtf)" />
507526
508527<xsl : variable name =" representations-rtf" >
509- <xsl : apply-templates select =" $assembly-label" mode =" representations" />
528+ <xsl : choose >
529+ <!-- short-circuit to stop after adding @assembly-id -->
530+ <xsl : when test =" $b-assembly-id-only" />
531+ <xsl : otherwise >
532+ <xsl : apply-templates select =" $assembly-label" mode =" representations" />
533+ </xsl : otherwise >
534+ </xsl : choose >
510535</xsl : variable >
511536<xsl : variable name =" representations" select =" exsl:node-set($representations-rtf)" />
512537
0 commit comments