<!---->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="xmlverbatim.xsl" />
<xsl:output method="html" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN" />
<!---->
<xsl:param name="select" />
<!---->
<xsl:param name="css-stylesheet" select="'xmlverbatim.css'" />
<!---->
<xsl:template match="/">
<xsl:apply-templates select="/" mode="xmlverbwrapper" />
</xsl:template>
<xsl:template match="/" mode="xmlverbwrapper">
<html>
<head>
<title>XML source view</title>
<link rel="stylesheet" type="text/css" href="{$css-stylesheet}" />
</head>
<body class="xmlverb-default">
<tt>
<xsl:choose>
<!---->
<xsl:when test="$select">
<xsl:apply-templates mode="xmlverbwrapper" />
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="xmlverb" />
</xsl:otherwise>
</xsl:choose>
</tt>
</body>
</html>
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="*" mode="xmlverbwrapper">
<xsl:choose>
<xsl:when test="name()=$select">
<!---->
<!---->
<span class="xmlverb-text">
<xsl:call-template name="preformatted-output">
<xsl:with-param name="text">
<xsl:call-template name="find-last-line">
<xsl:with-param name="text" select="preceding-sibling::node()[1][self::text()]" />
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</span>
<!---->
<xsl:apply-templates select="." mode="xmlverb" />
<br /><br />
</xsl:when>
<xsl:otherwise>
<!---->
<xsl:apply-templates select="*" mode="xmlverbwrapper" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!---->
<xsl:template name="find-last-line">
<xsl:param name="text" />
<xsl:choose>
<xsl:when test="contains($text,' ')">
<xsl:call-template name="find-last-line">
<xsl:with-param name="text" select="substring-after($text,' ')" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>