To understand Custom Tags, you need to understand how EWD's compiler works. EWD's compiler is essentially an XML transformation engine. The starting-point is your EWD source page which will be a combination of HTML, EWD custom tags, Javascript, stylesheets and references to back-end scripts. The compiler first converts your page into properly structured XML and creates a Document Object Model (DOM). The compiler can then transform your page into an equivalent DOM representing the final run-time version of your page for the technology you selected (PHP, CSP, Java Server Pages etc). The final DOM is then output as a file.

Once the page is converted to an XML DOM, the compiler works by repeatedly searching for tags that it knows it needs to convert. EWD has a list of registered custom tags that it knows to search for within the DOM. Each time it finds an instance of one of these tags it passes control to a method associated with that tag, known as a tag processor. A tag processor is a method that describes the transformations that will be made to the page DOM to convert the custom tag into the actual run-time markup etc. These transformations are defined using the XML DOM API methods and macros that are built into EWD.

What makes EWD's Custom Tags so powerful is that a tag processor has complete unrestricted access to the entire page DOM. As a result, a tag processor method can literally do anything it wants to any part of the EWD page. The complexity of the transformations you may wish or need to perform within your tag processors is therefore unlimited.

Furthermore, your tag processor method can add other custom tags into the page DOM. Provided you don't introduce cyclically self-referencing tags or groups of tags, this means that you can layer custom tags to whatever depth you wish. Custom tags can therefore be defined in terms of other custom tags or blocks, allowing you to build ever more powerful and complex constructs.