Mercurial > hg > nginx-site
view xsls/link.xsls @ 2:a9879bd073c5
Don't (r)sync mod-time.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Thu, 11 Aug 2011 14:21:44 +0000 |
parents | 61e04fc01027 |
children | 9d3403f5204d |
line wrap: on
line source
X:stylesheet { <!-- {a href="/en/docs/page.xml" /} --> X:template = "a[starts-with(@href, '/') and string() = '' and contains(@href, '.xml')]" { <a> X:attribute "href" { <!-- -- variables are not allowed in a template match predicate: -- a[starts-with(@href, $DIRNAME) ... ] -- therefore, we have to test this using "if" --> X:if "starts-with(@href, $DIRNAME)" { <!-- convert to a link "docs/page.html" --> !{ substring-after(document(concat($XML, @href))/article/@link, $DIRNAME) } } else { <!-- convert to a link "../../../en/docs/page.html" --> !{ concat($ROOT, document(concat($XML, @href))/article/@link) } } } !{ document(concat($XML, @href))/article/@title } </a> } <!-- {a href="/en/docs/page.xml"} TEXT {/a} --> X:template = "a[starts-with(@href, '/') and string() and contains(@href, '.xml')]" { <a> X:attribute "href" { X:if "starts-with(@href, $DIRNAME)" { !{ substring-after(document(concat($XML, @href))/article/@link, $DIRNAME) } } else { !{ concat($ROOT, document(concat($XML, @href))/article/@link) } } } !!; </a> } X:template = "a" { <a href="{@href}"> !!; </a> } X:template = "img" { <img src="{@href}"> !!; </img> } }