Forrest
  1. Forrest
  2. FOR-492

Inconsistent Line Endings in generated sites

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Incomplete
    • Affects Version/s: 0.7
    • Fix Version/s: 0.8
    • Component/s: Core operations
    • Labels:
      None
    • Environment:
      Windows (with or without CYGWIN)

      Description

      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?
      1. FOR-492-fixcrlf.txt
        0.5 kB
        David Crossley
      2. index.html
        10 kB
        Gavin

        Issue Links

          Activity

          Hide
          Gavin added a comment -
          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.
          Show
          Gavin added a comment - 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.
          Hide
          David Crossley added a comment -
          Added workaround using Ant fixcrlf to post-process *.html after 'forrest site'. Does not address generated pages in 'forrest run' or 'forrest war' mode.
          Show
          David Crossley added a comment - Added workaround using Ant fixcrlf to post-process *.html after 'forrest site'. Does not address generated pages in 'forrest run' or 'forrest war' mode.
          Hide
          David Crossley added a comment -
          Attachment FOR-492-fixcrlf.txt to post-process the *.html files after Cocoon.
          Show
          David Crossley added a comment - Attachment FOR-492 -fixcrlf.txt to post-process the *.html files after Cocoon.
          Hide
          David Crossley added a comment -
          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".
          Show
          David Crossley added a comment - 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".
          Hide
          David Crossley added a comment -
          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$
          Show
          David Crossley added a comment - 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$
          Hide
          Gavin added a comment -
          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

          Show
          Gavin added a comment - 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
          Hide
          Gavin added a comment -
          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 :)
          Show
          Gavin added a comment - 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 :)
          Hide
          David Crossley added a comment -
          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.
          Show
          David Crossley added a comment - 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.
          Hide
          David Crossley added a comment -
          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?
          Show
          David Crossley added a comment - 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?
          Hide
          David Crossley added a comment -
          Here is the previous thread that discussed this issue:
           http://marc.theaimsgroup.com/?t=110468489000001
           "SVN Inconsitent Line Endings"
          Show
          David Crossley added a comment - Here is the previous thread that discussed this issue:   http://marc.theaimsgroup.com/?t=110468489000001  "SVN Inconsitent Line Endings"
          Hide
          Ross Gardler added a comment -
          It looks like this xalan issue us our root cause.
          Show
          Ross Gardler added a comment - It looks like this xalan issue us our root cause.
          Hide
          Ross Gardler added a comment -
          It looks like this Xalan issue is the root cause of this problem.
          Show
          Ross Gardler added a comment - It looks like this Xalan issue is the root cause of this problem.
          Hide
          Ross Gardler added a comment -
          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
          Show
          Ross Gardler added a comment - 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

            People

            • Assignee:
              Unassigned
              Reporter:
              Ross Gardler
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development