xsl-list
[Top] [All Lists]

Re: [xsl] XSLT program outputs a series of items, how to insert newlines between each item?

2020-06-25 08:16:58

On 25.06.2020 15:11, Roger L Costello costello(_at_)mitre(_dot_)org wrote:
Hi Folks,

My XSLT program has a loop. Each iteration outputs an item. I want each item on 
a new line. The following works. Is there a better way to insert newlines than 
by using xsl:text with the end tag on the next line?  /Roger

<xsl:output method="text" />

<xsl:template match="/">
     <xsl:for-each select="//xs:simpleType[@name eq 
'DatumCode']//xs:enumeration">
         <xsl:value-of select="concat(@value, ' (', 
xs:annotation/xs:documentation, ')')/>
<xsl:text>
</xsl:text>
     </xsl:for-each>
</xsl:template>


I would use xsl:value-of separator


<xsl:value-of select="//xs:simpleType[@name eq
'DatumCode']//xs:enumeration/concat(@value, ' (',
xs:annotation/xs:documentation, ')')" separator="&#10;"/>
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>