(VBScript) 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>
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.Xml")
set root = CreateObject("Chilkat.Xml")
root.Tag = "html"
root.DocType = "<!DOCTYPE html PUBLIC ""-//W3C//DTD HTML 4.01 Transitional//EN"" ""http://www.w3.org/TR/html4/loose.dtd"">"
root.NewChild2 "body","This is the HTML body"
outFile.WriteLine(root.GetXml())
outFile.Close
|