Issue Details (XML | Word | Printable)

Key: FOR-492
Type: Bug Bug
Status: Resolved Resolved
Resolution: Incomplete
Priority: Blocker Blocker
Assignee: Unassigned
Reporter: Ross Gardler
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Forrest

Inconsistent Line Endings in generated sites

Created: 06/May/05 05:04 PM   Updated: 20/Aug/06 09:22 AM
Component/s: Core operations
Affects Version/s: 0.7
Fix Version/s: 0.8

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works FOR-492-fixcrlf.txt 2006-05-12 04:36 PM David Crossley 0.5 kB
HTML File index.html 2006-04-19 03:27 PM Gavin 10 kB
Environment:
Issue Links:
Blocker
 


 Description  « Hide
Sites generated by Forrest have inconsistent line endings when created on a Windows platform.

I did a little testing, here's what I have discovered so far:
 
- any file that is processed by XSLT has the line endings problem
- on investigating one such file (index.html) I discovered that the generated comments from site2xhtml.xsl (such as breadtrail comment) have LF endings whilst most other lines have CRLF endings.
 
I'm running on Windows, and get the same results whether I run under
CYGWIN or DOS.
 
To reproduce run "forrest site" in any site and check out the generated docs in build/site.

This appears to a result of the XSLT transformations. xsl:comments retain the line endings contained in the XSL file, whilst other line endings are set to the environment default.

Is there a way to tell the XSLT transformer what line endings to use?


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Ross Gardler added a comment - 30/Nov/05 07:37 AM
This issue has raised its head again when using the Forrestbot to deploy the Forrest site using windows.

http://marc.theaimsgroup.com/?t=113329994200005&r=1&w=2

Ross Gardler added a comment - 30/Nov/05 07:40 AM
It looks like this Xalan issue is the root cause of this problem.

Ross Gardler added a comment - 30/Nov/05 07:42 AM
It looks like this xalan issue us our root cause.

David Crossley added a comment - 23/Jan/06 12:13 PM
Here is the previous thread that discussed this issue:
 http://marc.theaimsgroup.com/?t=110468489000001
 "SVN Inconsitent Line Endings"

David Crossley added a comment - 04/Mar/06 01:45 PM
Would someone please attach an example generated file or at least a snippet to portray the problem.

Also, i don't understand Windows and its line-endings. The Description above says "most other lines have LF endings" while the ones that are generated by <xsl:comment> have CRLF endings. I would have expected that the whole file should have CRLF. Can someone explain?

David Crossley added a comment - 19/Apr/06 11:18 AM
Raising severity to Blocker. This is a huge issue for projects that store their generated documents in Subversion.

Would someone on Windows please respond to the previous comment.

Gavin added a comment - 19/Apr/06 03:25 PM
As far as I can see, all lines on Windows from a generated .html file all end with CRLF.
Also I see no difference in the way comments are treated as previously mentioned.

Example code from an index.html file.

Oops, sorry cant paste code - the ^M gets converted to a CRLF !!, I'll attach a file instead.

This Wikipedia explains the difference between the 3 main OS versions and their handling.
I blame it on CP/M myself :)

Gavin added a comment - 19/Apr/06 03:27 PM
I wonder how those on other OS will be able to check this anyway, a screen shot may be needed ?

Forgot to mention that link : http://en.wikipedia.org/wiki/Line_break


David Crossley added a comment - 19/Apr/06 05:11 PM
Thanks. I am on UNIX and can see the problem line-endings in your Windows-generated attachment, e.g. at lines 38 and 39 ...

     35 </head>^M$
     36 <body>^M$
     37 <div id="container">^M$
     38 <!--+$
     39 | start breadtrail$
     40 +-->^M$
     41 <div class="breadtrail">^M$

David Crossley added a comment - 22/Apr/06 08:10 AM
Fixed the Issue Description which had reversed discussion about the line-endings, i.e. changed "CRLF endings whilst most other lines have LF endings" to "LF endings whilst most other lines have CRLF endings".

David Crossley added a comment - 12/May/06 04:36 PM
Attachment FOR-492-fixcrlf.txt to post-process the *.html files after Cocoon.

David Crossley added a comment - 13/May/06 05:41 AM
Added workaround using Ant fixcrlf to post-process *.html after 'forrest site'. Does not address generated pages in 'forrest run' or 'forrest war' mode.

Gavin added a comment - 20/Aug/06 09:22 AM
See also - http://marc.theaimsgroup.com/?l=forrest-dev&m=115606562031148&w=2

where I altered the workaround for *.css on my Windows system to be able to publish the site.