Mercurial > hg > nginx-site
view xsls/link.xsls @ 22:9d3403f5204d
nginx-1.1.3, ngx_http_mp4_module
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 14 Sep 2011 15:05:04 +0000 |
parents | 61e04fc01027 |
children | 2bcfb5f75e06 |
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 |document(concat($XML, @href))/module/@link, $DIRNAME) } } else { <!-- convert to a link "../../../en/docs/page.html" --> !{ concat($ROOT, document(concat($XML, @href))/article/@link |document(concat($XML, @href))/module/@link) } } } !{ document(concat($XML, @href))/article/@title |document(concat($XML, @href))/module/@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 |document(concat($XML, @href))/module/@link, $DIRNAME) } } else { !{ concat($ROOT, document(concat($XML, @href))/article/@link |document(concat($XML, @href))/module/@link) } } } !!; </a> } X:template = "a" { <a href="{@href}"> !!; </a> } X:template = "img" { <img src="{@href}"> !!; </img> } }