Creating Dynamic Content with Enhydra XMLC (cont'd)

Adding Mock-up Content

The final version of StockQuotes.html provides mock-up data by adding two TR elements to the stock table. The static Web page representation of StockQuotes.html is pictured below. The addition of mock-up content allows a realistic view of the Web page layout. This is particularly important since the static view is often created before the code to generate dynamic content has been developed.

 
Figure 3 | Example of StaticStockQuotes

  <TR class="DummyData">
    <TD>AABK</TD>
    <TD>Aardvark Bricks</TD>
    <TD ALIGN="right">$5.12</TD>
  </TR>
  <TR class="DummyData">
    <TD>ABC</TD>
    <TD>Another Bloated Company</TD>
    <TD ALIGN="right">$12.82</TD>
  </TR>

Note each table row is identified with the attribute class="DummyData". This designation facilitates removing the mock-up data before creating dynamic content. Again, since this functionality is so often needed, XMLC provides a convenient mechanism for removing mock-up data. The command to process

StockQuotes.html

becomes

xmlc -delete-class DummyData StockQuotes.html

The command line argument '-delete-class DummyData' instructs XMLC to strip any DOM elements containing the attribute class="DummyData". Now here's the best part. To make the necessary changes to the Java code to accommodate the addition of mock-up data requires .... nothing. That's right, nothing. Because XMLC facilitates a clean separation between mark up code and the Java code used to generate dynamic content, there is no change to the Java code itself. This simple XMLC mechanism proves quite valuable in separating the concerns of Web designers from Java developers. The Web designer responsible for maintaining StockQuotes.hl is free to add and remove mock-up data, or to even move the various HTML elements around the page, all without affecting the Java development team's code. As long as the ID attributes are not altered, XMLC manages the link between the markup language code and the Java code. Furthermore, the Web designer deals with a file containing only familiar HTML markup and needn't carefully navigate around unfamiliar Java code or JSP tags.

As you can see, XMLC is a great technology for adding dynamic content to Web pages. There is, of course, much more to XMLC, and I encourage you to give it a spin on your next Web-based application.

Wm. Paul Rogers is an application architect with Lutris Technologies who has written for a number of technical publications, including Java World, Java Report and IEEE Software magazines. He is based in Carmel, Calif.


Generating Dynamic Table Content

Back to Introduction

In this Article
Introduction Generating Dynamic Table Content
Generating Dynamic Text Content Adding Mock-up Content








FEATURE SOFTWARE:
dtSearch Web
Add power searching to your web site.
Buy Now!

Encrypt It
Encrypt and Decrypt Data, Passwords and Files within your application.
Buy Now!

FEATURE BOOK:
PointBase Mobile Edition
Enable local data access for mobile users.
Buy Now!
Enhydra.org

DevX Java 2 eLearning

DevX Java Zone

Product Review of the Week
Rational Suite 2001

Site of the Week

Book Review of the Week
Object-Oriented Implementation of Numerical Methods

Tip of the Day
Use Math.PI and Math.E for Scientific Calculations

Download of the Week
Ebitec JMS Mail Bridge





 
Sponsored Links

Advertising Info  |   Member Services  |   Contact Us  |   Help  |   Feedback  |   Site Map
Jupiterweb networks

internet.comearthweb.comDevx.comClickZ

Search Jupiterweb:

Jupitermedia Corporation has four divisions:
JupiterWeb, JupiterResearch, JupiterEvents, and JupiterImages

Copyright 2004 Jupitermedia Corporation All Rights Reserved.
Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Jupitermedia Corporate Info | Newsletters | Tech Jobs | E-mail Offers

Copyright Information/Privacy Statement