Cloning and Templates

The nature of the dynamic manipulation of HTML ranges from straightforward, localized content replacement to the making of wholesale changes to the structure of the document. In this section, we will walk through strategies for using cloned portions of a DOM template to build new DOM structure and content.

Content Substitution

Template manipulation can take the form of simple replacement of placeholder or mockup content. Taking advantage of the role of the id attribute in XMLC programming turns this into a trivial task:

<HTML>
<BODY>
<P>Street Address: <SPAN id=vendorAddress>111 AAA Way</SPAN>.
</BODY>
</HTML>

In this simple HTML example, no additional markup is actually being created or reworked. Our intent is to simply ...

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.