Færdiggjort

Delphi: Unit wrapper for basic XML read/write

Dear Coders,

I need a unit for Delphi 7 to create a XML file from the scratch and write values to it and read them at a later time.

When the empty XML file is created, we want to define all sections/subsections that are going to appear in the XML file and write values to them.

Suppose that we want to generate the following XML file:

**<DOCUMENT>

? <SectionA>

? ? ? ? ? ? <SectionA1>

? ? ? ? ? ? ? ? ? <keyA1>Hello<\keyA1>

? ? ? ? ? ? </SectionA1>

? ? </SectionA>? ? ? ? ? ?

? ? <SectionB>

? ?

? ? ? ? ? ? <SectionB1>

? ? ? ? ? ? ? ? ? <keyB1>Hello<\keyB1>

? ? ? ? ? ? </SectionB1>

? ? </SectionB>? ? ? ? ?

</DOCUMENT>**

We need a funtion to first define all the sections and subsections that our XML file will have. A possible solution would be the implementation of the following function:

CreateXMLSection(parentSectionName, SectionName);

For the above example it would be:

CreateXMLSection(nil, 'DOCUMENT');? ? // nil for the main section

CreateXMLSection('DOCUMENT', 'SectionA');

CreateXMLSection('DOCUMENT', 'SectionB');

CreateXMLSection('SectionA', 'SectionA1');

CreateXMLSection('SectionB', 'SectionB1');

Notice that we will NOT use same sub-sections names, so, the parent section can be found without ambiguity.

After we have defined the section names, we just insert data into it. Example (as shown above):

WriteString('SectionA1', 'keyA1', 'Hello World');

WriteString('SectionB1', 'keyB1', 'Hello World');

Functions that we need

------------------------------

CreateXML(pFileName)? // create an empty XML file

SaveXML();? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? // save our XML to file

LoadXML(pFileName)? ? ? // load our previous saved XML file

CreateXMLSection(parentSectionName, SectionName);

WriteString(Section, Key, Value)

ReadString(Section, Key)

WriteBoolean(....)

ReadBoolean(....)

WriteInteger(....)

ReadInteger(....)

The solution must be written in Delphi 7.

Thanks,

A.

## Deliverables

Delphi 7, Windows

Evner: Delphi, Ingeniørarbejde, MySQL, PHP, Software Arkitektur, Software Testning

Se mere: delphi coders, coders world, unit, nil, php funtion, php insert xml, php xml file use php, php write file xml, delphi file, xml wrapper, file load save, function delphi, php write xml file, read write xml, xml file appear, php function write, hello world delphi, read write data, load data xml, load data xml file

Om arbejdsgiveren:
( 62 bedømmelser ) Jerez de la Frontera, Spain

Projekt ID: #3328473

Tildelt til:

mokule

See private message.

$42.5 USD in 4 dage
(9 bedømmelser)
5.5

5 freelancere byder i gennemsnit $80 på dette job

igorvotinov

See private message.

$34 USD in 4 dage
(26 bedømmelser)
5.3
svikvw

See private message.

$255 USD in 4 dage
(13 bedømmelser)
4.5
Strelac021

See private message.

$42.5 USD in 4 dage
(8 bedømmelser)
3.9
rajvinsl

See private message.

$25.5 USD in 4 dage
(4 bedømmelser)
1.4