tags:

views:

201

answers:

2

I want to use data from XML to populate a class:

E.g.

<p class="<xsl:value-of select="a:Subject"/>">English</p>

Which would generate:

<p class="English">English</p>

IS this possible?

+1  A: 

Yes, it is possible, use the below code

<xsl:variable name="class" select="a:Subject"/>
<p class="{$class}">English</p>
Thiyagaraj
A: 

Yes via the

Ex:

<xsl:template match="yourXPath">
  <p><xsl:value-of select="a:Subject"/>
  <xsl:attribute select="a:Subject" />
  </p>
</xsl:template>
Gregoire