|
Я вот тут накалякал побырому:
xml файл
<?xml-stylesheet href="data.xsl" type="text/xsl"?>
<source>
<line bgcolor="black" txtcolor="red">Hello world!</line>
<line bgcolor="red" txtcolor="white">Hello world!!</line>
<line bgcolor="green" txtcolor="black">Hello world!!!</line>
</source>
xsl файл:
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:template match="source">
<table>
<tr>
<xsl:for-each select="line">
<td>
<xsl:attribute name="bgcolor">
<xsl:value-of select="@bgcolor"/>
</xsl:attribute>
<font>
<xsl:attribute name="color">
<xsl:value-of select="@txtcolor"/>
</xsl:attribute>
<xsl:value-of select="."/>
</font>
</td>
</xsl:for-each>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>
|