ASPCompiler GenerateDoc method
ASP Compiler 1.1 documentation is under development. See also the examples.

The GenerateDoc method regenerates the document as string from the passed document object model's tree. Typically this tree is previously obtained through call to the ParseString method and was modified by the ASP page before calling the GenerateDoc method. More complex ASP pages may implement advanced tricks by combining several trees in one or creating the tree from parts obtained from different sources.


stringvar = parser.GenerateDoc( tree [, GenAttribs [, isXML]])


tree - VarDictionary collection of collections representing the document tree. Typically obtained from ParseString method and modified by the page.

GenAttribs - (optional, default is True). If set to False the attributes of the nodes in the tree will not be generated. Fastest way will be used instead. This option is rarely needed and is recommended only for pages extracting information from HTML pages. For template oriented usage this option should be always True.

isXML - (optional, default is False). If set to True the self closing tags will be generated with "/>" at the end - for compatibility with the XML parsers.


Set parser = Server.CreateObject("newObjects.utilctls.TextEmbedParser")
' Use AddTag to configure it
' Pass a HTML to the ParseString method
' Modify the resulting tree
Response.Write parser.GenerateDoc(modified_tree)


 Note that TextEmbedParser is HTTML oriented. It is possible to parse some XML files with it but it is not designed for that purpose! For example XML assumes case sensitive tags but HTML tags are case insensitive. However this parser could be used to extract some information from a HTML file and pack it in XML. Of course this is not always possible, because HTML is layout oriented and doesn't describe the contained information. In some cases it is possible to extract meaningful information from a set of HTML pages that follow a common design. Then this parser could be used to extract tags by some characteristics - such as background color or other visual settings. Copyright 2001-2006 newObjects [ ]