This software is dual-licensed:
1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
Unported License http://creativecommons.org/licenses/by-sa/3.0/
2. http://www.opensource.org/licenses/BSD-2-Clause
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
This software is provided by the copyright holders and contributors
"as is" and any express or implied warranties, including, but not
limited to, the implied warranties of merchantability and fitness for
a particular purpose are disclaimed. In no event shall the copyright
holder or contributors be liable for any direct, indirect, incidental,
special, exemplary, or consequential damages (including, but not
limited to, procurement of substitute goods or services; loss of use,
data, or profits; or business interruption) however caused and on any
theory of liability, whether in contract, strict liability, or tort
(including negligence or otherwise) arising in any way out of the use
of this software, even if advised of the possibility of such damage.
<xsl:template match="tei:ptr|tei:ref" mode="weave"><xsl:choose><xsl:when test="ancestor::tei:remarks or ancestor::tei:listRef or ancestor::tei:valDesc"><xsl:choose><xsl:when test="starts-with(@target,'#') and id(substring(@target,2))"><xsl:call-template name="makeInternalLink"><xsl:with-param name="target" select="substring(@target,2)"/><xsl:with-param name="ptr" select="if (self::tei:ptr) then true() else false()"/><xsl:with-param name="dest"><xsl:call-template name="generateEndLink"><xsl:with-param name="where"><xsl:value-of select="substring(@target,2)"/></xsl:with-param></xsl:call-template></xsl:with-param></xsl:call-template></xsl:when><xsl:when test="starts-with(@target,'#')"><xsl:variable name="Chapter"><xsl:value-of select="substring(@target,2,2)"/></xsl:variable><xsl:choose><xsl:when test="$Chapter='AB' or $Chapter='AI' or $Chapter='CC' or $Chapter='CE' or $Chapter='CH' or $Chapter='CO' or $Chapter='DI' or $Chapter='DR' or $Chapter='DS' or $Chapter='FS' or $Chapter='FT' or $Chapter='GD' or $Chapter='HD' or $Chapter='MS' or $Chapter='ND' or $Chapter='NH' or $Chapter='PH' or $Chapter='SA' or $Chapter='SG' or $Chapter='ST' or $Chapter='TC' or $Chapter='TD' or $Chapter='TS' or $Chapter='USE' or $Chapter='VE' or $Chapter='WD'"><xsl:call-template name="makeExternalLink"><xsl:with-param name="ptr" select="if (self::tei:ptr) then true() else false()"/><xsl:with-param name="dest"><xsl:text>http://www.tei-c.org/release/doc/tei-p5-doc/</xsl:text><xsl:value-of select="$documentationLanguage"/><xsl:text>/html/</xsl:text><xsl:value-of select="$Chapter"/><xsl:text>.html</xsl:text><xsl:value-of select="@target"/></xsl:with-param></xsl:call-template></xsl:when><xsl:otherwise><xsl:text>«</xsl:text><xsl:value-of select="@target"/><xsl:text>»</xsl:text></xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise><xsl:apply-imports/></xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise><xsl:apply-imports/></xsl:otherwise></xsl:choose></xsl:template>
<xsl:template match="tei:exemplum" mode="doc"><xsl:variable name="documentationLanguage"><xsl:call-template name="generateDoc"/></xsl:variable><xsl:choose><xsl:when test="parent::tei:exemplum"><xsl:call-template name="showExample"/></xsl:when><xsl:when test="not(@xml:lang)"><xsl:call-template name="showExample"/></xsl:when><xsl:when test="@xml:lang='und'"><xsl:call-template name="showExample"/></xsl:when><xsl:when test="@xml:lang='mul' and not($documentationLanguage='zh-TW')"><!-- will need to generalize this if other langs come along like
chinese --><xsl:call-template name="showExample"/></xsl:when><xsl:when test="@xml:lang=$documentationLanguage"><xsl:call-template name="showExample"/></xsl:when><xsl:when test="not(../tei:exemplum[@xml:lang=$documentationLanguage]) and (@xml:lang='en' or @xml:lang='und' or @xml:lang='mul')"><xsl:call-template name="showExample"/></xsl:when></xsl:choose></xsl:template>
<xsl:template match="tei:exemplum" mode="weave"><xsl:if test="teix:egXML/* or teix:egXML/text() or text()"><xsl:apply-templates select="." mode="doc"/></xsl:if></xsl:template>
<xsl:template name="showAttClasses"><xsl:param name="minimal">false</xsl:param><xsl:variable name="clatts"><xsl:for-each select="ancestor-or-self::tei:elementSpec|ancestor-or-self::tei:classSpec"><xsl:call-template name="attClassDetails"/></xsl:for-each></xsl:variable><xsl:if test="$minimal='true'"><xsl:text> — </xsl:text></xsl:if><xsl:choose><xsl:when test="$minimal='true' and not($clatts='')"><xsl:text> [+ </xsl:text><xsl:copy-of select="$clatts"/><xsl:text>]</xsl:text></xsl:when><xsl:when test="not($clatts='')"><xsl:if test="ancestor::tei:schemaSpec and key('CLASSES','att.global')"><xsl:element namespace="{$outputNS}" name="{$segName}"><xsl:attribute name="xml:lang"><xsl:value-of select="$documentationLanguage"/></xsl:attribute><xsl:call-template name="i18n"><xsl:with-param name="word"><xsl:choose><xsl:when test="not($autoGlobal='true')">Attributes</xsl:when><xsl:when test=".//tei:attDef">In addition to global attributes and those inherited from</xsl:when><xsl:otherwise>Global attributes and those inherited from</xsl:otherwise></xsl:choose></xsl:with-param></xsl:call-template><xsl:value-of select="$spaceCharacter"/></xsl:element></xsl:if><xsl:copy-of select="$clatts"/></xsl:when><xsl:when test="ancestor::tei:schemaSpec and not(key('CLASSES','att.global'))"></xsl:when><xsl:otherwise><xsl:call-template name="i18n"><xsl:with-param name="word"><xsl:choose><xsl:when test="not($autoGlobal='true')">Attributes</xsl:when><xsl:when test=".//tei:attDef">In addition to global attributes</xsl:when><xsl:otherwise>Global attributes only</xsl:otherwise></xsl:choose></xsl:with-param></xsl:call-template></xsl:otherwise></xsl:choose></xsl:template>