XSLT and XPath Issue
This is an open discussion with 3 replies, filed under XSLT.
Search
Perhaps
<div> <xsl:attribute name="class"> <xsl:apply-templates select="newtags/item" /> </xsl:attribute> some infos here </div> ... <xsl:template match="newtags/item"> <xsl:value-of select="@handle" /> </xsl:template>
To make sure there are spaces between each class, you might need to do something like this:
<xsl:template match="/"> <xsl:apply-templates select="entry" /> </xsl:template> <xsl:template match="entry"> <xsl:param name="tags-classes"> <xsl:apply-templates select="newtags/item" /> </xsl:param> <div class="cols1 {$tags-classes}"> some infos here </div> </xsl:template> <xsl:template match="newtags/item"> <xsl:value-of select="@handle" /><xsl:if test="position() != last()"><xsl:text> </xsl:text></xsl:if> </xsl:template>
Yeah! Thats it! Thank your for the help!
Create an account or sign in to comment.
Hi Folks
last day I try to transform this:
into this:
tried it with:
but it doesent really helps. Can somebody help?