sheet.xsl: improve output formatting

Include tags, better CSS
master
pictuga 2020-03-20 16:44:49 +01:00
parent 3d45451fef
commit 2c245f9506
1 changed files with 23 additions and 3 deletions

View File

@ -20,10 +20,18 @@
list-style-type: none; list-style-type: none;
} }
.element { .tag {
color: darkred; color: darkred;
} }
.attr {
color: darksalmon;
}
.value {
color: darkblue;
}
.comment { .comment {
color: lightgrey; color: lightgrey;
} }
@ -55,15 +63,27 @@
<xsl:template match="*"> <xsl:template match="*">
<li> <li>
<span class="element"> <span class="element">
<xsl:value-of select="concat('&lt;', name(), '&gt;')"/> &lt;
<span class="tag"><xsl:value-of select="name()"/></span>
<xsl:for-each select="@*">
<span class="attr"> <xsl:value-of select="name()"/></span>
=
"<span class="value"><xsl:value-of select="."/></span>"
</xsl:for-each>
&gt;
</span> </span>
<xsl:if test="node()"> <xsl:if test="node()">
<ul> <ul>
<xsl:apply-templates/> <xsl:apply-templates/>
</ul> </ul>
</xsl:if> </xsl:if>
<span class="element"> <span class="element">
<xsl:value-of select="concat('&lt;/', name(), '&gt;')"/> &lt;/
<span class="tag"><xsl:value-of select="name()"/></span>
&gt;
</span> </span>
</li> </li>
</xsl:template> </xsl:template>