Dynamator Pure HTML for every page generation technology.

Dynamator Change Log

v 1.5 (2004/03/29)

New Features:

  • Added Dynamator file validation. Validation is the default behavior; to disable, use 'dynamate -V' (or in ant, 'validate="false"').
  • Added <extract> modifier to support recursion and fragment reuse. The <extract> modifier moves the associated element and its children to the file specified by the 'to-file' attribute, or to the end of the current file, immediately before the epilog. Added <before-extracts> and <after-extracts> low-level elements to specify code to be placed around the set of extracts.
  • Added dynamate option '-F[file]' (ant attribute 'dynfile') to specify the Dynamator file to be applied to template files instead of using name matching.

Removed Features:

  • Removed dynamator:copy. This was a problematic feature. Syntactically, it didn't belong with the rest of the language (as might be inferred from the name). Its implementation added significant complexity, and had a high performance cost. And when I searched my catalog of Dynamator applications, I found no remaining uses.

    If you need this feature, please send me a description of how you are using it.


  • Documentation changes:
    • Made download documentation identical to the website. Source for the website is now stored in CVS, as is the process used to create the website.
    • Integrated the tutorial into the website. The tutorial now requires a browser that supports iframes.
    • Revised the tutorial to eliminate tutorial.jar.
    • Moved Changes.html (this file) and Install.html to the documentation directory.
    • Converted the website to XHTML.
  • (Patch 896127, Chris Felaco) Implemented major performance enhancements and refactorings based on this patch:
    • Language-specific factory classes have been removed. After several years of evolution, Annotations objects are no longer language-specific. Factory behavior has therefore been moved to Generator, which is by nature language-specific. Generator prototypes are cached and cloned.
    • The priming Dynamator file read has been removed, since creation of Annotations objects no longer requires knowledge of the language.
    • Dynamator directives automatically added for body-only HTML (-B) are now inserted programmatically via the DOM. Previously they were stored in a string and parsed for each file.
    • Included files are now cached. Since most projects use a set of included files throughout all Dynamator files, and document inclusion is expensive, this has a major impact. In testing with my current real-world application, this single change cut Dynamator processing time by 40%. (YMMV)
    • Dynamator file elements are now accessed via indices rather than sequentially. In my tests, this change cut Dynamator processing time by 25%. (YMMV)

    This change impacts the plugin interface.

  • Added Taxonomy example showing recursive invocation using the 'extract' feature (or, in the case of JSP, an inline class).
  • Improved internal resource management so that Dynamator can be used within a long-running task.
  • For templates declaring an XHTML doctype, elements that have an empty content model are now output using minimized tag syntax (e.g. <br />).
  • Enhanced the ant task to create the output directory if it doesn't already exist.
  • Execution is now terminated in all cases when Tidy detects errors.
  • Changed error output to omit "execution terminated" message.
  • Added 'final' declaration specifier to variables declared by Dynamator for language="java", to appease Checkstyle.
  • Improved examples structure a bit: generated files are now placed in a subdirectory ('generated'); added overall build.xml and Makefile, improved ant clean targets.
  • Integrated ant task logging behavior with ant. 'ant -v' and 'ant -debug' now work as expected.
  • Moved dynamator.jar in release file from 'lib' directory to root directory.
  • (Internal) Most tests are now whitespace-sensitive, allowing whitespace errors to be detected.
  • (Internal) Added some tests for invalid input.
  • (Internal) Added compile step to regression test for language=java to make sure generated code is valid Java. Fixed compiler errors in TextEcho2 example.
  • (Internal) Removed build dependency on sed and diff. Build and regression testing now require ant 1.5.3-1, ant-contrib and, under JDKs earlier than 1.4, jakarta-oro. Regression testing is a little more awkward, since there's no diff for ant.
  • (Internal) Revised build to conform to best practices:
    • Most generated files are now placed under the 'build' directory.
    • Project properties may now be overridden through user-defined properties files.
    • Build scripts now directly reference the Dynamator jar instead of expecting it to be in the classpath.
  • Added dynamator-build-libs download to provide all libraries used to build Dynamator. (Ant, PMD, JSDK, and JCoverage are not included.)
  • Added CONTRIBUTORS.txt to acknowledge contributors.

