Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>This transformation</strong>:</p> <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:output omit-xml-declaration="yes"/&gt; &lt;xsl:strip-space elements="*"/&gt; &lt;xsl:template match="info/*[position() &gt; 1]"&gt; &lt;br /&gt;&lt;xsl:text&gt;&amp;#xA;&lt;/xsl:text&gt; &lt;xsl:value-of select="."/&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p><strong>when applied on the following XML document</strong> (as no source XML document is provided in the question):</p> <pre><code>&lt;info&gt; &lt;t&gt;line1&lt;/t&gt; &lt;t&gt;line2&lt;/t&gt; &lt;t&gt;line3&lt;/t&gt; &lt;t&gt;line4&lt;/t&gt; &lt;t&gt;line5&lt;/t&gt; &lt;/info&gt; </code></pre> <p><strong>produces the wanted result</strong> (<code>&lt;info&gt;</code> intentionally not generated as this isn't an HTML element):</p> <pre><code>line1&lt;br/&gt; line2&lt;br/&gt; line3&lt;br/&gt; line4&lt;br/&gt; line5 </code></pre> <p><strong>Note 1</strong>: This transformation was verified to produce exactly the above result with all of my XSLT 1.0 and 2.0 processors: MSXML3, MSXML4, MSXML6, .NET XslCompiledTransform, .NET XslTransform, Saxon 6.5.4, XML-SPY, Saxon 9.1.05, XQSharp, AltovaXML2011 (XML-SPY for XSLT 2.0).</p> <p><strong>Note 2</strong>: If you <em>really</em> want to have the result wrapped int an <code>&lt;info&gt;</code> element, just add this template:</p> <pre><code> &lt;xsl:template match="info"&gt; &lt;info&gt; &lt;xsl:text&gt;&amp;#xA;&lt;/xsl:text&gt;&lt;xsl:apply-templates/&gt;&lt;xsl:text&gt;&amp;#xA;&lt;/xsl:text&gt; &lt;/info&gt; &lt;/xsl:template&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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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