Использование набора данных вы можете почти получить там (если вы не заботиться о порядке элементов):
define temp-table ttTest
field parent as recid xml-node-type "hidden"
field One as char
field Three as char
.
define temp-table ttTestTwo serialize-name "Two"
field parent as recid xml-node-type "hidden"
field name as char xml-node-type "attribute"
field Two as char xml-node-type "text"
.
define dataset ds serialize-hidden
for ttTest,ttTestTwo
data-relation for ttTest,ttTestTwo relation-fields(parent, parent) nested foreign-key-hidden.
create ttTest.
assign
ttTest.parent = recid(tttest)
ttTest.One = "bla"
ttTest.Three = "blablabla"
.
create ttTestTwo.
assign
ttTestTwo.parent = recid(ttTest)
ttTestTwo.name = "something"
ttTestTwo.Two = "blabla"
.
def var lcc as longchar.
dataset ds:handle:write-xml("longchar", lcc, true).
message string(lcc) view-as alert-box.
Выход затем:
---------------------------
Message
---------------------------
<?xml version="1.0"?>
<ttTest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<One>bla</One>
<Three>blablabla</Three>
<Two name="something">blabla</Two>
</ttTest>
---------------------------
OK
---------------------------
Работал как шарм. Спасибо! – Ivan