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;
}
.element {
.tag {
color: darkred;
}
.attr {
color: darksalmon;
}
.value {
color: darkblue;
}
.comment {
color: lightgrey;
}
@ -55,15 +63,27 @@
<xsl:template match="*">
<li>
<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>
<xsl:if test="node()">
<ul>
<xsl:apply-templates/>
</ul>
</xsl:if>
<span class="element">
<xsl:value-of select="concat('&lt;/', name(), '&gt;')"/>
&lt;/
<span class="tag"><xsl:value-of select="name()"/></span>
&gt;
</span>
</li>
</xsl:template>