1 <?xml version=
"1.0" encoding=
"UTF-8"?>
4 Copyright (c) 2015-2016 Marcus Rohrmoser http://mro.name/me. All rights reserved.
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 Find all 'delete_link' POST forms and list lf_linkdate and token.
22 $ xsltproc - -html ../tests/test-delete-ok.sh.xslt curl.tmp.html
24 http://www.w3.org/TR/xslt
27 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
28 exclude-result-prefixes=
"xsl"
30 <xsl:output method=
"text"/>
32 <xsl:template match=
"/">
33 <xsl:for-each select=
"html/body//form[.//input/@name='delete_link' and .//input/@name='lf_linkdate' and .//input/@name='token']">
34 <xsl:variable name=
"lf_linkdate" select=
".//input[@name='lf_linkdate']/@value"/>
35 <xsl:variable name=
"token" select=
".//input[@name='token']/@value"/>
36 <xsl:value-of select=
"$lf_linkdate"/><xsl:text> </xsl:text><xsl:value-of select=
"$token"/><xsl:text>
39 <xsl:for-each select=
"html/body//a[contains(@href, '?delete_link=') and contains(@href, '&token=')]">
40 <xsl:variable name=
"lf_linkdate" select=
"substring-before(substring-after(@href,'?delete_link='), '&token=')"/>
41 <xsl:variable name=
"token" select=
"substring-after(@href,'&token=')"/>
42 <xsl:value-of select=
"$lf_linkdate"/><xsl:text> </xsl:text><xsl:value-of select=
"$token"/><xsl:text>