Sample code for 30+ languages & platforms
PowerBuilder

Setting the XML DOCTYPE

See more XML Examples

Demonstrates setting an XML document's DOCTYPE. The sample code below produces the following XML output:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <body>This is the HTML body</body>
</html>

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
oleobject loo_Root

loo_Root = create oleobject
li_rc = loo_Root.ConnectToNewObject("Chilkat.Xml")
if li_rc < 0 then
    destroy loo_Root
    MessageBox("Error","Connecting to COM object failed")
    return
end if

loo_Root.Tag = "html"

loo_Root.DocType = "<!DOCTYPE html PUBLIC ~"-//W3C//DTD HTML 4.01 Transitional//EN~" ~"http://www.w3.org/TR/html4/loose.dtd~">"

loo_Root.NewChild2("body","This is the HTML body")

Write-Debug loo_Root.GetXml()


destroy loo_Root