Showing:

Documentation
Parameters
Used by
References
Overriding
Imported from
Source
Stylesheet verbatim.xsl
Documentation

Description

TEI stylesheet dealing with elements from the core module.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Author: See AUTHORS

Id: $Id: verbatim.xsl 9329 2011-09-20 09:47:43Z rahtz $

Copyright: 2011, TEI Consortium

Imported from
Stylesheet version 2.0
Template verbatim-getNamespacePrefix
Documentation

Description

Work out a namespace prefix for verbatim elements

[common]

Namespace No namespace
Used by
References
Import precedence 3
Source
<xsl:template name="verbatim-getNamespacePrefix">
  <xsl:variable name="ns" select="namespace-uri()"/>
  <xsl:variable name="prefix" select="tei:getPrefix($ns,ancestor-or-self::*[1])[1]"/>
  <xsl:choose>
    <xsl:when test="$prefix !=''">
      <xsl:value-of select="$prefix"/>
    </xsl:when>
    <xsl:when test="$ns='http://docbook.org/ns/docbook'">dbk</xsl:when>
    <xsl:when test="$ns='http://earth.google.com/kml/2.1'">kml</xsl:when>
    <xsl:when test="$ns='http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0'">nvdl</xsl:when>
    <xsl:when test="$ns='http://purl.org/rss/1.0/modules/event/'">ev</xsl:when>
    <xsl:when test="$ns='http://purl.oclc.org/dsdl/schematron'">s</xsl:when>
    <xsl:when test="$ns='http://relaxng.org/ns/compatibility/annotations/1.0'">a</xsl:when>
    <xsl:when test="$ns='http://relaxng.org/ns/structure/1.0'">rng</xsl:when>
    <xsl:when test="$ns='http://www.ascc.net/xml/schematron'">sch</xsl:when>
    <xsl:when test="$ns='http://www.w3.org/1998/Math/MathML'">m</xsl:when>
    <xsl:when test="$ns='http://www.w3.org/1999/XSL/Transform'">xsl</xsl:when>
    <xsl:when test="$ns='http://www.w3.org/1999/xhtml'">xhtml</xsl:when>
    <xsl:when test="$ns='http://www.w3.org/1999/xlink'">xlink</xsl:when>
    <xsl:when test="$ns='http://www.w3.org/2001/XMLSchema'">xsd</xsl:when>
    <xsl:when test="$ns='http://www.w3.org/2005/11/its'">its</xsl:when>
    <xsl:when test="$ns='http://www.w3.org/2005/Atom'">atom</xsl:when>
    <xsl:when test="$ns='http://www.w3.org/XML/1998/namespace'">xml</xsl:when>
    <xsl:when test="$ns='http://www.tei-c.org/ns/geneticEditions'">ge</xsl:when>
  </xsl:choose>
</xsl:template>
Stylesheet location ../common2/verbatim.xsl
Template verbatim-newLine
Namespace No namespace
Overriding
Template verbatim-newLine
Import precedence 3
Source
<xsl:template name="verbatim-newLine"/>
Stylesheet location ../common2/verbatim.xsl
Template verbatim-lineBreak
Documentation

Description

Make newline

[common]

Parameters

id identifier for debugging only

Namespace No namespace
Overriding
Parameters
QName Namespace
id No namespace
Import precedence 3
Source
<xsl:template name="verbatim-lineBreak">
  <xsl:param name="id"/>
  <xsl:text>
</xsl:text>
</xsl:template>
Stylesheet location ../common2/verbatim.xsl
Template comment()verbatim
Documentation

Description

Process comments in verbatim mode

[common]

Namespace No namespace
Match comment()
Mode verbatim
References
Import precedence 3
Source
<xsl:template match="comment()" mode="verbatim">
  <xsl:choose>
    <xsl:when test="ancestor::Wrapper"/>
    <xsl:when test="ancestor::xhtml:Wrapper"/>
    <xsl:otherwise>
      <xsl:call-template name="verbatim-lineBreak">
        <xsl:with-param name="id">21</xsl:with-param>
      </xsl:call-template>
      <xsl:value-of disable-output-escaping="yes" select="$startComment"/>
      <xsl:text><!--</xsl:text>
      <xsl:choose>
        <xsl:when test="$forceWrap='true'">
          <xsl:call-template name="verbatim-reformatText">
            <xsl:with-param name="sofar">0</xsl:with-param>
            <xsl:with-param name="indent">
              <xsl:text> </xsl:text>
            </xsl:with-param>
            <xsl:with-param name="text">
              <xsl:value-of select="normalize-space(.)"/>
            </xsl:with-param>
          </xsl:call-template>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="."/>
        </xsl:otherwise>
      </xsl:choose>
      <xsl:text>--></xsl:text>
      <xsl:value-of disable-output-escaping="yes" select="$endComment"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../common2/verbatim.xsl
