Jump to Real's How-to Main page

Create an XML file

set xdoc = CreateObject("MSXML2.DOMDocument")

set html = xdoc.appendChild(xdoc.CreateElement("HOWTOS"))
set list = html.appendChild(xdoc.createElement("TOPIC"))
set item = list.appendChild(xdoc.createElement("TITLE"))
set text = xdoc.createTextNode("Java")
item.appendChild text
set item = list.appendChild(xdoc.createElement("URL"))
set text = _  
   xdoc.createTextNode("http://www.rgagnon/javahowto.htm")
item.appendChild text

set list = html.appendChild(xdoc.createElement("TOPIC"))
set item = list.appendChild(xdoc.createElement("TITLE"))
set text = xdoc.createTextNode("Javascript")
item.appendChild text
set item = list.appendChild(xdoc.createElement("URL"))
set text = _
   xdoc.createTextNode("http://www.rgagnon/javascripthowto.htm")
item.appendChild text

xdoc.save "test.xml"

and the result is

<HOWTOS>
<TOPIC>
<TITLE>Java</TITLE>
<URL>http://www.rgagnon/javahowto.htm</URL>
</TOPIC>
<TOPIC>
<TITLE>Javascript</TITLE>
<URL>http://www.rgagnon/javascripthowto.htm</URL><
/TOPIC>
</HOWTOS>

If you find this article useful, consider making a small donation
to show your supportfor this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2007
[ home ]