In this section

Site navigation below

The Code Style Web site has evolved by the gradual refinement and accumulation of articles and features. This review is part of a fully backdated site log and archive that may help shed light on when, why and how particular features were implemented. Many of these log entries refer to the Code Style Java package, which delivers the servlet services on this site.

Subscribe to the news feed for this log: RSS news feed

Reverse chronology

26th May 2004

Un-packed and repackaged the JTidy JAR excluding the W3C DOM and SAX packages to avoid conflict with the JAXP package.

22nd May 2004

Added a range of new FAQ answers in the Java, CSS, HTML and Site Manager sections.

Apache Tomcat

HTML & XHTML

Java API

Java I/O

Media style sheets

Servlet threads

Site manager

Tomcat configuration

Various further changes to the Code Style XHTML "Lax" DTD, as follows.

Added rules to the CSPersistent.css style sheet for adding colour coding to HTML markup in pre elements:

.element {
  color:            blue;
  background:       transparent;
}

.att-name {
  color:            #009;
  background:       transparent;
}

.att-value {
  color:            teal;
  background:       transparent;
}

.comment {
  color:            green;
  background:       transparent;
}
      

Final pre-release check on the FAQtoXHTMLXSL stylesheet with minor amendments to comments and white space.

21st May 2004

Made a penultimate pass through the FAQtoXHTML XSL stylesheet and supporting page templates to apply a $session-id parameter to all internal document URLs. Adapted the JAXP test servlet to pass the parameter to check correct placement throughout the set.

Adapted the match on a elements in the CopyXhtmlElements template to insert the $session-id parameter in URLs with a new HostExtractor template to test whether the href value is local or external. Test checks whether the href attribute contains the local host name, contains a "./" for a relative URL or starts with a forward slash, "/".

20th May 2004

Modified the FAQtoXHTML XSL to generate distinct titles and metadata for all pages in the set and escaped all spaces in category and topic references to %20 with the SearchAndReplace template. Added new internal templates to apply Dublin Core meta element formatting to individual items from ID references and item titles.

19th May 2004

Changed all REQUIRED and IMPLIED enumerated attribute values in the Code Style XHTML "Lax" DTD to CDATA content to close-off indefinite second-guessing of corrupted values. Also added numerous new non-standard attributes, the Microsoft proprietary marquee element and various other adjustments for parsing Internet tag soup via JTidy.

18th May 2004

Created a new XSL TransformerProxy class to configure and manage transformations with ResultCache. Initial implementation is based on key aspects of ParseServlet, with constructor and basic getResults method. Developed in parallel with JUnit test suite TransformerProxyTest.

Added sets of Parameters to the ResultKey class to represent XSL output attributes and XML parser features, with accessors and mutators for both. Updated the hashCode and equals methods accordingly. Updated the variable names and constructors in ResultCacheTest and ResultKeyTest to the new ResultKey scheme.

Adapted ResultKeyBuilder to the new ResultKey constructor with equivalent variables and mutators. Also updated the hasAdvancedConfiguration and newResultKey methods as necessary.

17th May 2004

Used validation errors from the latest round of testing to further extend the Code Style XHTML "Lax" DTD. Several new examples of proprietary markup, bogus elements spacer and nobr, corruption and transposition of standard attributes to inappropriate elements.

Added a static newBroker method to SourceBrokerFactory that takes a ResultKey argument. Initial implementation only returns UntrustedHttpRequestBroker objects.

Added a freshness check to the getResult method of ResultCache and de-coupled the other cache management methods from this one.

Renamed the serviceUrl variable in the draft ResultKey class to xmlSystemId, since it may be a file source, and renamed the serviceId variable to serviceUri to double as an HTTP referrer in Web applications.

Changed the makeClone method of ResultKeyBuilder to throw an IllegalStateException rather than CloneNotSupportedException, if it is not in a basic cloneable state. Also renamed variables and JavaDoc comments to follow new ResultKey names. Amended ResultKeyBuilderTest to new exception scheme for makeClone method.

Revoked the final modifier on the doGet method of the abstract ParseServlet to override in a new subclass, and changed the visibility of xslFileName, cacheLocator and directory path separator instance variables from private to protected. Made the application home and dtdDir method variables into instance variables for use in the subclasses.

Added simple getXslOutputType and getContentType methods to SourceType to supersede the awkward String[] getResponseTypes method. Currently calls the getResponseTypes method as an adapter, which may be sufficient.

15th May 2004

Corrected the request query component of the development testing servlet JAXP for the identifier parameter passed to the stylesheet.

Implemented "expansive" navigation in the FAQtoXHTML XSL stylesheet, so that all individual glossary and answer items' see also links refer to the relevant category pages, rather than another "solo" page. If links from topic items are not in the same topic, these also point to the relevant category page. The stylesheet now includes new functions to obtain a category from a dc:title reference and from an item ID.

Realised there was a silent bug in FAQtoXHTML with the generation of some fragment anchor links where the $identifier parameter was out of scope in various functions. The consequence was to make an href attribute value of just the fragment ID reference. Since user agents add these hash references to the end of the current URL, this worked correctly in all cases. Therefore removed the redundant $identifier parameter from these functions.

14th May 2004

Included the AlphabetCase variables in the XHTMLtoDemo and XHTMLtoJS XSL templates for use in translate functions to make case-insensitive matches on document metadata.

12th May 2004

