view xsls/directive.xsls @ 144:273d7407de69

Replaced special "no default" value in the directive/default with "mdash".
author Ruslan Ermilov <ru@nginx.com>
date Tue, 25 Oct 2011 12:22:00 +0000
parents d3e240f7157c
children 28ba010fce96
line wrap: on
line source

X:stylesheet {

    X:template = "directive" {
        <a name="{@name}"/>
        <!-- <center><h4> !{@name} </h4></center> -->
        <div class="directive">
        <table cellspacing="0">
        !! "syntax";
        !! "default";
        !! "context";
        </table>
        X:if "(@appeared-in)" {
            <p>This directive appeared in version !{@appeared-in}.</p>
        }
        </div>
        !! "para";
    }

    X:template = "syntax" {
        X:if "position() = 1" {
            X:text disable-output-escaping="yes" {
                &lt;tr&gt;
                &lt;td&gt;
            }
            <strong>
            !{document(concat($XML, '/i18n.xml'))
                       /i18n/text[@lang = $LANG]/item[@id='syntax']}
            </strong>:
            X:text disable-output-escaping="yes" {
                &lt;/td&gt;
                &lt;td&gt;
            }
        }
        <code>
        !{../@name}
        X:if "count(node()) != 0" {
            X:text{ } !!;
        }
        X:if "@block = 'yes'" {
            X:text{ \{ ... \}}
        } else {
            X:text{;}
        }
        </code>
        <br/>
        X:if "position() = last()" {
            X:text disable-output-escaping="yes" {
                &lt;/td&gt;
                &lt;/tr&gt;
            }
        }
    }

    X:template = "default" {
        X:if "position() = 1" {
            X:text disable-output-escaping="yes" {
                &lt;tr&gt;
                &lt;td&gt;
            }
            <strong>
            !{document(concat($XML, '/i18n.xml'))
                       /i18n/text[@lang = $LANG]/item[@id='default']}
            </strong>:
            X:text disable-output-escaping="yes" {
                &lt;/td&gt;
                &lt;td&gt;
            }
        }
        X:if "count(node()) = 0" {
            &#8212;
        } else {
            <pre>
            !{../@name}
            X:if "count(../syntax[@block='yes'])" {
                X:text{ \{} !!; X:text{\}}
            } else {
                X:text{ } !!; X:text{;}
            }
            </pre>
        }
        X:if "position() = last()" {
            X:text disable-output-escaping="yes" {
                &lt;/td&gt;
                &lt;/tr&gt;
            }
        }
    }

    X:template = "context" {
        X:if "position() = 1" {
            X:text disable-output-escaping="yes" {
                &lt;tr&gt;
                &lt;td&gt;
            }
            <strong>
            !{document(concat($XML, '/i18n.xml'))
                       /i18n/text[@lang = $LANG]/item[@id='context']}
            </strong>:
            X:text disable-output-escaping="yes" {
                &lt;/td&gt;
                &lt;td&gt;
            }
        }
        X:if "count(node()) = 0" {
            <strong>
            !{document(concat($XML, '/i18n.xml'))
                       /i18n/text[@lang = $LANG]/item[@id='context.any']}
            </strong>
        } else {
            <code> !!; </code>
        }
        X:if "position() != last()" {
            X:text{, }
        } else {
            <br/>
            X:text disable-output-escaping="yes" {
                &lt;/td&gt;
                &lt;/tr&gt;
            }
        }
    }

}