Bug fixes:

  • For language=none, moved the file generation comment to end of file, to prevent browser quirk mode caused by outputting it at the beginning of the file.
  • For language=xsl, moved the file generation comment to end of file, to allow generated files to begin with the XML processing instruction.
  • For body-only HTML, eliminated output of DOCTYPE, CDATA, and processing instructions appearing outside the body.
  • Ignore contents of comments within Dynamator file. When a Dynamator file comment contained a partial element of interest to Dynamator (e.g. a start tag without an end tag), a parse error would result.
  • For language="java", eliminated occasional spurious output of the text ");.
  • Made significant improvements in whitespace handling. In most cases, whitespace in generated file should match template (or .asxml file) whitespace, when indentation is accounted for.
    • Eliminated whitespace around emitted content within an if block. This was a potential source of the browser whitespace bug. This change eliminates whitespace even when the whitespace would have been OK, decreasing the readability of emitted content in those cases. But correct browser rendering is a higher priority than (generated) source code readability.
    • Indentation is no longer applied to CDATA content. (Whitespace within CDATA is significant.)
    • Whitespace is no longer discarded between elements that are separated only by spaces and/or tabs. The HTML sequence "</x> \n\t <y>" had been rendered "</x><y>"; it is now rendered "</x> <y>".
    • Eliminated the addition of white space between element tags and text data outside the element. For example, '.<span>' was rendered '.\n<span>'.
    • For non-template languages like Java, terminate program lines before emitting the content of <before> and <raw-content> elements.
    • For language=java, remove end-of-lines after conditionally output flag attributes.
  • Execution is now terminated when Tidy detects a missing </script> tag. This is required because Tidy treats this as a recoverable error: it tries to fix the problem by escaping all subsequent tags.
  • Corrected several bugs in trace output handling. When outputting to a file under Ant, the trace output file was overwritten for each template file processed. The output writer was buffered but never closed, so in some implementations the end of the buffer may not have been written to the file.
  • Revised code that prevented compilation under JDK 1.1.

