Mercurial > hg > nginx-site
diff 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 |
line wrap: on
line diff
--- a/xsls/link.xsls Wed Oct 19 08:30:46 2011 +0000 +++ b/xsls/link.xsls Wed Oct 19 10:39:49 2011 +0000 @@ -66,14 +66,20 @@ X:template = "link[@url]" { <a href="{@url}"> !!; </a> } -X:template = "link[@id and not(@doc)]" { <a href="#{@id}"> !!; </a> } +X:template = "link[@id and not(@doc)]" { + <a href="#{@id}"> + X:if "count(node()) != 0" { !!; } else { !{@id} } + </a> +} X:template = "link[@doc and not(@id)]" { <a href="{substring-before(@doc, '.xml')}.html"> !!; </a> } X:template = "link[@id and @doc]" { - <a href="{substring-before(@doc, '.xml')}.html#{@id}"> !!; </a> + <a href="{substring-before(@doc, '.xml')}.html#{@id}"> + X:if "count(node()) != 0" { !!; } else { !{@id} } + </a> } }