(PowerBuilder) Setting the XML DOCTYPE
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>
integer li_rc
oleobject loo_Root
loo_Root = create oleobject
// Use "Chilkat_9_5_0.Xml" for versions of Chilkat < 10.0.0
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
|