You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by gh...@vsnl.com on 2002/03/07 21:22:50 UTC
suppress encoding="UTF-8" while serializing a DOM
Hi,
I am using following code to serialize a DOM to a byte stream or a file.
java.io.ByteArrayOutputStream byteStream = new java.io.ByteArrayOutputStream();
org.apache.xml.serialize.OutputFormat outputFormat =
new org.apache.xml.serialize.OutputFormat(xmlDoc);
org.apache.xml.serialize.XMLSerializer x =
new org.apache.xml.serialize.XMLSerializer(
byteStream,
outputFormat);
x.serialize(xmlDoc);
when it creates a byte stream or a file, it has following line;
<?xml version="1.0" encoding="UTF-8"?>
For certain reasons, I want to suppress the words encoding="UTF-8"
I do not want the serializer to write above attribute.
How do I do it?
regards
Haresh
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
RE: suppress encoding="UTF-8" while serializing a DOM
Posted by Haresh Gujarathi <gh...@pn2.vsnl.net.in>.
Well, I am using XML serializer to serialize... into file/byte array.
there seems to be no control over the xml header (except for deleting)
-- haresh
-----Original Message-----
From: Rick Bullotta [mailto:rick.bullotta@lighthammer.com]
Sent: Friday, March 08, 2002 6:41 PM
To: xerces-j-user@xml.apache.org
Subject: RE: suppress encoding="UTF-8" while serializing a DOM
Have you looked at the Xalan serializers as an alternative?
Rick Bullotta
CTO
Lighthammer Software (www.lighthammer.com)
-----Original Message-----
From: gharesh@vsnl.com [mailto:gharesh@vsnl.com]
Sent: Thursday, March 07, 2002 3:23 PM
To: xerces-j-user@xml.apache.org
Subject: suppress encoding="UTF-8" while serializing a DOM
Hi,
I am using following code to serialize a DOM to a byte stream or a file.
java.io.ByteArrayOutputStream byteStream = new
java.io.ByteArrayOutputStream();
org.apache.xml.serialize.OutputFormat outputFormat =
new org.apache.xml.serialize.OutputFormat(xmlDoc);
org.apache.xml.serialize.XMLSerializer x =
new org.apache.xml.serialize.XMLSerializer(
byteStream,
outputFormat);
x.serialize(xmlDoc);
when it creates a byte stream or a file, it has following line;
<?xml version="1.0" encoding="UTF-8"?>
For certain reasons, I want to suppress the words encoding="UTF-8"
I do not want the serializer to write above attribute.
How do I do it?
regards
Haresh
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
RE: suppress encoding="UTF-8" while serializing a DOM
Posted by Rick Bullotta <ri...@lighthammer.com>.
Have you looked at the Xalan serializers as an alternative?
Rick Bullotta
CTO
Lighthammer Software (www.lighthammer.com)
-----Original Message-----
From: gharesh@vsnl.com [mailto:gharesh@vsnl.com]
Sent: Thursday, March 07, 2002 3:23 PM
To: xerces-j-user@xml.apache.org
Subject: suppress encoding="UTF-8" while serializing a DOM
Hi,
I am using following code to serialize a DOM to a byte stream or a file.
java.io.ByteArrayOutputStream byteStream = new
java.io.ByteArrayOutputStream();
org.apache.xml.serialize.OutputFormat outputFormat =
new org.apache.xml.serialize.OutputFormat(xmlDoc);
org.apache.xml.serialize.XMLSerializer x =
new org.apache.xml.serialize.XMLSerializer(
byteStream,
outputFormat);
x.serialize(xmlDoc);
when it creates a byte stream or a file, it has following line;
<?xml version="1.0" encoding="UTF-8"?>
For certain reasons, I want to suppress the words encoding="UTF-8"
I do not want the serializer to write above attribute.
How do I do it?
regards
Haresh
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org