- xslts/canonicalize.xslt
Return a wdef under its normal form.
+ - xslts/remove_labels_descriptions.xslt
+ Return a wdef with labels and description removed for a given element.
+
- xslts/replace_id.xslt
Change the wdef:id of an element and its references.
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:wdef="https://purl.choffet.net/wdef"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<!-- remove_labels_descriptions.xslt - Remove labels and descritions in an element.
+ Copyright (C) 2020, 2021, 2022 Pierre Choffet
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of version 3 of the GNU General Public License as
+ published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ -->
+ <xsl:output method="xml" encoding="utf-8" indent="yes" />
+ <xsl:strip-space elements="*"/>
+
+ <xsl:param name="wdef-id" />
+
+ <xsl:template match="node()|@*">
+ <xsl:copy>
+ <xsl:apply-templates select="node()|@*" />
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="wdef:label|wdef:description">
+ <xsl:if test="not(../@wdef:id) or ../@wdef:id != $wdef-id">
+ <xsl:copy>
+ <xsl:apply-templates select="node()|@*" />
+ </xsl:copy>
+ </xsl:if>
+ </xsl:template>
+</xsl:stylesheet>