Hi guys!
I have PB 2019 R2 and for the first time I have to create XML document with PBDOM.
So at the beginning of new xml file I have to write Processing instruction:
<? xml version="1.0" encoding="utf-8" standalone="yes"?>
My sample code:
PBDOM_PROCESSINGINSTRUCTION pbdom_proc
PBDOM_DOCUMENT pbdom_dokument
PBDOM_ELEMENT pbdom_elem_root,pbdom_acc_header
PBDOM_ELEMENT pbdom_orgid
PBDOM_ATTRIBUTE pbdom_attr
PBDOM_TEXT pbdom_txt
pbdom_dokument = Create PBDOM_DOCUMENT
pbdom_dokument.NewDocument("Accounting")
pbdom_elem_root = pbdom_dokument.GetRootElement()
pbdom_acc_header = Create PBDOM_ELEMENT
pbdom_orgid= Create PBDOM_ELEMENT
pbdom_acc_header.setname("AccontingHeader")
pbdom_orgid.setname("OrganizationId_DK")
pbdom_orgid.AddContent("2")
pbdom_elem_root.AddContent(pbdom_acc_header)
pbdom_acc_header.AddContent(pbdom_orgid)
pbdom_dokument.savedocument("c:\test.xml")
/////////////////////
How and where to code Processing instructions that will be at the beginning of xml file? Could someone show me?
Thanks and stay healthy!
Tomaz
that was solution I was looking for!
I got impression that not many PB developer use PBDOM for xml processing? Do you all use Datawindows xml templates?
I am missing some good example of using PBDOM in PB documentation, and also in PB Example App.
Regards
Tomaz
I also used PBDOM occasionally for modifying (or combining) the xml generated from the Datawindow template xml.
My main use of PBDOM was for parsing existing xml for processing rather than for creating xml. It is quite powerful once you get the hang of it.