Re: Writing SchemaLocation with XmlSerializer



declare a member of your type as this example in C#


[System.Xml.Serialization.XmlAttributeAttribute("schemaLocation",
Namespace = System.Xml.Schema.XmlSchema.InstanceNamespace)]
private string xsiSchemaLocation = "your schemalocation";

This will serliaze it as the schema location in your XML .

Joe Robe
RobeSoft.com


Marvin Massih wrote:
I've searched the entire MSDN documentation and Google, but I just don't
find a solution:

I have an .xsd file from which I had xsd.exe create classes.
How can I make the XmlSerializer write the SchemaLocation when it
serializes my XML classes? Maybe by using an XmlWriter?

-Marvin

.