forked from lantanagroup/stylesheets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsamples.xsl
23 lines (23 loc) · 827 Bytes
/
samples.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="1.0">
<xsl:output method="HTML" indent="yes" />
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="a[@href]">
<a>
<xsl:attribute name="href">
<xsl:value-of select="concat(substring-before(@href, '.xml'), '.html')" />
</xsl:attribute>
<xsl:value-of select="concat(substring-before(text(), '.xml'), '.html')" />
</a>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>