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

Dmitry Panov commented on XALANJ-1065:
--------------------------------------

Just a comment: I ran into this problem when dealing with textareas in cocoon. 
If and only if both the client is IE and the server runs under Windows any new 
line in a submitted textarea is rendered twice, because it comes as \r\n from 
IE and serialized back to 
\r\n. 

> Serializing a XML document via TRAX changes "\r\n" to "\r\r\n"
> --------------------------------------------------------------
>
>          Key: XALANJ-1065
>          URL: http://issues.apache.org/jira/browse/XALANJ-1065
>      Project: XalanJ2
>         Type: Bug
>   Components: Serialization
>     Versions: 2.4
>  Environment: Operating System: Windows NT/2K
> Platform: PC
>     Reporter: Jürgen Moßgraber
>     Assignee: Morris Kwan

>
> Serializing a XML document via TRAX changes "\r\n" to "\r\r\n" 
> in a CDATA section.
> Serializing with the Xalan XMLSerializer works fine.
> Example:
> import javax.xml.transform.stream.*;
> import javax.xml.transform.dom.*;
> import javax.xml.transform.*;
> import javax.xml.parsers.*;
> import org.apache.xml.serialize.*;
> import org.w3c.dom.*;
> import java.io.*;
> public class Test
> {
>   public static void main (String [] args)
>   {
>       try
>       {
>                       Document doc = DocumentBuilderFactory.newInstance 
> ().newDocumentBuilder ().newDocument ();
>                       Node root = doc.createElement ("Top");
>                       doc.appendChild (root);
>                       root.appendChild (doc.createCDATASection 
> ("One\r\nTwo"));
>                       // Try Xalan serialize (works fine)
>                       XMLSerializer serializer = new XMLSerializer (new 
> FileOutputStream ("D:\\One.xml"), null);
>                       serializer.serialize (doc);
>                       // Try TRAX
>                       Transformer transformer = 
> TransformerFactory.newInstance ().newTransformer ();
>                       transformer.transform (new DOMSource (doc), new 
> StreamResult (new FileOutputStream ("D:\\Two.xml")));
>               }
>               catch (Exception ex)
>               {
>                       ex.printStackTrace ();
>               }
>   }
> }

-- 
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