Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: XML
-
Labels:None
-
Environment:all environments; this is a known weakness of the default Marshaler
-
Number of attachments :
Description
The key issue is when multiple namespaces are used. You can preload
the Marshaler instance with your namespaces so that it declares them on
the root node. So it doesn't have to keep declaring them over and over
as they drop in and out of scope in the XML. However I understand that
in generic solutions this isn't always possible to know this at coding
time.
So if you have generated descriptors it is possible to search through
these and build up a list of namespaces that would be needed to
serialise a given object graph. It can be an expensive operation so you
should probably cache the results.