Community discussion forum

DataTable WriteXML Clean

  • 1 month ago

    Hi,

    Vistual Studio 2008 – 3.5 SP1 MySQL Server 5.1.30

    My problem: I need to use the .WriteXml method of a DataTable to write the XML to a file or stream. This I can do. The real problem is the fact that additional attributes are included in my output (IsDataSet=True, etc...), when I use the System.Data.XmlWriteMode.WriteSchema parameter on the .WriteXML method. This poses a major problem as my Web Service has to deliver neutral/agnostic XML and NOT .NET related information.

    What follows is an example of what I am returned when using the .WriteXML method with the problematic attributes bolded for emphasis. I need to ensure interoperability with other platforms as well as include XML schema information so that it is self-describing; what I don’t need is any Microsoft, .NET, or DataSet related attributes.

    I just can't believe that .NET does not provide a method by which to emit CLEAN (BasicProfile 1.1 compliant) XML from a DataSet and/or DataTable and inserts its own .NET specific type information. Is what I am asking too complicated? I thought Web Services were supposed to ensure interoperability.

    Can you please help me output neutral XML from a DataTable?

    Method: clientDataTable.WriteXml(@"C:\test.xml", System.Data.XmlWriteMode.WriteSchema);

    Output:

    Post was edited on 30/09/2009 15:05:57 Report abuse

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!