You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Dmitry Panov (JIRA)" <xa...@xml.apache.org> on 2005/11/23 20:31:37 UTC
[jira] Commented: (XALANJ-1065) Serializing a XML document via TRAX changes "\r\n" to "\r\r\n"
[ 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: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org