ChapterÂ 17.Â XMLC
XMLC uses XML technology to make HTML files into resources for Java. It was created by Lutris as part of their open source Enhydra Application Server and can be downloaded separately for use with any other servlet container. Here we talk about XMLC 1.2b1, available for download at http://xmlc.enhydra.org. XMLC requires JDK 1.1 or later and any version of the Servlet API. Itâs released under the Enhydra Public License (EPL), an open source license similar to the Mozilla Public License (MPL). Basically, it requires changes to the existing code to be contributed back but allows private extensions, even commercial ones.
XMLC stands for XML Compiler . The tool takes a standard HTML or XML document and âcompilesâ it into a Java class. That class contains the Java instructions necessary to create an XML DOM (Document Object Model) tree representation of the document in memory. A programmer can manipulate the in-memory tree to add dynamic content and after manipulation can output the modified tree as HTML, XHTML, or any other XML.
In traditional use, a page designer creates one or more
âmock-upâ versions of the web page being developed. The
mock-ups are pure HTML files. They are reviewed by interested
parties, discussed, debated, and fine-tuned as necessary. The
designer doesnât need to add any XMLC instructions into the
file, only HTML 4.0-compliant
ID attributes to the
areas in the page to be replaced with dynamic content.
Offline, the XMLC tool compiles ...