mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-09 01:48:48 +00:00
Retriever version 1.0
This commit is contained in:
parent
381e23da12
commit
45cc7c6cd1
7 changed files with 236 additions and 138 deletions
|
@ -1,18 +1,26 @@
|
|||
{{*
|
||||
* 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}}">
|
||||
{{function clause_xpath}}
|
||||
{{if !$clause.attribute}}
|
||||
{{$clause.element}}{{elseif $clause.attribute == 'class'}}
|
||||
{{$clause.element}}[contains(concat(' ', normalize-space(@class), ' '), '{{$clause.value}}')]{{else}}
|
||||
{{$clause.element}}[@{{$clause.attribute}}='{{$clause.value}}']{{/if}}
|
||||
{{/function}}
|
||||
|
||||
{{foreach $spec.include as $clause}}
|
||||
<xsl:template match="{{clause_xpath clause=$clause}}">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="node()|@*" mode="remove"/>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
{{/foreach}}
|
||||
|
||||
{{foreach $spec.exclude as $clause}}
|
||||
<xsl:template match="{{clause_xpath clause=$clause}}" mode="remove"/>
|
||||
{{/foreach}}
|
||||
|
||||
<xsl:template match="node()|@*" mode="remove">
|
||||
<xsl:copy>
|
||||
|
@ -20,22 +28,4 @@
|
|||
</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>
|
||||
</xsl:stylesheet>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue