comparison xsls/link.xsls @ 375:fa74f8061fc5

Removed the "a" element.
author Ruslan Ermilov <ru@nginx.com>
date Mon, 30 Jan 2012 10:53:50 +0000
parents 978b9e3897f7
children 04ad7c1b1b04
comparison
equal deleted inserted replaced
374:a413dffb0557 375:fa74f8061fc5
1 X:stylesheet { 1 X:stylesheet {
2
3
4 <!-- {a href="/en/docs/page.xml" /} -->
5
6 X:template = "a[starts-with(@href, '/')
7 and string() = ''
8 and contains(@href, '.xml')]"
9 {
10 <a>
11 X:attribute "href" {
12
13 <!--
14 -- variables are not allowed in a template match predicate:
15 -- a[starts-with(@href, $DIRNAME) ... ]
16 -- therefore, we have to test this using "if"
17 -->
18
19 X:if "starts-with(@href, $DIRNAME)" {
20
21 <!-- convert to a link "docs/page.html" -->
22
23 !{ substring-after(document(concat($XML, @href))/article/@link
24 |document(concat($XML, @href))/module/@link,
25 $DIRNAME) }
26 } else {
27
28 <!-- convert to a link "../../../en/docs/page.html" -->
29
30 !{ concat($ROOT, document(concat($XML, @href))/article/@link
31 |document(concat($XML, @href))/module/@link) }
32 }
33 }
34 !{ document(concat($XML, @href))/article/@name
35 |document(concat($XML, @href))/module/@name }
36 </a>
37 }
38
39
40 <!-- {a href="/en/docs/page.xml"} TEXT {/a} -->
41
42 X:template = "a[starts-with(@href, '/')
43 and string()
44 and contains(@href, '.xml')]"
45 {
46 <a>
47 X:attribute "href" {
48 X:if "starts-with(@href, $DIRNAME)" {
49 !{ substring-after(document(concat($XML, @href))/article/@link
50 |document(concat($XML, @href))/module/@link,
51 $DIRNAME) }
52 } else {
53 !{ concat($ROOT, document(concat($XML, @href))/article/@link
54 |document(concat($XML, @href))/module/@link) }
55 }
56 }
57 !!;
58 </a>
59 }
60
61 X:template = "a" { <a href="{@href}"> !!; </a> }
62 2
63 X:template = "img" { <img src="{@href}"> !!; </img> } 3 X:template = "img" { <img src="{@href}"> !!; </img> }
64 4
65 X:template = "link[@url]" { <a href="{@url}"> !!; </a> } 5 X:template = "link[@url]" { <a href="{@url}"> !!; </a> }
66 6