469,646 Members | 1,693 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,646 developers. It's quick & easy.

Blank lines inserted when XSLT output inside a loop

Jim
When output from inside a loop

<xsl:for-each select="Comment">
<br><xsl:value-of select="Line" /></br>
</xsl:for-each>

A blank line is inserted between each line, when I
remove the <br> then everthings on the same line. Want a
new line but getting 2 new lines instead, how can this be
fixed so just get 1 new line ?
Nov 11 '05 #1
3 8614
Jim wrote:
When output from inside a loop

<xsl:for-each select="Comment">
<br><xsl:value-of select="Line" /></br>
</xsl:for-each>

A blank line is inserted between each line, when I
remove the <br> then everthings on the same line. Want a
new line but getting 2 new lines instead, how can this be
fixed so just get 1 new line ?


<xsl:for-each select="Comment">
<br /><xsl:value-of select="Line" />
</xsl:for-each>

or

<xsl:for-each select="Comment">
<xsl:value-of select="Line" /><br />
</xsl:for-each>

--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #2
Or my favourite for formatting ..

<xsl:for-each select="Comment">
<xsl:value-of select="Line" />

<!-- ## ADD LINEBREAK FOR ALL BUT THE LAST ENTRY -->
<xsl:if test="position() != last()">
<br />
</xsl:if>
</xsl:for-each>
--
venlig hilsen / with regards
anders borum
--
Nov 11 '05 #3
Hi Jim,

Oleg posted some very good information, does these not resolve the problem?
You may post your complete XML and XSLT file and code you use to perform
the transform here for clarifying the problem.

Luke

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026?? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
http://www.microsoft.com/security/se...s/ms03-026.asp and/or to
visit Windows Update at http://windowsupdate.microsoft.com to install the
patch. Running the SCAN program from the Windows Update site will help to
insure you are current with all security patches, not just MS03-026."

Nov 11 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by mark | last post: by
2 posts views Thread by Amir | last post: by
1 post views Thread by DAnne | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.