Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

XML Newbie question - Populating data

27 views
Skip to first unread message

ezi...@gmail.com

unread,
Jan 6, 2016, 7:58:28 AM1/6/16
to
Folks:

My question is simple, but i'm newbie working with xml files and XMLDataBinding Wizard...

I'm using Delphi XE7, and this is my DTD and Xml's files

DTD
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT Invoices (Record*)>
<!ELEMENT Record (InvoiceType, ShortName, Copies, Printing, Bin?)>
<!ELEMENT InvoiceType (#PCDATA)>
<!ELEMENT ShortName (#PCDATA)>
<!ELEMENT Copies (#PCDATA)>
<!ELEMENT Printing (#PCDATA)>
<!ELEMENT Bin (#PCDATA)>

XML
<?xml version="1.0"?>
<Invoices attribute="Bla bla bla bla">
</Invoices>

For the first time when the client decide populate data, I write this code:

Invoices: IXMLInvoicesType;
....
Invoices := GetInvoices(XMLInvoices); //XMLInvoices is TXMLDocument object
......
Record: IXMLRecordType;
Record := Invoices.Add;
Record.InvoiceType := 'bbla bla';
Record.ShortName := 'bla bla';
Record.Copies := 'bla bla';
Record.Printing := 'bla bla';
Record.Bin := 'bla bla';

XmlInvoices.SaveToFile(destPath);

--------------
So far so good. But when I want to add more data to the XML file (now with "n" records), only adds the last and deletes previous records...
What's wrong??

TIA

Ernesto



0 new messages