Mercurial > hg > nginx-site
view xsls/link.xsls @ 37:b33866d80056
- Marketing data fixed to reflect latest September Netcraft survey
- SSL docs fixed to have correct !aNULL instead of !ADH
author | Andrey Alexeev <andrew@nginx.com> |
---|---|
date | Sat, 01 Oct 2011 11:14:09 +0000 |
parents | 2bcfb5f75e06 |
children | 666e85596e3c |
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))/article/@name |document(concat($XML, @href))/module/@title |document(concat($XML, @href))/module/@name } </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> } }