v 1.4 (2003/07/12)
  • Beefed up unit tests to bring test coverage to 80% line coverage. Untested code is mostly error handling.
  • Removed dependency on Xerces. Tested with the XML parser included with JDK 1.4.1. For JDK releases prior to 1.4, Xerces is still recommended, since Dynamator requires both a SAX and a DOM parser. Dynamator uses the standard JAXP facility for identifying the parser implementation (see the documentation for javax.xml.parsers.SAXParserFactory).
  • Corrected bug in raw-attr processing for language="java": if raw-attr contained a quote, the quote was not escaped. This will break current files that accommodated for this by adding an escape.
  • Cleaned up body-only HTML output: Removed <!DOCTYPE ...> directives and comments outside of body.
  • Caused attribute values containing quotes to be output within single quotes. No support yet for attribute values containing both quotes and single quotes.
  • Corrected script processing (see change log for Dynamator 1.1). The content of each script element is now treated as CDATA, except for no-content span tags. Since Dynamator 1.1, Dynamator had tried to handle all span and div tags within script elements, but this was based on an incomplete understanding of the HTML syntax for script elements (the character sequence '</' terminates a script element). A review of the use cases concluded that the only reason for processing elements within a script is variable replacement, which can be accomplished using a no-content span tag. (See the tutorial on script manipulation, which has also been updated.)
  • Some enhancements to Tidy message processing:
    • Output only warning and error messages from JTidy, to make builds look cleaner. (Tidy does not provide the option to omit warning messages.)
    • If error messages are found, output the file name before the error messages. (Tidy doesn't output the file name and Dynamator is usually used to process a set of files at a time.)
  • Properly handle class="Discard" and class="DiscardTag" for comment divs. (Previously, the comments were retained even when these were specified.)
  • Improved performance of generated programs for language="java". Previously, each line was output using a single 'out.write(...)' statement. If a line contained a variable value, string concatenation was used within the output argument. Now, lines that contain variable values are split into multiple 'out.write(...)' statements. Example:
    out.write("    <p>" + ( getGreeting() ) + "</p>\n");
    out.write("    <p>");

    (Thanks to Bill Field for ranting about the evils of String concatenation enough times that I finally realized I could do something about it in this case.)

  • Corrected compilation errors in the Java implementation of the Calendar example.
  • Added a new Guestbook example to demonstrate HTML form processing.
  • Added a new FAQ entry, "How do I associate an HTML element with multiple classes?" (Thanks to Chris Felaco for suggesting this.)
  • Make is no longer supported as a tool for building Dynamator. It is still supported for building examples.
  • (Internal) Dynamator Quick Reference is now maintained using Open Office (currently at 1.1beta2). Until PDF export improves, though, the PDF is being created by printing to a postscript printer configured to use redmon and routing the output through Ghostscript using directions found here. (PDF created using OOo: 200K. PDF created using GS: 13K.)
  • (Internal) Added ability to perform coverage testing using JCoverage. Ant script is in jcoverage.xml.
  • (Internal) Added ability to lint Dynamator source code using PMD. Ant script is in pmd.xml; rules are in ruleset.pmd.
  • (Internal) Commented out rcsID constant declarations in Dynamator source code. This retains the CVS file version ID in the source code, but removes them from the class files. The rcs ID string is not a definitive source of version information, since someone can update the source code without changing the ID string. (Thanks to Keith Ackley for pointing this out to me.)
  • (Internal) Improved the tutorial generation process slightly. This is an internal change but it should ensure that tutorial code examples always show the current code.

v 1.3 (2002/11/17)
  • Added first-class support for PHP.
  • Added ability to define div elements in template file comments to allow grouping of HTML elements where <div> tags would be invalid. This is especially useful within HTML tables to group rows or cells when the template requires more than one row or cell to be output for each element of a collection. For example:
      <!-- div id="row-group" -->
        <tr class="data-row">
        <tr class="delimiter-row">
          <td colspan="2">
            <img src="horizontal_line.png" height="1" width="100">
      <!-- /div -->
  • Added ability to insert a conditional expression within a for or foreach. The condition is evaluated for each iteration, and applies to the content of the element addressed by the foreach. Syntax:
  • Added -t option to specify the directory containing templates referenced by the template attribute of the <dynamator> element.
  • Added ant task: dynamator.ant.DynamateTask to allow Dynamator to be used from ant.
  • Changed internal build process to use ant. Examples now include both Makefile and ant build.xml files.
  • Added ability to specify multiple replacements of the same attribute value string using syntax [[@/a/b/+/c/d/+/e/f/...]].
  • Removed several causes of the dreaded browser whitespace bug. Disabled line wrapping in Tidy (wrap=0), made most scriptlets start immediately following previous text (without an intervening newline), and eliminated whitespace before and after <before{-content}> and <after{-content}> element content.
  • Corrected bug that prevented without-attrs from working if more than one attribute name was specified.
  • Corrected handling of overrides to content of discarded template elements. If a template element's content is discarded (i.e. using <discard/> or class="Discard", any overrides that might result in it having content are ignored. This includes overrides that apply directly to the content of the discarded element (<content>, <raw-content>, <before-content>, <after-content>), as well as all overrides to child elements. Previously, overrides were generated even when content was discarded.
  • Corrected several bugs associated with the Trace feature: one that occasionally resulted in an exception, one that resulted in improper indentation for discarded elements, and one caused by line lengths greater than 999. Also slightly improved Trace messages for discarded elements.
  • Corrected handling of DOS file paths. Previously, if the template filename contained backlashes, an error would result (with the confusing message, "Annotations file not found").
  • Improved handling of </textarea> tags by preventing the output formatter from adding preceding whitespace, which caused trailing blanks in textarea fields when indentation was enabled.

v 1.2 (2002/02/09)
  • Added <for> element for sequenced iterations.
  • Deprecated sequenced <foreach> element. (The collection version of <foreach> is still available.) The new <for> element is simpler to use. The primary motivator for deprecation was that compare expressions often contain a '<', which had to be written as '&lt;' because it appeared within an attribute.
  • Added '-B' option to generate body-only HTML. This allows HTML fragments to be input as templates. Without -B, Tidy ensures that HTML files contain <html>, <head>, and <body> elements. Fragments are useful for dynamic assembly of site content using server page inclusion facilities.
  • Added 'without-attr' to Dynamator <tag> element. This makes it easier to locate prototype elements that may co-exist with similar elements.
  • Corrected some bugs in code generation for sequenced iteration blocks for JSP, ASP, and Java, before I decided to deprecate that functionality.
  • Finally documented <dynamator:copy>, and got it to work.

v 1.1 (2002/01/07)
  • Renamed -I option (don't indent) to -N.
  • Added include directory path feature. The path is searched to locate files referenced using the Dynamator <include> directive. The path always contains one directory: the directory containing the original Dynamator file.
  • Added new -I option: '-I dir' adds a directory to the include path.
  • Changes to correctly process international character sets:
    • Tell SAX to read input file in specified encoding.
    • Allow XML parser to see XML processing instructions in Dynamator file when they occur before the <dynamator> element. This allows Dynamator files to specify XML encoding.
    • Transcode HTML input files that are not in an encoding understood by JTidy into UTF-8, then transcode the JTidy output back to the original encoding.
  • Dynamator has now been successfully tested with ISO-8859-1, UTF-8, and Big5. It is believed to work with any character encoding supported by both Java and Xerces.
  • Retain HTML entities as originally written. Previously, Dynamator allowed JTidy to decide how to output HTML entities (such as &nbsp; and &#161;). This was confusing, because entities were often output in a different form. Worse, for most non-Ascii character encodings, JTidy outputs entities as raw characters. Now, Dynamator obfuscates all HTML & characters so that JTidy cannot recognize them. This allows entities to pass through unchanged. A side-effect of this change is that JTidy cannot correct any errors in entity coding, such as unknown entities and missing terminating semicolons. To prevent propagation of entity encoding errors, HTML files should be validated with Tidy before processing with Dynamator.
  • Correctly support HTML <script> elements. These elements are now treated as CDATA by the parser, so that special characters such as < (as in x < y) don't cause the parser to fail. As a side-effect of this change, only <span> and <div> tags within a script are recognized by Dynamator.
  • Allow multiple prologs and epilogs. Each is inserted in order of appearance. This will make <include> more useful.
  • Corrected some errors in the JSP examples.

v 1.0.1a (2001/12/02)
  • Changes to help JTidy correctly output character entities:
    • Changed Dynamator's default encoding to ASCII.
    • Forced JTidy to output entities in numeric rather than name form, since some browsers don't correctly display entities referenced by name.
  • Moved examples to documentation zip file.

v 1.0.1 (2001/10/19)
  • Added <rename to="new-name"> to allow name changes for tags and attributes.
  • All id or class elements with the same name are now applied. (Before, if more than one element had the same name, the results were undefined.) This improves support for Dynamator annotations file libraries. However, only the first override encountered for any relative location slot (e.g. after-content) is applied.

v 1.0 (2001/05/30)

Initial Release.