I can't figure out how to add simple XML and Doctype declarations to an XML file I am generating. I'm creating and adding nodes fine but that code doesn't seem to work for doing this. My code is as follows:
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
Set objDoctype = xmlDoc.createElement("DOCTYPE")
xmlDoc.appendChild objTop
I found this link: http://www.example-code.com/vbscript/xml_doctype.asp which doesn't seem to work for me because it looks like they are editing the file as a TXT file.
Also, I need to add this declaration to the top of my XML file:
<?xml version="1.0" encoding="UTF-8"?>
Thanks for your help!
EDIT
What I would like to see on the top of the XML file is:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE catalog SYSTEM "shopstyle-catalog.dtd">
Thanks!
<?xml version="1.0" encoding="UTF-8"?>is, in fact, the default. It's not required unless your XML document has a different version or encoding.