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 name="NameList"><xsl:choose><xsl:when test="self::tei:schemaSpec"><xsl:for-each select="tei:elementSpec"><xsl:sort select="@ident"/><xsl:call-template name="declareAnElement"/></xsl:for-each></xsl:when><xsl:otherwise><xsl:for-each select="key('ELEMENTDOCS',1)"><xsl:sort select="@ident"/><xsl:call-template name="declareAnElement"/></xsl:for-each></xsl:otherwise></xsl:choose><!-- walk over all the elementSpec elements and make list of
elements --></xsl:template>
<xsl:template match="rng:text" mode="simple"><xsl:choose><xsl:when test="parent::tei:content/parent::tei:macroSpec[@type='dt']"><xsl:text> CDATA</xsl:text></xsl:when><xsl:when test="parent::tei:content/parent::tei:macroSpec[@type='pe']"><xsl:text>#PCDATA</xsl:text></xsl:when><xsl:when test="parent::tei:content and not(following-sibling::rng:*) and not (preceding-sibling::rng:*)"><xsl:text>(#PCDATA)</xsl:text></xsl:when><xsl:when test="parent::tei:content and not(following-sibling::rng:*) and not (preceding-sibling::rng:*)"><xsl:text>(#PCDATA)</xsl:text></xsl:when><xsl:otherwise><xsl:text>#PCDATA</xsl:text></xsl:otherwise></xsl:choose></xsl:template>
<xsl:template match="tei:macroSpec" mode="tangle"><xsl:choose><xsl:when test="@depend and $parameterize='true'"><xsl:if test="$verbose='true'"><xsl:message>Dependency on<xsl:value-of select="@depend"/>for<xsl:value-of select="@ident"/></xsl:message></xsl:if><xsl:text>
<![%TEI.</xsl:text><xsl:value-of select="@depend"/>;[<xsl:call-template name="macroBody"/><xsl:text>
]]></xsl:text></xsl:when><xsl:when test="@depend and count(key('ElementModule',@depend))=0"><xsl:if test="$verbose='true'"><xsl:message>Dependency on<xsl:value-of select="@depend"/>, but not used in this schema</xsl:message></xsl:if></xsl:when><xsl:otherwise><xsl:call-template name="macroBody"/></xsl:otherwise></xsl:choose></xsl:template>
<xsl:template name="memberOfClassDefinition"><xsl:param name="type"/><!-- does a class model need bracketing if all its members are also classes?
<xsl:if test="count(N[@type='class'])=count(N) and count(N) > 2">
<xsl:text>(</xsl:text>
</xsl:if>
--><xsl:for-each select="N"><xsl:value-of select="."/><xsl:choose><xsl:when test="$type='sequence'"><xsl:if test="position() < last()">,</xsl:if></xsl:when><xsl:when test="$type='sequenceOptional'"><xsl:text>?</xsl:text><xsl:if test="position() < last()">,</xsl:if></xsl:when><xsl:when test="$type='sequenceRepeatable'"><xsl:text>+</xsl:text><xsl:if test="position() < last()">,</xsl:if></xsl:when><xsl:when test="$type='sequenceOptionalRepeatable'"><xsl:text>*</xsl:text><xsl:if test="position() < last()">,</xsl:if></xsl:when><xsl:otherwise><xsl:if test="position() < last()">|</xsl:if></xsl:otherwise></xsl:choose></xsl:for-each><!-- see above
<xsl:if test="count(N[@type='class'])=count(N) and count(N) > 2">
<xsl:text>)</xsl:text>
</xsl:if>
--></xsl:template>
<xsl:template name="checkClass"><xsl:param name="id"/><!-- should a class be included?
* it must exist in the ODD spec
* it must have other classes which point to it
* whatever it points to must have members which are in the ODD
--><xsl:for-each select="key('CLASSMEMBERS',$id)"><xsl:choose><xsl:when test="self::tei:elementSpec and key('ELEMENTS',@ident)"><xsl:text>true</xsl:text></xsl:when><xsl:when test="self::tei:macroSpec and key('MACROS',@ident)"><xsl:text>true</xsl:text></xsl:when><xsl:when test="self::tei:classSpec and key('CLASSES',@ident)"><xsl:call-template name="checkClass"><xsl:with-param name="id" select="@ident"/></xsl:call-template></xsl:when></xsl:choose></xsl:for-each></xsl:template>
<xsl:template name="checkEnd"><xsl:if test="count(parent::tei:content[parent::tei:elementSpec]/rng:*)>1 and not(following-sibling::rng:*)"><xsl:text>)</xsl:text></xsl:if></xsl:template>
<xsl:template name="copyright"><xsl:for-each select="/tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:availability"><xsl:if test="count(tei:licence)>1"><xsl:text>This material is dual-licensed.
</xsl:text></xsl:if><xsl:apply-templates/></xsl:for-each></xsl:template>