You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Sc...@lotus.com on 2000/12/01 18:07:36 UTC

Re: XalanJ1 + 0D0A

Can anyone on the Xerces team comment on normalization of CRLF etc. in an
XML Parser.  I don't believe I have seen this normalization take place with
Xerces????

-scott




                                                                                                                      
                    Joseph_Kesselman                                                                                  
                    @lotus.com              To:     xalan-dev@xml.apache.org                                          
                                            cc:     (bcc: Scott Boag/CAM/Lotus)                                       
                    11/30/00 09:22          Subject:     Re: XalanJ1 + 0D0A                                           
                    AM                                                                                                
                    Please respond                                                                                    
                    to xalan-dev                                                                                      
                                                                                                                      
                                                                                                                      





> If I pass parameter with 0D0A sequence (CRLF) XSLT processor
>outputs two sequences 0D0A 0D0A.

During normal XML parsing, CRLF gets turned into LF, as would CR alone.
Theoretically, this means that the CR character (0D) should never appear in
XML content. So one can certainly argue that converting your line-breaks
before passing them into XSLT is the Right Thing to do.

Xalan could check for this and apply the conversion for you, though there'd
be performance penalties due to having to scan and possibly recopy the
string. Of course that overhead should only happen once per stylesheet
invocation, so this may be acceptable. On the other hand, this is a case of
sweeping a problem under the carpet; the next XSLT processor you use may
not be so forgiving, so there's something to be said for teaching folks to
fix it before Xalan sees it.

Question: Can one argue that line-break conversion of parameters should
_not_ occur when XSLT is outputting in Text mode? I hope not, but I'm not
110% sure... I consider this another good reason for Xalan to put the
conversion burden on the caller; by doing so we avoid having to demand an
official answer for this boundary case. <grin level=".5"/>