1 <?xml version=
"1.0" encoding=
"UTF-8"?>
4 $ curl "https://links.mro.name/?do=tagcloud" | xsltproc - -html tagcloud-html2atom.xslt - | xmllint - -relaxng categories.rng -
6 http://www.w3.org/TR/xslt/
7 http://www.w3.org/TR/xpath/
8 https://tools.ietf.org/html/rfc5023#appendix-B
11 xmlns:
rdf=
"http://www.w3.org/1999/02/22-rdf-syntax-ns#"
12 xmlns:
dctype=
"http://purl.org/dc/dcmitype/"
13 xmlns=
"http://www.w3.org/2005/Atom"
14 xmlns:
app=
"http://www.w3.org/2007/app"
16 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
17 exclude-result-prefixes=
"dctype rdf"
20 <xsl:output method=
"xml" indent=
"yes"/>
22 <xsl:template match=
"/html">
24 https://tools.ietf.org/html/rfc5023#appendix-B
25 http://atomenabled.org/developers/protocol/#appCategories1
26 https://web.archive.org/web/
20130716150512/http://www.atomenabled.org:
80/developers/protocol/atom-protocol-spec.php#rfc.section
.8.3.3
27 https://web.archive.org/web/
20130716150512/http://www.atomenabled.org:
80/developers/protocol/atom-protocol-spec.php#schema
29 <app:categories scheme=
"?searchtags=">
30 <xsl:variable name=
"traditional_count_prefix" select=
"1 = count(.//a[starts-with(@href, '?searchtags=')][1]/preceding-sibling::*[1])"/>
32 <xsl:for-each select=
".//a[starts-with(@href, '?searchtags=')]">
33 <xsl:sort select=
"." data-type=
"text" order=
"ascending"/>
35 <xsl:variable name=
"count">
37 <xsl:when test=
"$traditional_count_prefix"><xsl:value-of select=
"preceding-sibling::*[1]"/></xsl:when>
38 <xsl:otherwise><xsl:value-of select=
"following-sibling::*[1]"/></xsl:otherwise>
42 <category term=
"{.}" foo:
count=
"{$count}"/>