In unibasic, I have 2 select statements which produce XML output from
xmlexecute.
Both xml documents have the same format. I would like to merge these 2
documents into one with the first 2 documents below merging into xml3

Xml1:
<ROOT>
<Record att1="001" att2="something" />
<Record att1="002" att2="something" />
</ROOT>

Xml2:
<ROOT>
<Record att1="998" att2="something" />
<Record att1="999" att2="something" />
</ROOT>

Xml3:
<ROOT>
<Record att1="001" att2="something" />
<Record att1="002" att2="something" />
<Record att1="998" att2="something" />
<Record att1="999" att2="something" />
</ROOT>

The program is something like this:

Stat = xmlexecute(statement1,ops,xml1,'') ;* produces xml1
Stat = xmlexecute(statement2,ops,xml2,'') ;* produces xml2
Stat = xdomopen(xml1,@true,dom1)
Stat = xdomcreatenode(dom1,'Unknown',xml2,XDOM.DOC.FRAG.NODE,dom2)
Stat = xdomappend(dom1,'/ROOT/Record[last()]','',dom2,XDOM.NODUP)
Stat = xdomwrite(dom1, xml3, XML.TO.STRING) ;* produces xml3
Stat = xdomclose(dom1)
Stat = xdomclose(dom2)

I don't get any errors but I also don't get an appended node!
I'm thinking I may either have to use a transform or use a loop and
totally deconstruct and reconstruct xml2 into xml1 which seems like a
lot of effort.
(... or use a string manipulation - but I'd like to do it the 'right'
way).

Are there any silver bullets?
Anyone have any hints here?

Thanks,
Stuart Boydell


 
**********************************************************************
This email message and any files transmitted with it are confidential and 
intended solely for the use of addressed recipient(s). If you have received 
this communication in error, please reply to this e-mail to notify the sender 
of its incorrect delivery and then delete it and your reply.  It is your 
responsibility to check this email and any attachments for viruses and defects 
before opening or sending them on. Spotless collects information about you to 
provide and market our services. For information about use, disclosure and 
access, see our privacy policy at http://www.spotless.com.au 
Please consider our environment before printing this email. 
********************************************************************** 

_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to