Template text()verbatim
Documentation

Description

Process text nodes in verbatim mode

[common]

Namespace No namespace
Match text()
Mode verbatim
References
Import precedence 3
Source
<xsl:template match="text()" mode="verbatim">
  <xsl:choose>
    <xsl:when test="$forceWrap='true'">
      <xsl:variable name="indent">
        <xsl:for-each select="parent::*">
          <xsl:call-template name="verbatim-makeIndent"/>
        </xsl:for-each>
      </xsl:variable>
      <xsl:if test="string-length(.)>$wrapLength or parent::sch:assert">
        <xsl:text>
</xsl:text>
        <xsl:value-of select="$indent"/>
      </xsl:if>
      <xsl:call-template name="verbatim-reformatText">
        <xsl:with-param name="sofar">0</xsl:with-param>
        <xsl:with-param name="indent">
          <xsl:value-of select="$indent"/>
        </xsl:with-param>
        <xsl:with-param name="text">
          <xsl:value-of select="normalize-space(.)"/>
        </xsl:with-param>
      </xsl:call-template>
      <xsl:if test="string-length(.)>$wrapLength or parent::sch:assert">
        <xsl:text>
</xsl:text>
        <xsl:value-of select="$indent"/>
      </xsl:if>
    </xsl:when>
    <xsl:when test="not(preceding-sibling::node() or         contains(.,'
'))">
      <xsl:if test="starts-with(.,' ')">
        <xsl:text> </xsl:text>
      </xsl:if>
      <xsl:call-template name="verbatim-Text">
        <xsl:with-param name="words">
          <xsl:value-of select="normalize-space(.)"/>
        </xsl:with-param>
      </xsl:call-template>
      <xsl:if test="substring(.,string-length(.),1)=' '">
        <xsl:text> </xsl:text>
      </xsl:if>
    </xsl:when>
    <xsl:when test="normalize-space(.)=''">
      <xsl:for-each select="following-sibling::*[1]">
        <xsl:call-template name="verbatim-lineBreak">
          <xsl:with-param name="id">7</xsl:with-param>
        </xsl:call-template>
        <xsl:call-template name="verbatim-makeIndent"/>
      </xsl:for-each>
    </xsl:when>
    <xsl:otherwise>
      <xsl:call-template name="verbatim-wraptext">
        <xsl:with-param name="count">0</xsl:with-param>
        <xsl:with-param name="indent">
          <xsl:for-each select="parent::*">
            <xsl:call-template name="verbatim-makeIndent"/>
          </xsl:for-each>
        </xsl:with-param>
        <xsl:with-param name="text">
          <xsl:choose>
            <xsl:when test="starts-with(.,'
') and not          (preceding-sibling::node())">
              <xsl:value-of select="translate(substring(.,2),'
','⌤')"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="translate(.,'
','⌤')"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:with-param>
      </xsl:call-template>
      <!--
	<xsl:if test="substring(.,string-length(.))=' '">
	  <xsl:text> </xsl:text>
	</xsl:if>
	-->
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../common2/verbatim.xsl
Template verbatim-reformatText
Namespace No namespace
Used by
References
Parameters
QName Namespace
indent No namespace
sofar No namespace
text No namespace
Import precedence 3
Source
<xsl:template name="verbatim-reformatText">
  <xsl:param name="indent"/>
  <xsl:param name="text"/>
  <xsl:param name="sofar"/>
  <xsl:choose>
    <xsl:when test="number($sofar) > $wrapLength">
      <xsl:text>
