DOM example: Web presentation |
|
Given the existence of the previously discussed Python addr.py module, the HTML presentation is written by a Python script named addr-web.
Here are the command line options to this script:
addr-web [-u] infile.xml
| -u | Show unlisted entries and phone numbers. Default is to omit them. |
| infile.xml | Name of the input file, valid according to address.dtd. |
Design considerations for this script:
Heavy use is made of Cascading Style Sheets to give the Web rendering an attractive styling. Here is a list of the principle rules in the address.css stylesheet:
| span.intro-date | The date/time stamp in the introductory paragraph. |
| span.phone | A phone number. |
| span.index-term | The string used to alphabetize this block. For a person, e.g., this will be 'Last[, First][ "Nick"]'. |
| span.org | An <org> element other than the index-term. |
| span.contact | The <contact> element in an <org>, if any. |
| span.person | A <person> element other than the index-term. |
| span.loc | A location (mail or street). |
| span.dir | The content from a <directions> element. |
| span.notes | The <notes> content if any. |