I had to do that once. What i ended up doing was override XmlTextWriter´s WriteStartDocument method. Just don´t call the base method and you are ok as far as writing the start document tags. Then you do something like so
XmlSerlaizerNamespaces nons = new XmlSerializerNamespaces() nons.Add(String.Empty, String.Empty) xmlSerializer.Serializer( yourcustomxmltextwriter, objectgraph, nons) hth On 7/14/06, Mike Andrews <[EMAIL PROTECTED]> wrote:
Guys, I've got a question I need to know if the serialization engine can have features turned off. This is a new question with a new set of objects, not related to the previous question regarding serialization. I'm building an xml document dynamically that I can use in SQL Server 2005's Xml data type. However, the objects that I'm serializing it puts this in it: <?xml version="1.0" encoding="utf-16"?> <Address xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd=" http://www.w3.org/2001/XMLSchema" id="ff9cd59a-d3de-4178-bc86-e0b933f5858b" AddressTypeID="f83bdc24-c8a0-460c-9e0f-925e03907cdd" City="Bigtown" StateCode="NV" ZipCode="88888" Country="" /> I want to have it eliminate the <?xml...?> and no xmlns:xsi or xmlns:xsd attribute. Is this possible? Thanks, Mike =================================== This list is hosted by DevelopMentor(r) http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
=================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com