An generic processor for html tag/element processing. The handlers are managed as a singlely linked list such that navigating the parent handlers will ultimately lead to the handler for the root element. Each node stores its attribute set so the context for a particular node can always be determined.
The handler also stores the handlers for child nodes so that a complete model of the node hierarchy is created. This hierarchy can be navigated both forwards and backwards. Visitors can used to build up properties such as fonts and styling by iterating over the node hierarchy, with each node being given the option to stop the iteration should the visitor go out of scope, for example if a style applies within a DIV element it should not be applied in the parent of the DIV, so the DIV handler should stop the iteration.
The tag handlers are abstract so that derived classes are forced to define the newInstance method, this is necessary as the XHtmlBuilder holds a set of prototype objects for each tag type. Thus, to customize the handling of a particular tag type a new handler should be inserted into the builder. The builder can then instantiate the correct type of handler for each tag encountered.
Copyright (c) Xoetrope Ltd., 2002-2006
$Revision: 1.2 $
License: see License.txt
|
|
|
|
|
|
|
|