]> Pierre Choffet | Git repositories - wdef_tools.git/blob - xslts/remove_labels_descriptions.xslt
Add script to compare with Wikidata’s RDF
[wdef_tools.git] / xslts / remove_labels_descriptions.xslt
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="1.0" xmlns:wdef="https://purl.choffet.net/wdef"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4 <!-- remove_labels_descriptions.xslt - Remove labels and descritions in an element.
5 Copyright (C) 2020, 2021, 2022 Pierre Choffet
6
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of version 3 of the GNU General Public License as
9 published by the Free Software Foundation.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 -->
19 <xsl:output method="xml" encoding="utf-8" indent="yes" />
20 <xsl:strip-space elements="*"/>
21
22 <xsl:param name="wdef-id" />
23
24 <xsl:template match="node()|@*">
25 <xsl:copy>
26 <xsl:apply-templates select="node()|@*" />
27 </xsl:copy>
28 </xsl:template>
29
30 <xsl:template match="wdef:label|wdef:description">
31 <xsl:if test="not(../@wdef:id) or ../@wdef:id != $wdef-id">
32 <xsl:copy>
33 <xsl:apply-templates select="node()|@*" />
34 </xsl:copy>
35 </xsl:if>
36 </xsl:template>
37 </xsl:stylesheet>