<!---->
<
xsl:
stylesheet xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"
version="
1.0">
<
xsl:
import href="
xmlverbatim.xsl" />
<!---->
<
xsl:
param name="
select" />
<!---->
<
xsl:
template match="
/"
mode="
xmlverbwrapper">
<
xsl:
param name="
css-stylesheet"
select="
'xmlverbatim.css'" />
<
html>
<
head>
<
title>
XML source view</
title>
<
link rel="
stylesheet"
type="
text/css"
href="
{$css-stylesheet}" />
<
meta http-equiv="
Content-Type"
content="
text/html; Charset=UTF-8" />
</
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>
<
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br /><
br />
v
</
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>
v