Since I'm not sure that using xsl:value-of is a tough requirement, maybe something like the following might be what you are blocking for.
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes"/> <xsl:template match="name" mode ="print" > <xsl:value-of select="@firstname"/> <xsl:text> </xsl:text> <xsl:value-of select="@lastname"/> <xsl:value-of select="@divider"/> </xsl:template> <xsl:template match="/"> <xsl:apply-templates select="names/name" mode="print"/> </xsl:template> </xsl:stylesheet>
You can use <xsl:apply-templates select="names/name" mode="print"/> at any position that you have considered about using the value of one line for all attributes.
The above pattern will generate the following result:
Rocky Balboa, Ivan Drago,
Update drawer output without using attribute names:
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes"/> <xsl:template match="name" mode ="print" > <xsl:for-each select="@*" > <xsl:if test="not(position() = last() or position() = 1)"> <xsl:text> </xsl:text> </xsl:if> <xsl:value-of select="."/> </xsl:for-each> </xsl:template> <xsl:template match="/"> <xsl:apply-templates select="names/name" mode="print"/> </xsl:template> </xsl:stylesheet>
source share