thanks a lot
It's working perfectly
lobrys
"Oleg Tkachenko" <oleg@NO_SPAM_PLEASEtkachenko.com> a écrit dans le message
de news:
udoKmxLYDHA.2464@TK2MSFTNGP09.phx.gbl...[color=blue]
> msnews.microsoft.com wrote:
>[color=green]
> > Here is another EASY question
> >
> > When you serialise an object in .NET, serialisation adds defaut[/color][/color]
attributes[color=blue][color=green]
> > that I dont care
> >
> > EXEMPLE :
> > <root_test xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> > ......
> > ...
> > </root_test>
> >
> > my class is :
> > Public Class root_test
> > ...
> > end class
> >
> > I dont want these parameters...
> > I just want this : <root_test>....</root_test>
> >
> > how can i do?????[/color]
>
> Test test = new Test();
> XmlSerializer serializer = new XmlSerializer(typeof(Test));
> //Here is the trick
> XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
> ns.Add("", "");
> serializer.Serialize(Console.Out, test, ns);
>
> --
> Oleg Tkachenko
>
http://www.tkachenko.com/blog
> Multiconn Technologies, Israel
>[/color]