Creating a HTML document

I just need to create a couple of HTML files. I just need the files, outside
a browser and such. I know how to create XML files using the DOM, but I
cannot find examples of creating HTML files. I know I could create a XML
file and then transform that to HTML, and I will do that if I don't find the
direct solution. I also could create the file by simply writing text to a
file, but I won't do that.

Since the requirement is so general, it is difficult for me to search for
answers. If someone can tell me where there is an article explaining what I
need to do, then I will read that. I don't need all the details. Sample code
using JavaScript should be enough.

I am actually developing my program using Microsoft Visual C++ in a console
program. Their implementation of the DOM is frustrating. I hope that if I
have something that shows and/or explains how to do what I need to do using
the standard that I can match that with the Windows implementation. I hope.

I have gotten to the point where a file is created with the following
record, but only this record. If I know what DOM objects and functions I
need to use to create the HTML, HEAD and BODY tags, then I should be able to
figure out the rest.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

Received on Monday, 23 July 2007 23:36:02 UTC