Hello all,
I am starting on a new project at work using XML and C#, and am new to
C#. I am attempting to serialize a class to an XML file, and am coming
across a problem that I hope someone can help with. I've spent the
better part of a few hours researching the problem and can't seem to
find a solution.
Below is a sample of the XML that is output when I serialize my class.
As you can see, there is an element called <City Description>.
<?xml version="1.0" encoding="utf-8" ?>
- <Address xmlns:Address="Address:City"
xmlns="http://www.xmllegal.org/Address/02/">
<City Description>Test12</City>
</Address>
This is fine, but the problem I am having is that I need to qualify the
element names with the "Address" namespace. For example...
<City Description>
should be....
<Address:City Description>
I've attempted to use the XmlSerializeNamespaces, but that only places
the namespace at the top of the XML, and does not qualify the element
names with the namespace. Could someone tell me how you go about
qualifying the elements with a namespace, or point me in the right
direction?
Sincere thanks in advance.
Chris Olson