Abandoned the CopyXhtmlAttributes XSL template in favour of simple xsl:copy-of elements in the CopyXhtmlElements template and master FAQtoXHTML template.

<xsl:copy-of select="@*"/>
      

Copying elements by the equivalent method also copies the implicit rdf, dc and dcterms xmlns attributes from the XML source, so CopyXhtmlElements makes an element-for-element transformation.

10th May 2004

Added many more exceptional cases to the Code Style XHTML "Lax" DTD, to parse Internet tag soup passed through JTidy. Though some cases are quite alarming and indicate there are some atrocious authoring tools out there, they are not selected by the XSL stylesheets used in the ParseRSS and ParseRDF servlets and effectively cleaned-up by the transformations.

Updated the XHTMLtoDemo XSL stylesheet to make the Dublin Core metadata match case insensitive and implemented the new Dublin Core in HTML scheme.

9th May 2004

Wrote a simple bash script to test the draft MailApp application on the production host.

8th May 2004

Added a further document to the Dublin Core test cases set to implement more sophisticated handling of link element metadata in the ParseRDF servlet. The key part of the processing is handled by the inclusion of the DCElements stylesheet, which now generates nested rdf:Description elements where any hreflang, title, type or charset attributes are present.

Also combined link element selection in the master XHTMLtoRDF stylesheet into a single xsl:for-each block, rather than separate cases for links with rel and rev attributes. In some instances the previous version was causing repetition of the whole set of metadata.

A recent deployment to the public site highlighted some minor shortcomings with the Code Style Java project's test arrangements that required immediate workarounds. The worst case was an errant Thread in MockEventGateTest, which never completed the testIsOpen test case. Removed this method, since the case is tested more effectively by other methods. Also changed the constructor to set a minimum delay value rather than throw an exception if the argument is too low and added a getDelay method to test.

Soft-coded the directory path in the unit test IOUtilitiesTest for appropriate handling on the production server.

6th May 2004

Updated the XHTMLtoRSS XSL stylesheet to the new Dublin Core in HTML recommendation, including case insensitive matching on DC and DCTERMS prefixes, and link element processing, as with the XHTMLtoRDF stylesheet.

Final adjustments to the RSS.css and DC.css stylesheets before updating the ParseRSS servlet on the production server. Mainly workarounds for different levels of browser support for XML namespace selectors.

5th May 2004

Added hreflang language handling to the DCElements XSL template, which converts values to xml:lang attributes. Corrected the recursive output on link type lists, which was stopping after the first instance of a Dublin Core element. Also corrected a conditional match on rev attributes of link elements containing DCTERMS prefixes. This stylesheet now delegates include dependency for the AlphabetCase variable template to the SchemeChooser template.

Corrected handling of MeSH scheme specification in the SchemeChooser template and implemented case insensitive matching on DCTERMS prefixes. This template now combines an xsl:variable-based test for the DCTERMS prefix with a case sensitive check for the scheme suffix.

Corrected space normalization in the Tokenizer XSL stylesheet to stop runaway recursion on multiple spaces.

Added further documents to the Dublin Core RDF test case set to check the new Dublin Core in XHTML scheme, including link elements with rev attributes, rel attributes mixed with other link types and DC and DCTERMS prefixes in lower case. Identified and corrected various issues, as above.

Added a setParameters method to the ParseRDF servlet to assign a uri parameter to the stylesheet, which is the URL of the source document. This may be overridden by a Dublin Core Identifier element in the source document if it has a URI scheme.

4th May 2004

Implemented the new Dublin Core in HTML recommendation in the XHTMLtoRDF XSL stylesheet for meta and link elements, and delegated the include dependency for the SchemeChooser template to the DCElements template. Updated the XHTMLtoRSS template to the new include structure for the SchemeChooser template.

3rd May 2004

Updated all Code Style font survey results and added the Bigelow & Holmes Lucida font set included with the Sun Java Runtime Environment to all surveys.

Created a new database ConnectionPool class adapted from an example in Core Servlets and Java Server Pages by Marty Hall, with corrections. The original version has an incorrect case analysis in the getConnection method regarding the waitIfBusy status when there are no available connections. The three cases should be:

  1. waitIfBusy is false (regardless of the maxConnections limit): Throw an SQLException, cannot service request.
  2. waitIfBusy is true and the pool allocation is less than maxConnections: Make a connection in the background if there is not already one pending.
  3. waitIfBusy is true and the pool allocation is equal to maxConnections: Wait for a connection to become available.

This may explain some surprising exception handling in the original. Needs a set of unit tests to check operation. Nonetheless, implemented the ConnectionPool class in the draft FontStats servlet to confirm basic function.

1st May 2004

Created an initial set of XHTML test documents to check handling of new Dublin Core metadata in XHTML recommendations with the ParseRDF servlet. Firstly to check regressions against the original scheme, and to check new cases of DCTERMS prefixes in meta and link element attributes. Also includes documents to check prefix matching is case insensitive.

Added ParseJS and ParseRSSDemo servlet configuration to servlet engine pending next restart.

Previously on Code Style

These backdated pages record detailed changes to the Code Style Web site since July 2000, when development first got underway. Some pages may refer to documents or features that have since changed or are no longer part of the site, but the archive is checked to ensure there are no dead links.

Add this page to your chosen social bookmarking service

Style warning - please read

Home · CSS · Java · Javascript · HTML · Help · Log