[Mono-devel-list] problem in System.Xml.Serialization.TypeTranslator

Eran Domb erand at mainsoft.com
Mon Dec 15 07:34:56 EST 2003


Hello,
I have a problem in System.Xml.Serialization.TypeTranslator.
TypeTranslator has a primitiveTypes hashtable that initiates some XSD
types.
In MS .NET documentation there is also a table that describes each XSD
type which MS.NET type is related. But MONO implementation is different
from MS. Fro example:
In MONO positiveInteger (XSD type) is mapped to Decimal. In MS
positiveInteger is mapped to String.
The same happened in other XSD type.
 
Should we change the mapping as in MS .NET?
 
The problem pops up in the following code:
public class Items 
      {
            /// <remarks/>
 
[System.Xml.Serialization.XmlElementAttribute(DataType="positiveInteger"
)]
            public string quantity;
      }
 
if you try to Deserialize the following xml to Item instance we put a
decimal object into the string field!
 
<?xml version="1.0" encoding="utf-8"?>
<Item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <quantity>123</quantity>
</Item>
 
Thanks
Eran Domb
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20031215/175d74e3/attachment.html 


More information about the Mono-devel-list mailing list