]> git.mxchange.org Git - friendica-addons.git/blob - retriever/view/extract.tpl
Merge pull request #114 from mexon/retriever
[friendica-addons.git] / retriever / view / extract.tpl
1 <?xml version="1.0" encoding="utf-8"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3
4   <xsl:template match="text()"/>
5
6   <xsl:template match="$include">
7     <xsl:copy>
8       <xsl:apply-templates select="node()|@*" mode="remove"/>
9     </xsl:copy>
10   </xsl:template>
11
12   <xsl:template match="node()|@*" mode="remove">
13     <xsl:copy>
14       <xsl:apply-templates select="node()|@*" mode="remove"/>
15     </xsl:copy>
16   </xsl:template>
17
18 {{ if $exclude }}
19   <xsl:template match="$exclude" mode="remove"/>
20 {{ endif }}
21
22   <!-- attempt to replace relative URLs with absolute URLs -->
23   <!-- http://stackoverflow.com/questions/3824631/replace-href-value-in-anchor-tags-of-html-using-xslt -->
24
25   <xsl:template match="*/@src[starts-with(.,'.')]" mode="remove">
26     <xsl:attribute name="src">
27       <xsl:value-of select="concat('$dirurl',.)"/>
28     </xsl:attribute>
29   </xsl:template>
30   <xsl:template match="*/@src[starts-with(.,'/')]" mode="remove">
31     <xsl:attribute name="src">
32       <xsl:value-of select="concat('$rooturl',.)"/>
33     </xsl:attribute>
34   </xsl:template>
35
36 </xsl:stylesheet>