</xsl:text>
      <xsl:value-of select="$indent"/>
      <xsl:call-template name="verbatim-reformatText">
        <xsl:with-param name="text">
          <xsl:value-of select="$text"/>
        </xsl:with-param>
        <xsl:with-param name="sofar">
          <xsl:text>0</xsl:text>
        </xsl:with-param>
        <xsl:with-param name="indent">
          <xsl:value-of select="$indent"/>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="not(contains($text,' '))">
      <xsl:call-template name="verbatim-Text">
        <xsl:with-param name="words">
          <xsl:value-of select="$text"/>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:variable name="chunk">
        <xsl:value-of select="substring-before($text,' ')"/>
      </xsl:variable>
      <xsl:call-template name="verbatim-Text">
        <xsl:with-param name="words">
          <xsl:value-of select="$chunk"/>
          <xsl:text> </xsl:text>
        </xsl:with-param>
      </xsl:call-template>
      <xsl:call-template name="verbatim-reformatText">
        <xsl:with-param name="text">
          <xsl:value-of select="substring-after($text,' ')"/>
        </xsl:with-param>
        <xsl:with-param name="sofar">
          <xsl:value-of select="$sofar + string-length($chunk) + 1"/>
        </xsl:with-param>
        <xsl:with-param name="indent">
          <xsl:value-of select="$indent"/>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../common2/verbatim.xsl
Template verbatim-wraptext
Namespace No namespace
Used by
References
Parameters
QName Namespace
count No namespace
indent No namespace
text No namespace
Import precedence 3
Source
<xsl:template name="verbatim-wraptext">
  <xsl:param name="indent"/>
  <xsl:param name="text"/>
  <xsl:param name="count">0</xsl:param>
  <xsl:variable name="finalSpace">
    <xsl:choose>
      <xsl:when test="substring($text,string-length($text),1)=' '">
        <xsl:text> </xsl:text>
      </xsl:when>
      <xsl:when test="substring($text,string-length($text),1)='⌤'">
        <xsl:text> </xsl:text>
      </xsl:when>
      <xsl:otherwise>
        <xsl:text/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <!--
<xsl:message>my text is [<xsl:value-of select="$text"/>]</xsl:message>
<xsl:message>my space is [<xsl:value-of select="$finalSpace"/>]</xsl:message>
-->
  <xsl:choose>
    <xsl:when test="normalize-space($text)=''"/>
    <xsl:when test="contains($text,'⌤')">
      <xsl:if test="$count > 0">
        <xsl:value-of select="$indent"/>
        <xsl:text> </xsl:text>
      </xsl:if>
      <xsl:if test="starts-with($text,' ')">
        <xsl:text> </xsl:text>
      </xsl:if>
      <xsl:call-template name="verbatim-Text">
        <xsl:with-param name="words">
          <xsl:value-of select="normalize-space(substring-before($text,'⌤'))"/>
        </xsl:with-param>
      </xsl:call-template>
      <!--	<xsl:if test="not(substring-after($text,'&#10;')='')">-->
      <xsl:call-template name="verbatim-lineBreak">
        <xsl:with-param name="id">6</xsl:with-param>
      </xsl:call-template>
      <xsl:value-of select="$indent"/>
      <xsl:call-template name="verbatim-wraptext">
        <xsl:with-param name="indent">
          <xsl:value-of select="$indent"/>
        </xsl:with-param>
        <xsl:with-param name="text">
          <xsl:value-of select="normalize-space(substring-after($text,'⌤'))"/>
          <xsl:value-of select="$finalSpace"/>
        </xsl:with-param>
        <xsl:with-param name="count">
          <xsl:value-of select="$count + 1"/>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:if test="starts-with($text,' ')">
        <xsl:text> </xsl:text>
      </xsl:if>
      <xsl:if test="$count > 0 and parent::*">
        <xsl:value-of select="$indent"/>
        <xsl:text> </xsl:text>
      </xsl:if>
      <xsl:call-template name="verbatim-Text">
        <xsl:with-param name="words">
          <xsl:value-of select="normalize-space($text)"/>
          <xsl:value-of select="$finalSpace"/>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../common2/verbatim.xsl
Template verbatim-Text
Documentation

Description

Process text and process ampersands

[common]

