You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Ben roche <cr...@hotmail.com> on 2009/01/15 05:06:40 UTC

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
_________________________________________________________________
Téléphonez gratuitement à tous vos proches avec Windows Live Messenger  !  Téléchargez-le maintenant ! 
http://www.windowslive.fr/messenger/1.asp

RE: Message in 1 line and without prefix

Posted by Radu Preotiuc-Pietro <ra...@oracle.com>.
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:creackers@hotmail.com] 
	Sent: Thursday, January 15, 2009 5:39 PM
	To: user@xmlbeans.apache.org
	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: radu.preotiuc-pietro@oracle.com
	To: user@xmlbeans.apache.org
	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:creackers@hotmail.com] 
		Sent: Wednesday, January 14, 2009 11:07 PM
		To: user@xmlbeans.apache.org
		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>  


RE: Message in 1 line and without prefix

Posted by Ben roche <cr...@hotmail.com>.
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: radu.preotiuc-pietro@oracle.comTo: user@xmlbeans.apache.orgSubject: RE: Message in 1 line and without prefixDate: 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:creackers@hotmail.com] Sent: Wednesday, January 14, 2009 11:07 PMTo: user@xmlbeans.apache.orgSubject: 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 ! 
_________________________________________________________________
Inédit ! Des Emoticônes Déjantées! Installez les dans votre Messenger ! 
http://www.ilovemessenger.fr/Emoticones/EmoticonesDejantees.aspx

RE: Message in 1 line and without prefix

Posted by Radu Preotiuc-Pietro <ra...@oracle.com>.
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:creackers@hotmail.com] 
	Sent: Wednesday, January 14, 2009 11:07 PM
	To: user@xmlbeans.apache.org
	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/>