How the HTML templates work?
The applications could do a lot of interesting work over a HTML file by using regular expressions or other text search/replace methods. But as the complexity grows the task becomes more difficult and more difficult. It is much more easier to perform some replacement and manipulation tasks over an object model of a page instead of treating it as plain text. This is what the TextEmbedParser does. The original page (template) is loaded in a string by the application (it could be loaded from a file, DB or another source) and passed to the pareser’s ParseString method. It returns the object model of the page represented by VarDictionary collections. The result returned is a typical “tree” structure, which means the retuned collection is the root of the document and it contains sub-collections to represent the particular nodes/sections of the document. Then the script (ASP for example) modifies the received object structure by deleting/adding/changing the nodes and passes it back to the pars