]> git.mxchange.org Git - friendica-addons.git/blobdiff - retriever/templates/extract.tpl
Merge remote-tracking branch 'upstream/master' into retriever
[friendica-addons.git] / retriever / templates / extract.tpl
diff --git a/retriever/templates/extract.tpl b/retriever/templates/extract.tpl
new file mode 100644 (file)
index 0000000..36b9181
--- /dev/null
@@ -0,0 +1,41 @@
+{{*
+ *     AUTOMATICALLY GENERATED TEMPLATE
+ *     DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
+ *
+ *}}
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+  <xsl:template match="text()"/>
+
+  <xsl:template match="{{$include}}">
+    <xsl:copy>
+      <xsl:apply-templates select="node()|@*" mode="remove"/>
+    </xsl:copy>
+  </xsl:template>
+
+  <xsl:template match="node()|@*" mode="remove">
+    <xsl:copy>
+      <xsl:apply-templates select="node()|@*" mode="remove"/>
+    </xsl:copy>
+  </xsl:template>
+
+{{if $exclude}}
+  <xsl:template match="{{$exclude}}" mode="remove"/>
+{{/if}}
+
+  <!-- attempt to replace relative URLs with absolute URLs -->
+  <!-- http://stackoverflow.com/questions/3824631/replace-href-value-in-anchor-tags-of-html-using-xslt -->
+
+  <xsl:template match="*/@src[starts-with(.,'.')]" mode="remove">
+    <xsl:attribute name="src">
+      <xsl:value-of select="concat('{{$dirurl}}',.)"/>
+    </xsl:attribute>
+  </xsl:template>
+  <xsl:template match="*/@src[starts-with(.,'/')]" mode="remove">
+    <xsl:attribute name="src">
+      <xsl:value-of select="concat('{{$rooturl}}',.)"/>
+    </xsl:attribute>
+  </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file