<?xml-stylesheet title="XSL_formatting" type="text/xsl" href="./matts.xsl"   ?>
<!--
 Time-stamp: "2006-04-01 03:04:00 AST"
  This stylesheet is for visualizing XSLT documents
   using MatTS (Matryoshka Transformation Syntax).
  By sburke@cpan.org - I hereby release this XSLT code into the public domain.
-->

<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:axsl="http://www.w3.org/1999/XSL/TransformAlias" 
>

<xsl:output indent="no" method="html" />

<!-- Each comment -->
<xsl:template match="comment()">
  <div class="comment" title="a comment">
    <span class="start"><xsl:text>&lt;!--</xsl:text></span>
    <pre class="m"><xsl:value-of select="." /></pre>
    <span class="end"><xsl:text>&#160;--></xsl:text></span>
  </div>
</xsl:template>

<!-- Each PI -->
<xsl:template match="processing-instruction()">
  <div class="pi" title="a processing instruction">
    <span class="start"><xsl:text>&lt;?</xsl:text></span>
    <span class="m">
      <xsl:value-of select="name(.)" /><xsl:text> </xsl:text>
      <xsl:value-of select="." />
    </span>
    <span class="end"><xsl:text> ?></xsl:text></span>
  </div>
</xsl:template>

<!-- Each attribute -->
<xsl:template match="@*">
  <span class='attr' title="{name(.)}=">
    <xsl:if test="namespace-uri(..) = 'http://www.w3.org/1999/XSL/Transform' "
     ><xsl:attribute name="class">X attr
      XA<xsl:value-of select="name(.)" /></xsl:attribute></xsl:if>
    
    <xsl:text> </xsl:text>
    <span class='k'><xsl:value-of select="name(.)" /></span>
    <span class='v'><xsl:value-of select="." /></span>
  </span>
</xsl:template>

<!-- each plaintext node -->
<xsl:template match="text()">
  <xsl:if test="not( normalize-space(.) = '' )" >
    <div title="a text node" class="text"><xsl:value-of select="." /></div>
    <!-- TODO: leave the nonignoreable all-whitespace ones! -->
  </xsl:if>
</xsl:template>


<!-- Other nodes (namely, elements) -->
<xsl:template match="*">
  <div class="treelet">
    <xsl:if test="namespace-uri() = 'http://www.w3.org/1999/XSL/Transform' "
     ><xsl:attribute name="class">treeletX X<xsl:value-of select="local-name()" /></xsl:attribute></xsl:if>

    <div class="starttag">
      <xsl:if test="namespace-uri() = 'http://www.w3.org/1999/XSL/Transform' "
       ><xsl:attribute name="class">X starttag</xsl:attribute></xsl:if>
      <span class="start">&lt;</span>

      <span class='gi {name()}' title='{name()}'>
        <xsl:if test="namespace-uri() = 'http://www.w3.org/1999/XSL/Transform' ">
          <xsl:attribute name="class">
            X gi X<xsl:value-of select="local-name()" />
          </xsl:attribute>
        </xsl:if>
        <span class='gimain'>
          <xsl:value-of select="name()" /> 
        </span>
      </span>

      <xsl:apply-templates select="@*" />

      <span class="end">&gt;</span>
    </div>
    
    <xsl:apply-templates />
    
    <xsl:if test="not( namespace-uri(.) = 'http://www.w3.org/1999/XSL/Transform' )">
      <div class="endtag">
        <xsl:if test="namespace-uri(.) = 'http://www.w3.org/1999/XSL/Transform' "
         ><xsl:attribute name="class">X endtag</xsl:attribute></xsl:if>
        <span class="start">&lt;/</span>
        <span class='gi'>
          <xsl:if test="namespace-uri(.) = 'http://www.w3.org/1999/XSL/Transform' "
           ><xsl:attribute name="class">X gi</xsl:attribute></xsl:if>
          <xsl:value-of select="name(.)" />
        </span>
        <span class="end">&gt;</span>
      </div>
    </xsl:if>

  </div>
</xsl:template>