Namespace No namespace
Overriding
Template verbatim-Text
Parameters
QName Namespace
words No namespace
Import precedence 3
Source
<xsl:template name="verbatim-Text">
  <xsl:param name="words"/>
  <xsl:analyze-string select="$words" regex="(&)(.)">
    <xsl:matching-substring>
      <xsl:choose>
        <xsl:when test="starts-with(regex-group(2),'#')">
          <xsl:text>&</xsl:text>
        </xsl:when>
        <xsl:otherwise>
          <xsl:text>&amp;</xsl:text>
        </xsl:otherwise>
      </xsl:choose>
      <xsl:value-of select="regex-group(2)"/>
    </xsl:matching-substring>
    <xsl:non-matching-substring>
      <xsl:value-of select="."/>
    </xsl:non-matching-substring>
  </xsl:analyze-string>
</xsl:template>
Stylesheet location ../common2/verbatim.xsl
Template *verbatim
Documentation

Description

Process default elements in verbatim mode

[common]

Namespace No namespace
Match *
Mode verbatim
References
Parameters
QName Namespace
highlight No namespace
Import precedence 3
Source
<xsl:template match="*" mode="verbatim">
  <xsl:param name="highlight"/>
  <xsl:choose>
    <xsl:when test="parent::xhtml:Wrapper"/>
    <!--      <xsl:when test="child::node()[last()]/self::text()[not(.='')] and child::node()[1]/self::text()[not(.='')]"/>-->
    <xsl:when test="not(parent::*)  or parent::teix:egXML">
      <xsl:choose>
        <xsl:when test="preceding-sibling::node()[1][self::text()]      and following-sibling::node()[1][self::text()]"/>
        <xsl:when test="preceding-sibling::*">
          <xsl:call-template name="verbatim-lineBreak">
            <xsl:with-param name="id">-1</xsl:with-param>
          </xsl:call-template>
        </xsl:when>
        <xsl:otherwise>
          <xsl:call-template name="verbatim-newLine"/>
          <!-- <xsl:call-template name="makeIndent"/>-->
        </xsl:otherwise>
      </xsl:choose>
    </xsl:when>
    <xsl:when test="not(preceding-sibling::node())">
      <xsl:call-template name="verbatim-lineBreak">
        <xsl:with-param name="id">-2</xsl:with-param>
      </xsl:call-template>
      <xsl:call-template name="verbatim-makeIndent"/>
    </xsl:when>
    <xsl:when test="preceding-sibling::node()[1]/self::*">
      <xsl:call-template name="verbatim-lineBreak">
        <xsl:with-param name="id">1</xsl:with-param>
      </xsl:call-template>
      <xsl:call-template name="verbatim-makeIndent"/>
    </xsl:when>
    <xsl:when test="preceding-sibling::node()[1]/self::text()">
    </xsl:when>
    <xsl:otherwise>
      <xsl:call-template name="verbatim-lineBreak">
        <xsl:with-param name="id">9</xsl:with-param>
      </xsl:call-template>
      <xsl:call-template name="verbatim-makeIndent"/>
    </xsl:otherwise>
  </xsl:choose>
  <xsl:value-of disable-output-escaping="yes" select="$startElement"/>
  <xsl:text><</xsl:text>
  <xsl:call-template name="verbatim-makeElementName">
    <xsl:with-param name="start">true</xsl:with-param>
    <xsl:with-param name="highlight">
      <xsl:value-of select="$highlight"/>
    </xsl:with-param>
  </xsl:call-template>
  <xsl:apply-templates select="@*" mode="verbatim"/>
  <xsl:if test="$showNamespaceDecls='true' or parent::teix:egXML[@rend='full']">
    <xsl:choose>
      <xsl:when test="not(parent::*)">
        <xsl:call-template name="nsList"/>
      </xsl:when>
      <xsl:when test="parent::teix:egXML and not(preceding-sibling::*)">
        <xsl:call-template name="nsList"/>
      </xsl:when>
    </xsl:choose>
  </xsl:if>
  <xsl:choose>
    <xsl:when test="child::node()">
      <xsl:text>></xsl:text>
      <xsl:value-of disable-output-escaping="yes" select="$endElement"/>
      <xsl:apply-templates mode="verbatim">
        <xsl:with-param name="highlight">
          <xsl:value-of select="$highlight"/>
        </xsl:with-param>
      </xsl:apply-templates>
      <xsl:choose>
        <xsl:when test="child::node()[last()]/self::text() and child::node()[1]/self::text()"/>
        <xsl:when test="not(parent::*)  or parent::teix:egXML">
          <xsl:call-template name="verbatim-lineBreak">
            <xsl:with-param name="id">23</xsl:with-param>
          </xsl:call-template>
        </xsl:when>
        <xsl:when test="child::node()[last()]/self::text()[normalize-space(.)='']">
          <xsl:call-template name="verbatim-lineBreak">
            <xsl:with-param name="id">3</xsl:with-param>
          </xsl:call-template>
          <xsl:call-template name="verbatim-makeIndent"/>
        </xsl:when>
        <xsl:when test="child::node()[last()]/self::comment()">
          <xsl:call-template name="verbatim-lineBreak">
            <xsl:with-param name="id">4</xsl:with-param>
          </xsl:call-template>
          <xsl:call-template name="verbatim-makeIndent"/>
        </xsl:when>
        <xsl:when test="child::node()[last()]/self::*">
          <xsl:call-template name="verbatim-lineBreak">
            <xsl:with-param name="id">5</xsl:with-param>
          </xsl:call-template>
          <xsl:call-template name="verbatim-makeIndent"/>
        </xsl:when>
      </xsl:choose>
      <xsl:value-of disable-output-escaping="yes" select="$startElement"/>
      <xsl:text></</xsl:text>
      <xsl:call-template name="verbatim-makeElementName">
        <xsl:with-param name="start">false</xsl:with-param>
        <xsl:with-param name="highlight">
          <xsl:value-of select="$highlight"/>
        </xsl:with-param>
      </xsl:call-template>
      <xsl:text>></xsl:text>
      <xsl:value-of disable-output-escaping="yes" select="$endElement"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>/></xsl:text>
      <xsl:value-of disable-output-escaping="yes" select="$endElement"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../common2/verbatim.xsl
