- TOMAZ KRALJ
- PowerBuilder
- Monday, 11 January 2021 02:20 PM UTC
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
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.