bakunin Posted June 21, 2009 Share Posted June 21, 2009 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 More sharing options...
boen_robot Posted June 21, 2009 Share Posted June 21, 2009 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 More sharing options...
bakunin Posted June 21, 2009 Author Share Posted June 21, 2009 Thank you alot, it works perfectly ! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.