spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / xml / column68

dtddoc step 4: Generating HTML

Developer News
MicrosoftÂ’s Automated Agent: Can We Talk?
Borland Finally Sells CodeGear
Red Hat Heads For The JON 2.0

In this last installment of our mini-series on documenting DTDs we finish our dtddoc tool by generating the HTML pages out of the parsed DTD and its annotations. This is the fourth and final step in its creation:

  1. Parsing a DTD
  2. Creating the internal data structure
  3. Adding element and attribute descriptions
  4. Generating HTML

Generating HTML

Now that we have collected all the available information from a DTD and found a suitable format for annotating it, our last task is to pour that content into a nice format. Registering my project on SourceForge I realized there is already a DTDDoc project. Shame on me for not looking there in the first place, but examining the output of that software reveals similar weaknesses to the already introduced dtd2html:

Comparing all the strengths and weaknesses of the existing solutions I ended up with the following page structure:

  1. One overview page for the introduction of the documented DTD.
  2. One tree page detailing the hierarchical structure of a DTD's elements.
  3. One index page listing all DTD tokens in alphabetical order.
  4. One page per DTD element denoting the content model, all attributes, and parent elements.

Frames are not used as in javadoc, because a DTD is roughly equivalent to one Java package, and the frame navigation is only really useful for navigating across many packages at the same time. DTDs are not interrelated in the same way, something that might change with XML Schema and RELAX NG.

I want to spare you all the gory coding details, they are available as source code listings in the various language sections below. The whole package for all three languages is also available.

The Java implementation

The Java solution delegates the generation of the various pages to a specialized method, passing along a java.io.Writer object for the respective output file. Navigating the in-memory data structure for DTD elements proved to be cumbersome for our purposes, so I reverted to the ORO regular expression matching for processing an element's content model. Every element name is augmented with a hyperlink to its respective detail page. You can inspect the source code.

On to PHP and Perl...


Produced by Michael Claßen


JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES
webref The latest from WebReference.com Browse >
Perl Pragma Primer · Implement Drag and Drop in Your Web Apps: Part 2 · How to Create an Ajax Autocomplete Text Field: Part 5
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
SQL Server 2005 Express Edition - Part 22 - Upgrading from Microsoft SQL Server Desktop Engine (MSDE) · Vyatta: Downgrades that Pay Off · NetMotion Brings Cross-Network Support to Wireless VoIP

URL: http://www.webreference.com/xml/column68/index.html
Created: Nov 11, 2002
Revised: Nov 11, 2002