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 Data Binding and empty lists

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





PostPosted: Wed Jan 11, 2006 4:28 pm    Post subject: XML Data Binding and empty lists Reply with quote



Using the XML data binding wizard in Delphi 6 Enterprise I created the
delphi wrapper classes from a file DTD. One of the elements in the DTD is a
list (FLAG_99*..<!ELEMENT FLAG_99 (#PCDATA)>), in most cases this list is
empty. When I save the generated XML to a file there is no

<FLAG_99>

node to indicate the empty list. The system on the receiving end needs this
node, how can I force delphi to generate it ?.

eg.

:
XMLData : String;
tmpX : IXMLMyType;
:
:
tmpX := NewMyType; // Function generated by wizard returning IXMLMyType
(derived from IXMLNode)
:
:
tmpX.something.add.property := 'xxx';
:
XMLData := tmpX.XML; // No <FLAG_99> node present if I've never done
tmpX.FLAG_99.Add('yyy');

Thanks for any ideas

Ian Healy.




Back to top
Gigi
Guest





PostPosted: Wed Jan 11, 2006 5:04 pm    Post subject: Re: XML Data Binding and empty lists Reply with quote



I think you can force Delphi to write it by reading it.

For example you can write tmpX.FLAG_99.Count ad you will have your empty
tag, or bettere add an empty alement and remove it, for example
tmpX.FLAG_99.Add('');
tmpX.FLAG_99.Delete(0); // or remove i don't remember

Bye

"Ian Healy" <I.healy (AT) grupposisge (DOT) it> ha scritto nel messaggio
news:43c53120 (AT) newsgroups (DOT) borland.com...
Quote:
Using the XML data binding wizard in Delphi 6 Enterprise I created the
delphi wrapper classes from a file DTD. One of the elements in the DTD is
a list (FLAG_99*..<!ELEMENT FLAG_99 (#PCDATA)>), in most cases this list
is empty. When I save the generated XML to a file there is no

FLAG_99

node to indicate the empty list. The system on the receiving end needs
this node, how can I force delphi to generate it ?.

eg.

:
XMLData : String;
tmpX : IXMLMyType;
:
:
tmpX := NewMyType; // Function generated by wizard returning IXMLMyType
(derived from IXMLNode)
:
:
tmpX.something.add.property := 'xxx';
:
XMLData := tmpX.XML; // No <FLAG_99> node present if I've never done
tmpX.FLAG_99.Add('yyy');

Thanks for any ideas

Ian Healy.







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.