changeset 491:5a3362234a4d

If text of the link given by URL is not provided, the URL is used.
author Ruslan Ermilov <ru@nginx.com>
date Thu, 19 Apr 2012 12:44:09 +0000
parents 9913f1d51c07
children 2a061496979a
files xsls/link.xsls
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/xsls/link.xsls	Thu Apr 19 12:30:24 2012 +0000
+++ b/xsls/link.xsls	Thu Apr 19 12:44:09 2012 +0000
@@ -2,7 +2,11 @@
 
 X:template = "img" { <img src="{@href}"> !!; </img> }
 
-X:template = "link[@url]" { <a href="{@url}"> !!; </a> }
+X:template = "link[@url]" {
+    <a href="{@url}">
+    X:if "count(node()) != 0" { !!; } else { !{@url} }
+    </a>
+}
 
 X:template = "link[@id and not(@doc)]" {
     <a href="#{@id}">