473,395 Members | 1,460 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 9164
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Phil | last post by:
Hi everybody, I am a XSLT beginner and the following problem really makes me crazy ! I have a main "contacts.xml" document which contains references to several contact data XML files. My aim...
5
by: mark | last post by:
how to print, say 50 blank spaces, or say 20 blank spaces ? I wanted use such blank spaces that can be output in a program at predetermined places when printing with "cout".
3
by: yanakal | last post by:
Hi, I'm using isql to query data and output the same to a flat file. The isql has the following command options ' -h-1 -w500 -n -b -s"" '. In the SQL_CODE, the first two lines before the select...
2
by: Amir | last post by:
I really hope someone can explain this behavior. I have spend quite a bit of time and tried a bunch of things, so far nothing has worked. I have a page on which I have a datagrid with template...
3
by: Jeff Calico | last post by:
Hello everyone I am transforming an XML document to text, basically only outputting a small portion of it. When I run the following XSLT via Xalan's processor, I get a bunch of unwanted blank...
1
by: satya.mahesh | last post by:
Hi All, I am working on a problem which "eliminates blank lines in export (between headings and when a heading is empty)". I want a macro which will do this job for me. For e.g: Heading1 ...
1
by: DAnne | last post by:
Hi, I have checked your archives but have not been able to find anything that works for my situation. I have a for loop that brings back a list of unique responses for each section in a report....
2
by: Olveres | last post by:
Hi, I have managed to work out how to add new lines into a calculated text box. However in this text box some of the outcome fields are empty however when previewing the report it includes the...
18
by: yinglcs | last post by:
Hi, I have a newbie XSLT question. I have the following xml, and I would like to find out the children of feature element in each 'features' element. i.e. for each <featuresI would like to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.