Ever Olano
7/15/2002 9:29:00 PM
Hi, Mickey. It looks like you wrote XmlNoPrefixTextWriter yourself as I
could not find it in the documentation. What did you have to do
specifically to disable the prefix?
Thanks,
Ever
"Mickey Williams" <mw@codevtech.com> wrote in message
news:uRtBZagKCHA.2324@tkmsftngp13...
> This is what I use:
>
> XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces();
> namespaces.Add(string.Empty, string.Empty);
> XmlSerializer serializer = new XmlSerializer(typeof(Order));
> StringWriter stringWriter = new StringWriter();
> XmlNoPrefixTextWriter writer = new XmlNoPrefixTextWriter(stringWriter);
> writer.Formatting = Formatting.Indented;
> writer.Indentation = 4;
> writer.Namespaces = false;
> serializer.Serialize(writer, order, namespaces);
>
> XmlNoPrefixTextWriter is just a subclass of XmlTextWriter that doesn't
emit
> a document prefix.
>
> --
> Mickey Williams
> Author, "Microsoft Visual C# .NET", Microsoft Press
>
>
> "Ever Olano" <no@spam.com> wrote in message
> news:el2s72fKCHA.2736@tkmsftngp13...
> > How do I get rid of the xlmns:xsd and xlmns:xsi attributes in the XML
file
> > generated by XmlSerializer.Serialize()? I thought that passing an empty
> > XmlSerializerNamespaces object would do it but it didn't. :(
> >
> > Thanks!
> >
> >
>
>