BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

XML Deserialization Problem

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi XML
View previous topic :: View next topic  
Author Message
Jano
Guest





PostPosted: Mon Sep 26, 2005 5:33 pm    Post subject: XML Deserialization Problem Reply with quote



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





PostPosted: Mon Sep 26, 2005 6:26 pm    Post subject: Re: XML Deserialization Problem Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi XML All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.