Hi Knut,
There is a method on XmlOptions that you can populate with a Map
containing Qnames for the namespaces in your document. I don't have
the javadoc in front of me, but I think its setSaveSuggestedPrefix().
I've also had some success walking the instance via the XmlCursor API
and adding namespaces that way.

I'm curious how all the elements in your instance are getting the
namespace declarations. Could you explain a bit more? It might help to
better frame the problem.
 -jacobd

On 12/10/07, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> Hi there all :)
>
> We are using xmlbeans in webservices with xfire and are sending quite
> large xmldocuments back and forth between the layers.
>
> Our problem is that the namepace declarations take up almost the same
> amount of space (in the sent xml file) as the actual data. This is due to
> the fact that each element declares it's namespace, not using what might
> have been declared allready by it's parentnodes. To remove these unwanted
> declarations, we do a :
>
> FindAgreementsResponseDocument.Factory.parse(findAgreementsResponseDocument.newReader(getXmlOptions()))
>
>
> where the Xmloptions are
>
> xmlOpt.setSaveAggressiveNamespaces();
> xmlOpt.setSaveNamespacesFirst();
>
> This forces (as I have understood the documentation) a double loop through
> the entire xml structure to first find all namespaces, and then to update
> all instances with the new ones. This gives us quite a performance hit
> both on memory and on cpu time.
>
> Is there any way to set on the documentinstance which namespaces we are
> going to use and use them when i call i.e.
> findAgreementsResponseDocument.addNewAgreement().
>
> This would solve both the xmlsize problem and the performance hit on the
> xmlOptions approach.
>
> Is there any such way to solve this, or is the xmlOptions the only way?
>
> Thanks in advance.
>
> mvh
> Knut-Erik Johnsen
>
>
> *********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity whom they
> are addressed. If you have received this email in error please notify
> the system manager.
>
> This footnote also confirms that this email message has been swept
> for the presence of computer viruses.
>
> *********************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to