Issue Details (XML | Word | Printable)

Key: XALANJ-656
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Xalan Developers Mailing List
Reporter: Angus McIntyre
Votes: 0
Watchers: 2
Operations

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

<xsl:copy> introduces inappropriate line-end characters processing comments

Created: 08/Nov/01 04:57 PM   Updated: 14/Nov/09 12:29 AM
Return to search
Component/s: Xalan
Affects Version/s: 2.2.0
Fix Version/s: None

Time Tracking:
Not Specified

Environment:
Operating System: MacOS 9
Platform: Macintosh
Issue Links:
Blocker
 

Bugzilla Id: 4745


 Description  « Hide
I was trying to write a template that would correctly reproduce the script
body of a JavaScript (which is typically 'masked' by a comment). My initial
attempt was:

<xsl:template match="script/comment()">
<xsl:copy/>
</xsl:template>

which worked, except that the copied script contained newline (ASCII 10)
in place of the carriage-return (ASCII 13) characters in the original. Note
that this is on a Macintosh, where line-endings are terminated by CR
rather than LF; I suspect it wouldn't manifest as a problem on UN*X). My
guess is that in this case, <xsl:copy> is causing Xalan to simply write LF's
rather than the appropriate platform-specific line terminators.

A workaround is to use:

<xsl:template match="script/comment()">
<xsl:comment><xsl:value-of select="."/></xsl:comment>
</xsl:template>

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.