Template verbatim-createElement
Namespace No namespace
References
Overriding
Parameters
QName Namespace
name No namespace
special No namespace
Import precedence 3
Source
<xsl:template name="verbatim-createElement">
  <xsl:param name="name"/>
  <xsl:param name="special"/>
  <xsl:choose>
    <xsl:when test="$special='true'">
      <xsl:value-of disable-output-escaping="yes" select="$highlightStartElementName"/>
      <xsl:value-of select="$name"/>
      <xsl:value-of disable-output-escaping="yes" select="$highlightEndElementName"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$name"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../common2/verbatim.xsl
Template verbatim-createAttribute
Namespace No namespace
Overriding
Parameters
QName Namespace
name No namespace
Import precedence 3
Source
<xsl:template name="verbatim-createAttribute">
  <xsl:param name="name"/>
  <xsl:value-of select="$name"/>
</xsl:template>
Stylesheet location ../common2/verbatim.xsl
Template verbatim-makeElementName
Namespace No namespace
Used by
Template *verbatim
References
Parameters
QName Namespace
highlight No namespace
start No namespace
Import precedence 3
Source
<xsl:template name="verbatim-makeElementName">
  <xsl:param name="start"/>
  <xsl:param name="highlight"/>
  <!-- get namespace prefix -->
  <xsl:variable name="ns-prefix">
    <xsl:call-template name="verbatim-getNamespacePrefix"/>
  </xsl:variable>
  <xsl:variable name="highlightMe">
    <xsl:choose>
      <xsl:when test="$highlight=local-name()">true</xsl:when>
      <xsl:otherwise>false</xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:choose>
    <xsl:when test="namespace-uri()='http://www.tei-c.org/ns/Examples'">
      <xsl:call-template name="verbatim-createElement">
        <xsl:with-param name="name" select="local-name(.)"/>
        <xsl:with-param name="special">
          <xsl:value-of select="$highlightMe"/>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="contains($omitNSDecls,namespace-uri())">
      <xsl:call-template name="verbatim-createElement">
        <xsl:with-param name="name" select="local-name(.)"/>
        <xsl:with-param name="special">
          <xsl:value-of select="$highlightMe"/>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="$useNSPrefixes='true' and string-length($ns-prefix) > 0">
      <xsl:call-template name="verbatim-createElement">
        <xsl:with-param name="name" select="concat($ns-prefix,':',local-name(.))"/>
        <xsl:with-param name="special">
          <xsl:value-of select="$highlightMe"/>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="not(namespace-uri()='')">
      <xsl:call-template name="verbatim-createElement">
        <xsl:with-param name="name" select="local-name(.)"/>
        <xsl:with-param name="special">
          <xsl:value-of select="$highlightMe"/>
        </xsl:with-param>
      </xsl:call-template>
      <xsl:if test="$start='true' and not(namespace-uri()=namespace-uri(..))">
        <xsl:text> xmlns="</xsl:text>
        <xsl:value-of select="namespace-uri()"/>
        <xsl:text>"</xsl:text>
        <!-- 
	       <xsl:call-template name="verbatim-lineBreak">
	       <xsl:with-param name="id">5</xsl:with-param>
	       </xsl:call-template>
	       <xsl:call-template name="verbatim-makeIndent"/>
	  -->
      </xsl:if>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of disable-output-escaping="yes" select="$startElementName"/>
      <xsl:call-template name="verbatim-createElement">
        <xsl:with-param name="name" select="local-name(.)"/>
        <xsl:with-param name="special">
          <xsl:value-of select="$highlightMe"/>
        </xsl:with-param>
      </xsl:call-template>
      <xsl:value-of disable-output-escaping="yes" select="$endElementName"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../common2/verbatim.xsl
