|
| 1 | +<?xml version='1.0'?> |
| 2 | + |
| 3 | +<!--******************************************************************** |
| 4 | +Copyright 2026 Robert A. Beezer |
| 5 | +
|
| 6 | +This file is part of PreTeXt. |
| 7 | +
|
| 8 | +PreTeXt is free software: you can redistribute it and/or modify |
| 9 | +it under the terms of the GNU General Public License as published by |
| 10 | +the Free Software Foundation, either version 2 or version 3 of the |
| 11 | +License (at your option). |
| 12 | +
|
| 13 | +PreTeXt is distributed in the hope that it will be useful, |
| 14 | +but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | +GNU General Public License for more details. |
| 17 | +
|
| 18 | +You should have received a copy of the GNU General Public License |
| 19 | +along with PreTeXt. If not, see <http://www.gnu.org/licenses/>. |
| 20 | +*********************************************************************--> |
| 21 | + |
| 22 | +<!-- This stylesheet locates "program[@pck]" elements and prepares --> |
| 23 | +<!-- a file necessary to zip a "pck" for each activecode with --> |
| 24 | +<!-- GDScript. --> |
| 25 | + |
| 26 | +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" |
| 27 | + xmlns:xml="http://www.w3.org/XML/1998/namespace" |
| 28 | + xmlns:exsl="http://exslt.org/common" |
| 29 | + xmlns:str="http://exslt.org/strings" |
| 30 | + extension-element-prefixes="exsl" |
| 31 | +> |
| 32 | + |
| 33 | +<!-- Get internal ID's for filenames, etc --> |
| 34 | +<!-- Standard conversion groundwork --> |
| 35 | +<xsl:import href="./publisher-variables.xsl"/> |
| 36 | +<xsl:import href="./pretext-assembly.xsl"/> |
| 37 | +<xsl:import href="./pretext-common.xsl"/> |
| 38 | + |
| 39 | +<!-- Get a "subtree" xml:id value --> |
| 40 | +<!-- Then walk the XML source tree --> |
| 41 | +<!-- applying specializations below --> |
| 42 | +<xsl:import href="./extract-identity.xsl" /> |
| 43 | +<xsl:output method="text" encoding="UTF-8"/> |
| 44 | + |
| 45 | +<!-- PreTeXt override: force dynamic exercise processing so that the --> |
| 46 | +<!-- "unique-id" template computes identifiers matching the interactive --> |
| 47 | +<!-- web target rather than a static print target. --> |
| 48 | +<xsl:variable name="exercise-style" select="'dynamic'"/> |
| 49 | + |
| 50 | +<!-- Unique id, pck, scene name, and version as a comma-separated quadruple per line --> |
| 51 | +<xsl:template match="program[@pck and @interactive='activecode']" mode="extraction"> |
| 52 | + <xsl:apply-templates select="." mode="unique-id" /> |
| 53 | + <xsl:text>,</xsl:text> |
| 54 | + <xsl:value-of select="@pck" /> |
| 55 | + <xsl:text>,</xsl:text> |
| 56 | + <xsl:value-of select="@scene" /> |
| 57 | + <xsl:text>,</xsl:text> |
| 58 | + <xsl:value-of select="$godot.version" /> |
| 59 | + <xsl:text>
</xsl:text> <!-- newline --> |
| 60 | +</xsl:template> |
| 61 | +</xsl:stylesheet> |
0 commit comments