Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Because I'm not sure if the use of <code>xsl:value-of</code>is a hard requirement, perhaps something like the following could be what you are locking for.</p> <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:output indent="yes"/&gt; &lt;xsl:template match="name" mode ="print" &gt; &lt;xsl:value-of select="@firstname"/&gt; &lt;xsl:text&gt; &lt;/xsl:text&gt; &lt;xsl:value-of select="@lastname"/&gt; &lt;xsl:value-of select="@divider"/&gt; &lt;/xsl:template&gt; &lt;xsl:template match="/"&gt; &lt;xsl:apply-templates select="names/name" mode="print"/&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>You can use <code>&lt;xsl:apply-templates select="names/name" mode="print"/&gt;</code> at any position you have considered about using a one line value-of for all attributes.<br> The above template will generate the following output:</p> <pre><code>Rocky Balboa, Ivan Drago, </code></pre> <p><strong>Update crate output without using the attribute names:</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:output indent="yes"/&gt; &lt;xsl:template match="name" mode ="print" &gt; &lt;xsl:for-each select="@*" &gt; &lt;xsl:if test="not(position() = last() or position() = 1)"&gt; &lt;xsl:text&gt; &lt;/xsl:text&gt; &lt;/xsl:if&gt; &lt;xsl:value-of select="."/&gt; &lt;/xsl:for-each&gt; &lt;/xsl:template&gt; &lt;xsl:template match="/"&gt; &lt;xsl:apply-templates select="names/name" mode="print"/&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload