1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <xsl:stylesheet version=
"2.0"
3 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform">
4 <xsl:output method=
"text" indent=
"no" />
6 <xsl:template match=
"/html">
7 <xsl:apply-templates select=
"body//a[@href]" />
8 <xsl:apply-templates select=
"body//img[@src]" />
11 <xsl:template match=
"/html/body//a[@href]">
12 <xsl:if test=
"not(starts-with(@href,'http://') or starts-with(@href,'https://') or starts-with(@href,'mailto:'))">
13 <xsl:value-of select=
"/html/head/base/@href" />
15 <xsl:when test=
"contains(@href,'#')">
16 <xsl:value-of select=
"replace(substring-before(@href,'#'),'%25','%')" />
19 <xsl:value-of select=
"replace(@href,'%25','%')" />
22 <xsl:text> </xsl:text>
26 <xsl:template match=
"/html/body//img[@src]">
27 <xsl:value-of select=
"replace(@src,'%25','%')" /><xsl:text> </xsl:text>