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