Well, if you create the document from scratch, the namespace doesn't exist
until you save your document to text. Then, there is a choice between using
"xmlns" or "xmlns:prefix" to save correct XML. By setting that option, you tell
the saver code you prefer "xmlns". Using the option when you call newInstance()
will have no effect.
Radu
________________________________
From: Ben roche [mailto:[email protected]]
Sent: Thursday, January 15, 2009 5:39 PM
To: [email protected]
Subject: RE: Message in 1 line and without prefix
Thanks Radu for the information, i will use the toString() only for
debug now.
It works if I call the setUseDefaultNamespace() as parameter in my
xmlText(). Is there a way to always delete this namespace ? (I try using this
option when i create a newInstance of my document but it does not work)
Thanks for your help !
________________________________
From: [email protected]
To: [email protected]
Subject: RE: Message in 1 line and without prefix
Date: Wed, 14 Jan 2009 23:30:09 -0500
First of all, let me repeat this: if you care how your XML text looks
like, *don't* use toString(), because toString() doesn't accept parameters. Use
toString() for debug only.
In your case, Ben, you also need XmlOptions.setUseDefaultNamespace()
Radu
________________________________
From: Ben roche [mailto:[email protected]]
Sent: Wednesday, January 14, 2009 11:07 PM
To: [email protected]
Subject: Message in 1 line and without prefix
Hi,
I want to send my XML message in 1 line, without any prefix.
When i use a toString method on my ObjectDocument, I have no
prefix but the xml is on several lines:
<Object>
<Table Ref="57807" Color="blue">
(...)
</Table>
</Object>
When i use a xmlText() methodm(with XmlOptions.setSaveOuter) on
my ObjectDocument, I have the xml in the same line but I've a prefix:
<ent:Object><ent:Table Ref="57807"
Color="blue">(...)</ent:Table></ent:Object>
How can I combine these 2 requirements ?
Thanks for the help
________________________________
Discutez sur Messenger où que vous soyez ! Mettez Messenger sur
votre mobile ! <http://www.messengersurvotremobile.com/>
________________________________
Souhaitez vous « être au bureau sans y être » ? Oui je le veux !
<http://www.microsoft.com/france/windows/bts/default.mspx>