Jump to content

Xsl:attribute Name Problem


bakunin

Recommended Posts

Hi, i have a problem with my xsl:attribute, i want the name of the attribute to be the name of the tag so here is what it would look like.

<xsl:attribute  name="[b]<xsl:value-of select='name()'/>[/b]">  blablabla		   	</xsl:attribute>

But of course we can't use "<" in a xsl tag wich is why xsl attribute was invented, to be able to use a select as a value but what am i supposed to do when its the name of the attribute that use a select.I thought about doing this but it doesn't work :).

<xsl:attribute><xsl:attribute name="name"><xsl:value-of select='name()'/></xsl:attribute>	 blablabla	   	</xsl:attribute>

Link to comment
Share on other sites

You can use AVT inside the name attribute. "AVT" is basically an XPath expression in parenthesis... like so:

<xsl:attribute  name="{name()}">  blablabla			   </xsl:attribute>

Same goes for the <xsl:processing-instruction/> and <xsl:element/> elements.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...