Link to home
Start Free TrialLog in
Avatar of dj_user2
dj_user2

asked on

Add Doctype to XML document

I am creating an xml document like this:

Set XMLdoc = Server.CreateObject("MSXML2.DOMDOCUMENT.4.0")
XMLdoc.insertBefore ...
XMLdoc.appendChild ...

I want to add Doctype to this xml document. How do I do that? Looks like I cannot use XMLdoc.CreateProcessingInstruction to add Doctype.
ASKER CERTIFIED SOLUTION
Avatar of Om Prakash
Om Prakash
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sybe
sybe

>  Looks like I cannot use XMLdoc.CreateProcessingInstruction to add Doctype.

Why not?

<%
sCharSet  = "UTF-8"
Set oInstruction = oXML.createProcessingInstruction("xml", "version=""1.0"" encoding=""" & sCharSet & """")
oXML.insertBefore oInstruction, oXML.childNodes.item(0)
%>
Avatar of dj_user2

ASKER

None