XML Serialization without xmlns:xsd stuff??

  • Thread starter Thread starter W. Jordan
  • Start date Start date
Hi,

You can supply an XMLserizlizernamespaces object with one entry of a blank
namespace, when you invoke the serializer. The following code snippet
demonstrates:

xmlnsEmpty = New XmlSerializerNamespaces
xmlnsEmpty.Add("",
SWONLINEIEPREPORTS.Declarations.SchemaVersion)
xmltIEP = New
XmlTextWriter(schoolwarebaseME.CommandParameters.Parameters(1),
Text.Encoding.UTF8)
xmlsIEP = New
Serialization.XmlSerializer(GetType(SWONLINEIEPREPORTS.uploadfile))
xmlsIEP.Serialize(xmltIEP, ieprUploadfile,
xmlnsEmpty)'<---
xmltIEP.Close()

SWONLINEIEPREPORTS is a class generated from an XSD file by the Microsoft
supplied utility. If the class being serialized does not specify a namespace
on any of the XMLAttribute's in the class then replace:
SWONLINEIEPREPORTS.Declarations.SchemaVersion
with "" in the .add method of the XMLSerializerNamespaces object.

Hope this isn't too obscure. Good Luck,
 
Hello Robert,

It does works.
Thank you very much for your code!


--

Best Regards,
W. Jordan
 
Back
Top