You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by bu...@apache.org on 2005/01/29 17:41:21 UTC

DO NOT REPLY [Bug 33296] New: - Anakia generates mix of line endings on Windows platform

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33296>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33296

           Summary: Anakia generates mix of line endings on Windows platform
           Product: Velocity
           Version: 1.5
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Anakia
        AssignedTo: velocity-dev@jakarta.apache.org
        ReportedBy: wglass@forio.com


The problem: Running "ant docs" with Anakia on Windows machines generates 
files with a mix of Unix (\n) and Windows (\r\n) line endings.  This causes 
special problems uploading files to Subversion as svn chokes with inconsistent 
line endings.

To duplicate: Download jakarta-site2 from svn.  "site.vsl" required by 
Velocity task "ant docs" will have Windows line endings.  Run "ant docs".  
Produced file will have mix of unix and Windows line endings.  All text from 
site.vsl will have Windows line endings, while JDom produces Unix style line 
endings.

What it should have: all line endings should match platform default.  This is 
especially convenient for files accessed via subversion, which will 
automatically convert line endings when uploading/downloading files.

Solution: The solution has three parts.

(1) Upgrade the current jdom-b10-rc1.jar to the latest jdom 1.0 (jdom.jar).  
Jdom 1.0 has a method which allows the caller to set the line separator for 
displayed XML.  

(2) Modify AnakiaElement to set the default JDom line separator to the 
platform default.  (part of attached patch).  This causes all nodes output 
with toString to display with proper line feeds.

(3) Modify Escape to substitute the default line separator for \n.  (part of 
attached patch).  This makes all text displayed with <source> to have correct 
line feeds.  Specifically, site.vsl gets the content of the <source> tag and 
escapes it with: $escape.getText($value.getText()).  This parallels the same 
method used by JDom to ensure the correct line feeds for output of 
XMLOutputter.

Since Anakia is widely used with Jakarta for documentation, before applying 
this patch I'd like to ask if there is any feedback from the Velocity and 
Jakarta community.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org