aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/aux-files/xml/patch-catalog-xml.xsl
blob: 947517476d6b4e715e8c0ffc414f16fc1370660a (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?xml version="1.0" encoding="UTF-8"?>
<!--
SPDX-FileCopyrightText: 2023 Bruno Victal <mirai@makinata.eu>
SPDX-License-Identifier: ISC

Fix uri attributes to point to paths in the store.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="xml"/>
  <xsl:param name="prefix">/</xsl:param>
  <!-- begin identity transform -->
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>
  <!-- end identity transform -->

  <xsl:template match="@uri">
    <xsl:attribute name="uri">
      <xsl:value-of select="concat('file://', $prefix, '/', .)"/>
    </xsl:attribute>
  </xsl:template>
</xsl:stylesheet>