Template verbatim-makeIndent
Namespace No namespace
Used by
References
Import precedence 3
Source
<xsl:template name="verbatim-makeIndent">
  <xsl:variable name="depth" select="count(ancestor::*[not(namespace-uri()='http://www.tei-c.org/ns/1.0')])"/>
  <xsl:call-template name="verbatim-makeSpace">
    <xsl:with-param name="d">
      <xsl:value-of select="$depth"/>
    </xsl:with-param>
  </xsl:call-template>
</xsl:template>
Stylesheet location ../common2/verbatim.xsl
Template verbatim-makeSpace
Namespace No namespace
Used by
References
Parameter spaceCharacter
Template verbatim-makeSpace
Parameters
QName Namespace
d No namespace
Import precedence 3
Source
<xsl:template name="verbatim-makeSpace">
  <xsl:param name="d"/>
  <xsl:if test="number($d)>1">
    <xsl:value-of select="$spaceCharacter"/>
    <xsl:call-template name="verbatim-makeSpace">
      <xsl:with-param name="d">
        <xsl:value-of select="$d -1"/>
      </xsl:with-param>
    </xsl:call-template>
  </xsl:if>
</xsl:template>
Stylesheet location ../common2/verbatim.xsl
Template @*verbatim
Namespace No namespace
Match @*
Mode verbatim
References
Import precedence 3
Source
<xsl:template match="@*" mode="verbatim">
  <xsl:variable name="L">
    <xsl:for-each select="../@*">
      <xsl:value-of select="."/>
    </xsl:for-each>
  </xsl:variable>
  <xsl:if test="count(../@*)>$attsOnSameLine or      string-length($L)>$attLength or     ancestor::tei:cell[not(@rend='wovenodd-col2')] or     namespace-uri()='http://www.w3.org/2005/11/its' or     string-length(.)+string-length(name(.)) >     $attLength">
    <xsl:call-template name="verbatim-lineBreak">
      <xsl:with-param name="id">5</xsl:with-param>
    </xsl:call-template>
    <xsl:call-template name="verbatim-makeIndent"/>
  </xsl:if>
  <xsl:value-of select="$spaceCharacter"/>
  <xsl:variable name="ns-prefix">
    <xsl:call-template name="verbatim-getNamespacePrefix"/>
  </xsl:variable>
  <xsl:variable name="name">
    <xsl:choose>
      <xsl:when test="string-length($ns-prefix) > 0">
        <xsl:value-of select="$ns-prefix"/>
        <xsl:text>:</xsl:text>
        <xsl:value-of select="local-name(.)"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="local-name(.)"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:call-template name="verbatim-createAttribute">
    <xsl:with-param name="name" select="$name"/>
  </xsl:call-template>
  <xsl:text>="</xsl:text>
  <xsl:value-of disable-output-escaping="yes" select="$startAttributeValue"/>
  <xsl:apply-templates select="." mode="attributetext"/>
  <xsl:value-of disable-output-escaping="yes" select="$endAttributeValue"/>
  <xsl:text>"</xsl:text>