<!-- Init a docroot -->
<xsl:template match="/">
  <html class='RssToHtmlByXsl'>
    <head>
      <title>XSL stylesheet</title>
      <xsl:element name="meta">
        <xsl:attribute name="content-type"
         >text/html; charset=iso-8859-1</xsl:attribute>
      </xsl:element><!-- April fools. -->
      <style type="text/css"><![CDATA[

html, body {
  color: #999;
  background-color: #fff;
}

div {
  padding-left:  1em;
  text-indent: -.95em;
  border: 2px #bbb solid;
  -moz-border-radius: .9em 0 0 0;
}

div:hover { border-left-color: #000; }


/* Three cosmetic optimizations: */
div + div { margin-top: 4px; }
div > div:last-child { border-bottom-width: 0; }
div > div { border-right: none; }

html, body, .v:before, .v:after {
  font-family: "Georgia", "Times New Roman", "Times", serif;
}

.text {
  /* font-style: italic; */
  font-family: "Tahoma", "Verdana", "Helvetica", sans-serif;
  border-width: 0 0 0 2px;
  padding-left: 1.1em;
  background-color: #ffc;
}

.comment { color: #9b9;  border: 0;  padding: 0; margin: 0; }
.comment > .start { display: none; }
.comment > .end { display: none; }
body > .comment { padding-left: .3em; }

.X { color: #000; }

.endtag.X { display: none; }

.k { padding-left: .3em;  }
.v { font-family: "Courier New", "Courier", monospace; }

.v:before { content: "=\00ab" }
.v:after  { content: "\00bb"  }


.starttag.X > .attr.X.XAtest   > .v:before   { content: "\00a0\00BF"; color: #000; font-size: larger; }
.starttag.X > .attr.X.XAtest   > .v:after    { display: none }
.starttag.X > .attr.X.XAtest   > .k          { display: none }
.starttag.X > .attr.X.XAtest   > .v          { color: #f00   }

.starttag.X > .attr.X.XAname   > .v:before   { content: "\00a0\221A"; color: #000; font-size: larger; }
.starttag.X > .attr.X.XAname   > .v:after    { display: none }
.starttag.X > .attr.X.XAname   > .k          { display: none }
.starttag.X > .attr.X.XAname   > .v          { color: #f00   }

.starttag.X > .attr.X.XAmatch  > .v:before   { content: "\00a0\2248"; color: #000; font-size: larger; }
.starttag.X > .attr.X.XAmatch  > .v:after    { display: none }
.starttag.X > .attr.X.XAmatch  > .k          { display: none }
.starttag.X > .attr.X.XAmatch  > .v          { color: #f00   }

.starttag.X > .attr.X.XAselect > .v:before   { content: "\00a0\00A7"; color: #000; font-size: larger; }
.starttag.X > .attr.X.XAselect > .v:after    { display: none }
.starttag.X > .attr.X.XAselect > .k          { display: none }
.starttag.X > .attr.X.XAselect > .v          { color: #f00   }

.starttag.X > .attr.X > .v:after  { color: #000; padding-right: .5em; }


.starttag > .end:before { content: "\00a0" }

.starttag.X > .start, .starttag.X > .end     { display: none; }
.starttag.X > .attr > .k   { padding-left: .5em; }

div.starttag, div.endtag {
  padding: 0;
  margin:  0;
  border:  none;
}

.gi { font-size: larger; }
.gi:after { color: #090; }

.gi.Xapply-imports  > .gimain { display: none }
.gi.Xapply-imports:after   { content: "\03B1" }
.gi.Xapply-templates> .gimain { display: none }
.gi.Xapply-templates:after { content: "\03B2" }
.gi.Xattribute      > .gimain { display: none }
.gi.Xattribute:after       { content: "\03C4" }
.gi.Xattribute-set  > .gimain { display: none }
.gi.Xattribute-set:after   { content: "\039E" }
.gi.Xcall-template  > .gimain { display: none }
.gi.Xcall-template:after   { content: "\03BB" }
.gi.Xchoose         > .gimain { display: none }
.gi.Xchoose:after          { content: "\03BE" }
.gi.Xcomment        > .gimain { display: none }
.gi.Xcomment:after         { content: "\03C8" }
.gi.Xcopy           > .gimain { display: none }
.gi.Xcopy:after            { content: "\03BC" }
.gi.Xcopy-of        > .gimain { display: none }
.gi.Xcopy-of:after         { content: "\03B3" }
.gi.Xdecimal-format > .gimain { display: none }
.gi.Xdecimal-format:after  { content: "\039D" }
.gi.Xelement        > .gimain { display: none }
.gi.Xelement:after         { content: "\03C0" }
.gi.Xfallback       > .gimain { display: none }
.gi.Xfallback:after        { content: "\03B8" }
.gi.Xfor-each       > .gimain { display: none }
.gi.Xfor-each:after        { content: "\03B6" }
.gi.Xif             > .gimain { display: none }
.gi.Xif:after              { content: "\03C6" }
.gi.Ximport         > .gimain { display: none }
.gi.Ximport:after          { content: "\03A9" }
.gi.Xinclude        > .gimain { display: none }
.gi.Xinclude:after         { content: "\0393" }
.gi.Xkey            > .gimain { display: none }
.gi.Xkey:after             { content: "\0398" }
.gi.Xmessage        > .gimain { display: none }
.gi.Xmessage:after         { content: "\03BC" }
.gi.Xnamespace-alias> .gimain { display: none }
.gi.Xnamespace-alias:after { content: "\0391" }
.gi.Xnumber         > .gimain { display: none }
.gi.Xnumber:after          { content: "\03BD" }
.gi.Xotherwise      > .gimain { display: none }
.gi.Xotherwise:after       { content: "\03C2" }
.gi.Xoutput         > .gimain { display: none }
.gi.Xoutput:after          { content: "\0394" }
.gi.Xparam          > .gimain { display: none }
.gi.Xparam:after           { content: "\03A7" }
.gi.Xpreserve-space > .gimain { display: none }
.gi.Xpreserve-space:after  { content: "\039A" }
.gi.Xsort           > .gimain { display: none }
.gi.Xsort:after            { content: "\03B5" }
.gi.Xstrip-space    > .gimain { display: none }
.gi.Xstrip-space:after     { content: "\03BF" }
.gi.Xstylesheet     > .gimain { display: none }
.gi.Xstylesheet:after      { content: "\03A3" }
.gi.Xtemplate       > .gimain { display: none }
.gi.Xtemplate:after        { content: "\039B" }
.gi.Xtext           > .gimain { display: none }
.gi.Xtext:after            { content: "\03B9" }
.gi.Xtransform      > .gimain { display: none }
.gi.Xtransform:after       { content: "\03A4" }
.gi.Xvalue-of       > .gimain { display: none }
.gi.Xvalue-of:after        { content: "\03BA" }
.gi.Xvariable       > .gimain { display: none }
.gi.Xvariable:after        { content: "\03B4" }
.gi.Xwhen           > .gimain { display: none }
.gi.Xwhen:after            { content: "\03C3" }
.gi.Xwith-param     > .gimain { display: none }
.gi.Xwith-param:after      { content: "\03C7" }
.gi.Xprocessing-instruction > .gimain { display: none }
.gi.Xprocessing-instruction:after { content: "\03A0" }

]]></style>

</head><body><xsl:apply-templates
/></body></html></xsl:template></xsl:stylesheet>
<!-- end -->
