473,383 Members | 1,818 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

XML Declaration not serialized

Hi,

I'm trying to serialize a DOM using the xalan package. I have a
problem with the XML declaration not getting printed. Here's a snippet
of code showing the initialization of the
org.apache.xalan.serialize.SerializerToXML:

Properties outputFormat =
OutputProperties.getDefaultMethodProperties(Method .XML);
outputFormat.put(OutputProperties.S_KEY_INDENT_AMO UNT, "3");
outputFormat.put(OutputKeys.INDENT, "yes");
outputFormat.put(OutputKeys.OMIT_XML_DECLARATION, "no");
serializer = new SerializerToXML();
serializer.setOutputFormat(outputFormat);

The indent & indent amount properties do work as I see proper
indentation in the serialization output. However the XML declaration
does not appear in the serialized output.

Can someone please help? I can't figure where to output that damn XML
header.
Jul 20 '05 #1
1 1550
It is not necessary to use the XML declaration in version 1. You
probably should not use it if it is giving you that kind of problem.
--------------------------------------------------------------------------
Guillaume Jeudy wrote:
Hi,

I'm trying to serialize a DOM using the xalan package. I have a
problem with the XML declaration not getting printed. Here's a snippet
of code showing the initialization of the
org.apache.xalan.serialize.SerializerToXML:

Properties outputFormat =
OutputProperties.getDefaultMethodProperties(Method .XML);
outputFormat.put(OutputProperties.S_KEY_INDENT_AMO UNT, "3");
outputFormat.put(OutputKeys.INDENT, "yes");
outputFormat.put(OutputKeys.OMIT_XML_DECLARATION, "no");
serializer = new SerializerToXML();
serializer.setOutputFormat(outputFormat);

The indent & indent amount properties do work as I see proper
indentation in the serialization output. However the XML declaration
does not appear in the serialized output.

Can someone please help? I can't figure where to output that damn XML
header.


Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Douglas Buchanan | last post by:
Newbie to donnet This is an example of a structure given in vs.net help ============================ Private Structure Employee Public GivenName As String ' This employee's given name....
3
by: raj | last post by:
Can any one let me know how I can DOCTYPE (DTD declaration) to the XML generated by XmlSerializer
0
by: Ray Mitchell | last post by:
Hello, The result of auto-converting some Java code to C# yielded the following upgrade issue regarding the original Java call to "reset()": public virtual void writeObj(Object obj) {...
0
by: Wim Hollebrandse | last post by:
Here's the scenario. I'm serializing a particular object, which contains other objects as properties. I have this particular enum type that won't get included in the serialized XML. For...
0
by: Pierre | last post by:
Hi, I'm trying to select specific nodes from a XmlDocument filled with a serialized object and to insert these nodes into another XmlDocument. The object is well serialized (see below). From a...
7
by: Neal Andrews | last post by:
Hi All, Does anyone know how to stop Events from being serialized in a class that uses the <Serializable()> attribute? I have tried using the <NonSerialized()> attribute but for some bizarre...
5
by: EqDev | last post by:
I have a class that is a control derived from UserControl. I want to use serialization and deserialization with this calss but I get an exception "Cannot serialize member...
0
by: bharathreddy | last post by:
Before going to that i want to say few thing on serialization : Serialization is the process of converting an object into a form that can be readily transported. For example, you can serialize an...
9
by: PI | last post by:
Hi Guys, I need some assistance with the following scenario please. I know this might be more of a MySQL post than a PHP one, but it is likely some developer has been here before and would be...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.