</xsl:template>
Stylesheet location ../common2/verbatim.xsl
Template @*attributetext
Namespace No namespace
Match @*
Mode attributetext
References
Parameter attLength
Template verbatim-reformatText
Overriding
Template @*attributetext
Import precedence 3
Source
<xsl:template match="@*" mode="attributetext">
  <xsl:choose>
    <xsl:when test="string-length(.)>$attLength and contains(.,' ')">
      <xsl:call-template name="verbatim-reformatText">
        <xsl:with-param name="sofar">0</xsl:with-param>
        <xsl:with-param name="indent">
          <xsl:text> </xsl:text>
        </xsl:with-param>
        <xsl:with-param name="text">
          <xsl:value-of select="normalize-space(.)"/>
        </xsl:with-param>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="."/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../common2/verbatim.xsl
Template text()|comment()|processing-instruction()ns
Namespace No namespace
Match text()|comment()|processing-instruction()
Mode ns
Import precedence 3
Source
<xsl:template match="text()|comment()|processing-instruction()" mode="ns"/>
Stylesheet location ../common2/verbatim.xsl
Template *ns
Namespace No namespace
Match *
Mode ns
Import precedence 3
Source
<xsl:template match="*" mode="ns">
  <xsl:for-each select="namespace::*">
    <xsl:variable name="ns" select="."/>
    <xsl:choose>
      <xsl:when test=".='http://relaxng.org/ns/structure/1.0'"/>
      <xsl:when test=".='http://www.w3.org/2001/XInclude'"/>
      <xsl:when test=".='http://www.tei-c.org/ns/Examples'"/>
      <xsl:when test=".='http://www.ascc.net/xml/schematron'"/>
      <xsl:when test=".='http://relaxng.org/ns/compatibility/annotations/1.0'"/>
      <xsl:when test="name(.)=''"/>
      <xsl:when test=".='http://www.w3.org/XML/1998/namespace'"/>
      <xsl:otherwise>
        <ns name="{name(.)}" value="{.}"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:for-each>
  <xsl:apply-templates mode="ns"/>
</xsl:template>
Stylesheet location ../common2/verbatim.xsl
Template nsList
Namespace No namespace
Used by
Template *verbatim
References
Key NSUsed
Template verbatim-lineBreak
Import precedence 3
Source
<xsl:template name="nsList">
  <xsl:variable name="ns">
    <all>
      <names>
        <xsl:apply-templates select="." mode="ns"/>
      </names>
      <text>
        <xsl:copy-of select="."/>
      </text>
    </all>
  </xsl:variable>
  <xsl:for-each select="$ns/all/names">
    <xsl:for-each-group select="ns" group-by="@name">
      <xsl:if test="key('NSUsed',@value)">
        <xsl:call-template name="verbatim-lineBreak">
          <xsl:with-param name="id">22</xsl:with-param>
        </xsl:call-template>
        <xsl:text>   </xsl:text>
        <xsl:text>xmlns:</xsl:text>
        <xsl:value-of select="@name"/>
        <xsl:text>="</xsl:text>
        <xsl:value-of select="@value"/>
        <xsl:text>"</xsl:text>
      </xsl:if>
    </xsl:for-each-group>
  </xsl:for-each>
