comparison xsls/link.xsls @ 106:56457a474903

If text of the link is not provided, the @id is used.
author Ruslan Ermilov <ru@nginx.com>
date Wed, 19 Oct 2011 10:39:49 +0000
parents 12f1de4539b4
children 871ea104fdbf
comparison
equal deleted inserted replaced
105:1aa4f50144e4 106:56457a474903
64 64
65 X:template = "img" { <img src="{@href}"> !!; </img> } 65 X:template = "img" { <img src="{@href}"> !!; </img> }
66 66
67 X:template = "link[@url]" { <a href="{@url}"> !!; </a> } 67 X:template = "link[@url]" { <a href="{@url}"> !!; </a> }
68 68
69 X:template = "link[@id and not(@doc)]" { <a href="#{@id}"> !!; </a> } 69 X:template = "link[@id and not(@doc)]" {
70 <a href="#{@id}">
71 X:if "count(node()) != 0" { !!; } else { !{@id} }
72 </a>
73 }
70 74
71 X:template = "link[@doc and not(@id)]" { 75 X:template = "link[@doc and not(@id)]" {
72 <a href="{substring-before(@doc, '.xml')}.html"> !!; </a> 76 <a href="{substring-before(@doc, '.xml')}.html"> !!; </a>
73 } 77 }
74 78
75 X:template = "link[@id and @doc]" { 79 X:template = "link[@id and @doc]" {
76 <a href="{substring-before(@doc, '.xml')}.html#{@id}"> !!; </a> 80 <a href="{substring-before(@doc, '.xml')}.html#{@id}">
81 X:if "count(node()) != 0" { !!; } else { !{@id} }
82 </a>
77 } 83 }
78 84
79 } 85 }