A system and method for dynamically generating Web content using a parse
tree is described. A template describing a dynamically generated Web page
is built. The template includes a script written in a tag-delimited page
description language. One or more markers included within the template
each indicate a relative location within the Web page for dynamic content
insertion. The hierarchical nature of the page description language is
used to infer a set of display regions, which are referenced by a parse
tree. The parse tree includes a plurality of nodes structured into
levels. Each node corresponds to structural tags specified within the
script. Each successive level represents a further nesting of the
structural tags within the script. A controller program invokes a
document engine and specifies a particular template. Each marker may be
substituted with dynamic content zero, one or several times each. The
document engine accepts substitution requests from the controlling
program and implements specific inclusion rules that ensure well-formed
output documents. The dynamic content is inserted into the display region
for the substituted marker. Each node located in a level of the parse
tree previous to the node corresponding to the substituted marker is
processed. The output structure is scanned and the document is rendered
with the dynamic content included therein.