XML Serialization without xmlns:xsd stuff??

G

Guest

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,
 
W

W. Jordan

Hello Robert,

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


--

Best Regards,
W. Jordan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top