-
Notifications
You must be signed in to change notification settings - Fork 2
/
extractlinks.xsl
32 lines (28 loc) · 1015 Bytes
/
extractlinks.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="html"
>
<xsl:output
method="text"
/>
<xsl:template match="//body">
<xsl:apply-templates select="//a">
<xsl:sort select="@href"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="//a[contains(@class, 'lend prime')] | //a[contains(@class, 'reserve')]">
<xsl:value-of select="@href"/><xsl:text> </xsl:text><xsl:value-of select="@title"/>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="//a[contains(@class, 'stretched-link')]">
<xsl:value-of select="@href"/><xsl:text> </xsl:text><xsl:value-of select="substring(@title, 11)"/>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="text()"/> <!-- remove all text -->
</xsl:stylesheet>