By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,376 Members | 1,718 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,376 IT Pros & Developers. It's quick & easy.

XmlSerializer Namespace problem

P: n/a

I have a set of classes I created from schema files using the xsd.exe
tool. I'm using namespaces in the clases ( I had to because I have
some classes with the same name but not the same class )
Here is how a given class wil looks like.

IsNullable:=False)> _
Public Class ClassName

End Class

So far so good.

My problem is that I want to deserialize the xml document back, but
the xml document don't have the namespaces. I use the
XmlAttributeOverrides collection to solve the problem by ignoring the
namespaces, but so far I have to add an XmlAttribute for each type
(Class) I want to override.
something like this:

Dim atts As New XmlAttributes
Dim xover As New XmlAttributeOverrides

atts.Xmlns = False

xover.Add(GetType(ClassName), atts)

MyObject = CType(oSerializer.Deserialize(oReader), ClassName)

Is there a way I can tell the serializer to ignore the namespaces for
all types without having to write each type?

Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.