You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Jo...@flagstar.com on 2005/02/14 22:23:14 UTC

Seeking resolution on removing printed xmlns for each tag in output file

Hello - 

I believe I have scoured the archives for this answer, but outside of 
custom code, I'm not able to find anything. 

Ultimately, the question boils down to: 

Is there a setting that will stop the printing of the xmlns attribute for 
every tag in my XML document? e.g., making my output, which currently 
looks like

<?xml version="1.0" encoding="UTF-8"?>
<chatlog xmlns="http://some.domain.com" username="bdalaly232">
   <session xmlns="http://some.domain.com" type="Start" 
time="1096912954"/>
   <message xmlns="http://some.domain.com" type="OutgoingMessage" 
time="1096912954" text="Hi"/>
   <message xmlns="http://some.domain.com" type="IncommingMessage" 
time="1096912954" text="Hey"/>
   <session xmlns="http://some.domain.com" type="Stop" time="1096913025"/>
</chatlog>

look instead like

<?xml version="1.0" encoding="UTF-8"?>
<chatlog xmlns="http://some.domain.com" username="bdalaly232">
   <session type="Start" time="1096912954"/>
   <message type="OutgoingMessage" time="1096912954" text="Hi"/>
   <message type="IncommingMessage" time="1096912954" text="Hey"/>
   <session type="Stop" time="1096913025"/>
</chatlog>

I have basically tried every combination of 

xmlOptions.setUseDefaultNamespace();
xmlOptions.setSaveAggresiveNamespaces();
xmlOptions.setSaveSuggestedPrefixes(suggestedPrefixes);
xmlOptions.setSaveImplicitNamespaces(implicitNamespaces);

That I can see available to me, but they don't seem to change the output 
any. 

Is there a simple resolution to this issue?

Joe


This e-mail may contain data that is confidential, proprietary or "non-public
personal information", as that term is defined in the Gramm-Leach-Bliley Act
(collectively, "Confidential Information"). The Confidential Information is
disclosed conditioned upon your agreement that you will treat it
confidentially and in accordance with applicable law, ensure that such data
isn't used or disclosed except for the limited purpose for which it's being
provided and will notify and cooperate with us regarding any requested or
unauthorized disclosure or use of any Confidential Information. By accepting
and reviewing the Confidential Information you agree to indemnify us against
any losses or expenses, including attorney's fees that we may incur as a
result of any unauthorized use or disclosure of this data due to your acts or
omissions. If a party other than the intended recipient receives this e-mail,
you are requested to instantly notify us of the erroneous delivery and return
to us all data so delivered.