471,053 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,053 software developers and data experts.

setting xsi:schemaLocation on XmlSerialize

I'm developing a GUI application in C#. I have a schema
file (.XSD) and am able to serialize and deserialize the
applications data using the schema file to an .XML file.
(I'm using xsd.exe to generate my serializable class,
XmlSerializer to Serialize and DeSerialize and
XMLValidatingReader to validate.

My intention is that application users can edit the
content of the .XML file using their favorite XML editor
as well as by using my app. However I want the user's XML
editor to be aware of my .XSD file. In a previous posting
Priya Lakshminarayanan pointed out that, within the .XML
file, I could specify the location of the schema file
using an xsi:schemaLocation attribute. (Many thanks

I would therefore like to provide an xsi:schemaLocation
attribute in my .XML file, (pointing to the .XSD file),
when the file is serialized.

The sensible place for the .XSD file would seem to the the
application's installation folder. However, I will be
shipping my application using MSI installer and so I will
not know until run-time the location of this file.

How can I persuade XmlSerializer to write the following
Root attributes at run-time?


Many thanks

Nov 11 '05 #1
0 2479

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Sarah Tegtmeier | last post: by
reply views Thread by kolja2003 | last post: by
2 posts views Thread by grochmal | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.