Newsgroups: microsoft.public.dotnet.xml
From: "Christoph Schittko" <ChristophDotNetINVA...@austin.rr.com>
Date: Thu, 25 Jul 2002 11:00:16 -0500
Local: Thurs, Jul 25 2002 12:00 pm
Subject: Re: serialization: get rid of unwanted xmlns attributes
Yeah, I should not post before I had time for my morning coffee ...
You actually have to add an empty namespace declaration to the XmlSerializerNamespaces ns = new XmlSerializerNamespaces(); will do the trick. HTH, > On Thu, 25 Jul 2002 09:31:33 -0500, "Christoph Schittko" XmlSerializerNamespaces > <ChristophDotNetINVA...@austin.rr.com> wrote: > >To get rid of them you have to pass in an empty new > >object to the Serialize() call: XmlSerializerNamespaces() ); > >serializer.Serialize( writer, yourObject, new > it doesn't work for me: > // this is to tell XmlSerializer to use UTF8 encoding > // as Christoph said > on the other hand, the initial serialized class looks like the > [XmlRootAttribute(ElementName="myCommand")] > produced XML looks like the following: > <?xml version="1.0" encoding="utf-8"?><myCommand > -------- > Francesco "Matro" Martire > RealPopup, the freeware winpopup replacer > MaTreo, freeware frontscreen for your Treo You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||