user1596669
user1596669

Reputation: 1

xsl inside an html tag

I have an XML like this:

<dataroot>
<element>
<color>#FF0FFF</color>
</element>
<element>
<color>#FF0000</color>
</element>
</dataroot>

And I need to put inside this tag on html:

<xsl:for-each select="dataroot/element">
<tr style="background-color:{.};"> <xsl:value-of select="color" />
</tr>
</xsl:for-each>

But it does not work. I tried to use it as attribute also but it did not work. Can anybody help me?

Upvotes: 0

Views: 555

Answers (1)

GSerg
GSerg

Reputation: 78135

<xsl:for-each select="dataroot/element"> 
    <tr style="background-color:{color};"></tr>
</xsl:for-each>

Upvotes: 1

Related Questions