Connecting Tech Pros Worldwide Forums | Help | Site Map

Re: XmlSerializer not reading some attributes with redundant explicitnamespace

Martin Honnen
Guest
 
Posts: n/a
#1: Oct 15 '08
Konrad Anton wrote:
Quote:
[XmlRoot(ElementName="thing", Namespace="http://eins")]
public class ExampleXmlSerializable
{
[XmlAttribute(AttributeName = "price", Namespace = "http://eins")]
You need to set the Form here too e.g.
[XmlAttribute(AttributeName = "price", Namespace = "http://eins",
Form = System.Xml.Schema.XmlSchemaForm.Qualified)]


--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Konrad Anton
Guest
 
Posts: n/a
#2: Oct 15 '08

re: Re: XmlSerializer not reading some attributes with redundant explicitnamespace


Martin Honnen wrote:
Quote:
Konrad Anton wrote:
Quote:
>[XmlRoot(ElementName="thing", Namespace="http://eins")]
>public class ExampleXmlSerializable
>{
> [XmlAttribute(AttributeName = "price", Namespace = "http://eins")]
>
You need to set the Form here too e.g.
[XmlAttribute(AttributeName = "price", Namespace = "http://eins",
Form = System.Xml.Schema.XmlSchemaForm.Qualified)]
Thanks for the quick answer.

I was unaware of the small print in the interaction between XMLSchema
and namespaces, so my initial assumption (that my two documents were
equally valid for every notion of validity) was wrong; there apparently
is an XMLSchema which can tell them apart by means of xsd:attributeForm
and friends.

So I'll just publish an XMLSchema of my format, and the problem is gone.

--Konrad
Closed Thread