 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jano Guest
|
Posted: Mon Sep 26, 2005 5:33 pm Post subject: XML Deserialization Problem |
|
|
Given:
XMLTest2 = class
public
ADouble: System.Double;
[System.Xml.Serialization.XmlIgnoreAttribute]
ADoubleSpecified: Boolean;
end;
I can deserialize:
<XMLTest2>
<ADouble>-450.56</ADouble>
</XMLTest2>
I can deserialize:
<XMLTest2>
<ADouble>450.56</ADouble>
</XMLTest2>
I can deserialize:
<XMLTest2>
<ADouble>0</ADouble>
</XMLTest2>
I cannot deserialize
<XMLTest2>
<ADouble></ADouble>
</XMLTest2>
Nor can I deserialize:
<XMLTest2>
</ADouble>
</XMLTest2>
Interestingly enough, this works:
<XMLTest2>
</XMLTest2>
What am i doing wrong? I know it has to do with the fact that the tag
for ADouble is present, but empty. How do I get around this?
Thanks!!
|
|
| Back to top |
|
 |
Jano Guest
|
Posted: Mon Sep 26, 2005 6:26 pm Post subject: Re: XML Deserialization Problem |
|
|
Ok, doubles can't be empty according to definition of xs:double type
in schemas.
Same for all numerics?
Get empty tags from customer for numeric data ALL the time. How do
others handle this? Declare as string to read it in and then convert
after checking for empty string?
Thanks!!
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|