One Level Up
Top Level
docs/xslt/changes.xslt - nginx source code
Global variables defined
Source code
- xml version="1.0" encoding="utf-8"
- <xslstylesheet xmlnsxsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsloutput method="text"/>
- <xslparam select="'en'" name="lang"/>
- <xslparam select="'../xml/change_log_conf.xml'" name="configuration"/>
- <xslvariable select="document($configuration)/configuration" name="conf"/>
- <xslvariable select="$conf/start" name="start"/>
- <xslvariable select="$conf/indent" name="indent"/>
- <xslvariable select="$conf/length" name="max"/>
- <xslvariable name="br"><br></xslvariable>
- <xsltemplate match="/"> <xslapply-templates select="change_log"/> </xsltemplate>
- <xsltemplate match="change_log"> <xslapply-templates select="changes"/> </xsltemplate>
- <xsltemplate match="changes">
- <xsltext> </xsltext>
- <xslvalue-of select="substring(concat($conf/changes[@lang=$lang]/title,
- //change_log/@title,
- ' ', @ver,
- ' '),
- 1, $conf/changes[@lang=$lang]/length)"/>
- <xslif test="$lang='ru'">
- <xslvalue-of select="substring(@date, 9, 2)"/>
- <xsltext>.</xsltext>
- <xslvalue-of select="substring(@date, 6, 2)"/>
- <xsltext>.</xsltext>
- <xslvalue-of select="substring(@date, 1, 4)"/>
- </xslif>
- <xslif test="$lang='en'">
- <xslvalue-of select="substring(@date, 9, 2)"/>
- <xslvalue-of select="$conf/changes[@lang=$lang]/month[number(substring(current()/@date,
- 6, 2))]"/>
- <xslvalue-of select="substring(@date, 1, 4)"/>
- </xslif>
- <xsltext> </xsltext>
- <xslapply-templates select="change"/>
- <xsltext> </xsltext>
- </xsltemplate>
- <xsltemplate match="change">
- <xslvariable select="$conf/changes[@lang=$lang]/*[local-name(.)=current()/@type]" name="prefix"/>
- <xslvariable name="postfix"> <xslif test="$prefix"> <xsltext>: </xsltext> </xslif> </xslvariable>
- <xslapply-templates select="para[@lang=$lang]"><xslwith-param select="concat($start, $prefix, $postfix)" name="prefix"/></xslapply-templates>
- </xsltemplate>
- <xsltemplate name="para" match="para"><xslparam name="prefix"/>
- <xslvariable name="text"> <xslapply-templates/> </xslvariable>
- <xsltext> </xsltext>
- <xslcall-template name="wrap"><xslwith-param select="normalize-space($text)" name="text"/><xslwith-param name="prefix"> <xslchoose><xslwhen test="position() = 1"> <xslvalue-of select="$prefix"/> </xslwhen><xslotherwise> <xslvalue-of select="$indent"/> </xslotherwise></xslchoose> </xslwith-param></xslcall-template></xsltemplate>
- <xsltemplate name="wrap"><xslparam name="text"/><xslparam name="prefix"/>
- <xslif test="$text">
- <xslvariable name="offset">
- <xslchoose>
- <xslwhen test="starts-with($text, concat($br, ' '))">
- <xslvalue-of select="string-length($br) + 2"/>
- </xslwhen>
- <xslwhen test="starts-with($text, $br)">
- <xslvalue-of select="string-length($br) + 1"/>
- </xslwhen>
- <xslotherwise>
- 1
- </xslotherwise>
- </xslchoose>
- </xslvariable>
- <xslvariable name="length">
- <xslcall-template name="length"><xslwith-param select="substring($text, $offset)" name="text"/><xslwith-param select="string-length($prefix)" name="prefix"/><xslwith-param select="$max" name="length"/></xslcall-template></xslvariable>
- <xslvalue-of select="$prefix"/>
- <xslvalue-of select="normalize-space(translate(substring($text, $offset, $length),
- ' ', ' '))"/>
- <xsltext> </xsltext>
- <xslcall-template name="wrap"><xslwith-param select="substring($text, $length + $offset)" name="text"/><xslwith-param select="$indent" name="prefix"/></xslcall-template></xslif>
- </xsltemplate>
- <xsltemplate name="length"><xslparam name="text"/><xslparam name="prefix"/><xslparam name="length"/>
- <xslvariable select="substring-before(substring($text, 1,
- $length - $prefix + string-length($br)),
- $br)" name="break"/>
- <xslchoose>
- <xslwhen test="$break"> <xslvalue-of select="string-length($break)"/> </xslwhen>
- <xslwhen test="$length = 0"> <xslvalue-of select="$max - $prefix"/> </xslwhen>
- <xslwhen test="string-length($text) + $prefix <= $length">
- <xslvalue-of select="$length - $prefix"/>
- </xslwhen>
- <xslwhen test="substring($text, $length - $prefix + 1, 1) = ' '">
- <xslvalue-of select="$length - $prefix + 1"/>
- </xslwhen>
- <xslotherwise>
- <xslcall-template name="length"><xslwith-param select="$text" name="text"/><xslwith-param select="$prefix" name="prefix"/><xslwith-param select="$length - 1" name="length"/></xslcall-template></xslotherwise>
- </xslchoose>
- </xsltemplate>
- <xsltemplate match="at">@</xsltemplate>
- <xsltemplate match="br"> <xslvalue-of select="$br"/> </xsltemplate>
- <xsltemplate match="nobr"> <xslvalue-of select="translate(., ' ', ' ')"/> </xsltemplate>
- </xslstylesheet>
One Level Up
Top Level