[ 
http://issues.apache.org/jira/browse/XALANJ-1876?page=comments#action_12360363 
] 

Brian Minchau commented on XALANJ-1876:
---------------------------------------

Jess,
There are three stages here:
1) what the XML parser reads in
2) what the XML parser presents to the XSLT processor
3) what the XSLT processor writes out.

For XSL1 the XML parser, in step 1) above, reads in your &#D;
 and 
normalizes it to  single newline character, which it presents to the XSLT 
processor in step 2)

The single newline character remains untouched until the very last second. When 
the serialization stage of the XSLT processor writes out that newline, it 
writes out 0d0a because you are on windows.  This is regardless of whether the 
output is xml or text or html, it is just trying to provide an end-of-line 
sequence that it thinks is reasonable on the target platform.

The same is true for XSL3, the 
 is normalized to a newline by the XML 
parser.  So Xalan never sees the difference between XSL1 and XSL3. The 
normalization is before Xalan gets involved.

XSL2 is different. You said you wanted a carriage-return, 
 , it is not 
normalized to anything, but left as is, and Xalan likewise does not recognize 
this as marking the end of a line so it is left as-is on output.

If you did set the Xalan specific output property:
   <xsl:output xalan:line-separator="&#10;" >
then both XSL1 and XSL3 should come out as 0a.  XSL2 is not affected. 

I don't see a bug here. I see that the XML parser is normalizing as it is 
supposed to do for XSL1 and XSL3, and that for XSL2 you are getting exactly 
what you asked for, a single carriage return.



> New line Problem in notepad
> ---------------------------
>
>          Key: XALANJ-1876
>          URL: http://issues.apache.org/jira/browse/XALANJ-1876
>      Project: XalanJ2
>         Type: Bug
>   Components: transformation, Xalan-interpretive
>     Versions: 2.0.0
>  Environment: Operating System: Other
> Platform: All
>     Reporter: Ranjan Kumar
>     Assignee: Xalan Developers Mailing List
>      Fix For: 2.7
>  Attachments: test.xml, text.xsl
>
> I have the following line at the end of my each output line to make the new 
> line
> (<xsl:text>&#xA;</xsl:text>). I am making an txt output file. When I open 
> that 
> file with textpad, word pad etc. everything looks okay. But when I open this 
> file in notepad I see the new line character at the end of each line. Also 
> this 
> new line looks like does not work and all is mess.
> I will really appreciate any help on this as I have to complete this for my 
> deliverable soon.
> Thanks,
> Ranjan

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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

Reply via email to