Connecting Tech Pros Worldwide Help | Site Map

Re: XmlSerializer not reading some attributes with redundant explicitnamespace

  #1  
Old October 15th, 2008, 01:15 PM
Martin Honnen
Guest
 
Posts: n/a
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/
  #2  
Old October 15th, 2008, 02:25 PM
Konrad Anton
Guest
 
Posts: n/a

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