</xsl:template>
Stylesheet location ../common2/verbatim.xsl
Parameter useNSPrefixes
Namespace No namespace
Used by
Source
<xsl:param name="useNSPrefixes">true</xsl:param>
Stylesheet location ../common2/verbatim.xsl
Parameter startComment
Namespace No namespace
Overriding
Parameter startComment
Source
<xsl:param name="startComment"><span class="comment"></xsl:param>
Stylesheet location ../common2/verbatim.xsl
Parameter endComment
Namespace No namespace
Overriding
Parameter endComment
Source
<xsl:param name="endComment"></span></xsl:param>
Stylesheet location ../common2/verbatim.xsl
Parameter startElement
Namespace No namespace
Overriding
Parameter startElement
Source
<xsl:param name="startElement"><span class="element"></xsl:param>
Stylesheet location ../common2/verbatim.xsl
Parameter endElement
Namespace No namespace
Overriding
Parameter endElement
Source
<xsl:param name="endElement"></span></xsl:param>
Stylesheet location ../common2/verbatim.xsl
Parameter startElementName
Namespace No namespace
Overriding
Parameter startElementName
Source
<xsl:param name="startElementName"><span class="elementname"></xsl:param>
Stylesheet location ../common2/verbatim.xsl
Parameter endElementName
Namespace No namespace
Overriding
Parameter endElementName
Source
<xsl:param name="endElementName"></span></xsl:param>
Stylesheet location ../common2/verbatim.xsl
Parameter highlightStartElementName
Namespace No namespace
Overriding
Source
<xsl:param name="highlightStartElementName"><span class="highlightelementname"></xsl:param>
Stylesheet location ../common2/verbatim.xsl
Parameter highlightEndElementName
Namespace No namespace
Overriding
Source
<xsl:param name="highlightEndElementName"></span></xsl:param>
Stylesheet location ../common2/verbatim.xsl
Parameter startAttribute
Namespace No namespace
Overriding
Parameter startAttribute
Source
<xsl:param name="startAttribute"><span class="attribute"></xsl:param>
Stylesheet location ../common2/verbatim.xsl
Parameter endAttribute
Namespace No namespace
Overriding
Parameter endAttribute
Source
<xsl:param name="endAttribute"></span></xsl:param>
Stylesheet location ../common2/verbatim.xsl
Parameter startAttributeValue
Namespace No namespace
Overriding
Source
<xsl:param name="startAttributeValue"><span class="attributevalue"></xsl:param>
Stylesheet location ../common2/verbatim.xsl
Parameter endAttributeValue
Namespace No namespace
Overriding
Parameter endAttributeValue
Source
<xsl:param name="endAttributeValue"></span></xsl:param>
Stylesheet location ../common2/verbatim.xsl
Parameter startNamespace
Namespace No namespace
Overriding
Parameter startNamespace
Source
<xsl:param name="startNamespace"><span class="namespace"></xsl:param>
Stylesheet location ../common2/verbatim.xsl
Parameter endNamespace
Namespace No namespace
Overriding
Parameter endNamespace
Source
<xsl:param name="endNamespace"></span></xsl:param>
Stylesheet location ../common2/verbatim.xsl
Parameter spaceCharacter
Namespace No namespace
Overriding
Parameter spaceCharacter
Source
<xsl:param name="spaceCharacter"> </xsl:param>
Stylesheet location ../common2/verbatim.xsl
Parameter showNamespaceDecls
Namespace No namespace
Used by
Template *verbatim
Source
<xsl:param name="showNamespaceDecls">true</xsl:param>
Stylesheet location ../common2/verbatim.xsl
Parameter forceWrap
Namespace No namespace
Used by
Source
<xsl:param name="forceWrap">false</xsl:param>
Stylesheet location ../common2/verbatim.xsl
Parameter wrapLength
Namespace No namespace
Used by
Source
<xsl:param name="wrapLength">65</xsl:param>
Stylesheet location ../common2/verbatim.xsl
Parameter attLength
Namespace No namespace
Used by
Source
<xsl:param name="attLength">40</xsl:param>
Stylesheet location ../common2/verbatim.xsl
Parameter attsOnSameLine
Namespace No namespace
Used by
Template @*verbatim
Source
<xsl:param name="attsOnSameLine">3</xsl:param>
Stylesheet location ../common2/verbatim.xsl
Parameter omitNSDecls
Namespace No namespace
Used by
Source
<xsl:param name="omitNSDecls">http://www.tei-c.org/ns/1.0</xsl:param>
Stylesheet location ../common2/verbatim.xsl
Function tei:getPrefix
Namespace http://www.tei-c.org/ns/1.0
Type xs:string*
Used by
Parameters
QName Namespace
here No namespace
ns No namespace
Import precedence 3
Source
<xsl:function name="tei:getPrefix" as="xs:string*">
  <xsl:param name="ns"/>
  <xsl:param name="here"/>
  <xsl:for-each select="in-scope-prefixes($here)">
    <xsl:choose>
      <xsl:when test=".=''"/>
      <xsl:when test="$ns=namespace-uri-for-prefix(.,$here)">
        <xsl:value-of select="."/>
      </xsl:when>
    </xsl:choose>
  </xsl:for-each>
</xsl:function>
Stylesheet location ../common2/verbatim.xsl
Key NSUsed
Namespace No namespace
Match @*
Use namespace-uri()
Used by
Template nsList
Source
<xsl:key name="NSUsed" match="@*" use="namespace-uri()"/>
Stylesheet location ../common2/verbatim.xsl