[ 
https://issues.apache.org/jira/browse/VELOCITY-348?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Henning Schmiedehausen closed VELOCITY-348.
-------------------------------------------


> Anakia generates mix of line endings on Windows platform
> --------------------------------------------------------
>
>                 Key: VELOCITY-348
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-348
>             Project: Velocity
>          Issue Type: Bug
>          Components: Anakia
>    Affects Versions: 1.5
>         Environment: Operating System: Windows XP
> Platform: PC
>            Reporter: Will Glass-Husain
>         Assigned To: Will Glass-Husain
>         Attachments: anakia_eol.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to