How XMLC Constructs a DOM Class

When XMLC compiles a markup page into a DOM class or template, it generates an intermediate Java source file that contains the logic that is compiled into the Java class. The xmlc command option -keep instructs xmlc to leave the Java source file behind.

HTML Tidy parses the input markup file. XMLC then generates the DOM-building logic, using either the Xerces or the LazyDOM APIs. LazyDOM is the default parser. When the compiled DOM class is loaded during runtime execution, the Xerces or LazyDOM builds the DOM in memory.

Let's take a look at an extremely simple HTML source file and portions of the DOM-building Java source code assembled by the xmlc command:

<html>
<body>
<p>Hello World
</body>
</html>

You'll invoke ...

Get Enhydra XMLC™ Java™ Presentation Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.