469,646 Members | 1,596 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,646 developers. It's quick & easy.

Behavior of XmlRootAttribute when the object is not the root element

Could someone explain to me the ramifications of declaring
XmlRoot("namespace") on a series of classes in which one or more are
aggregates within another? I have a bunch of classes with a single
namespace declared as XmlRoots, but the serialized XML that is outputted
puts those namespace decls on different elements depending on whether or not
the root element is one of the classes or an array of that class.
Basically, if it's an array, then the child elements of the parent class
each have the namespace declared on them. However, I'm serializing the
parent as root, the namespace declaration is on the parent, and the children
inherit it. The main problem with all of this is that these rules also
apply to deserialization, but I cannot determine what the serialization rule
actually is with regards to XmlRoot, as I can't see any real pattern that I
can describe in words.
Feb 28 '06 #1
0 897

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Keith Patrick | last post: by
5 posts views Thread by John Lee | last post: by
3 posts views Thread by Jerome Cohen | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.