The Case of the Missing Text
By Michael Floyd
In the June issue, I presented an XSL style sheet that used patterns to locate objects within the document tree, and showed how you can specify template rules to format these objects. The example was interesting in that it demonstrated the process of transforming XML into HTML and showed how you can combine CSS style rules to format the HTML output.
Originally, I had written and tested the example using IBM's LotusXSL style sheet engine. In that arrangement, the style sheet was to be served along with its accompanying XML document from a Java servlet. However, at the end of that column I suggested that, while it hadn't been tested, the style sheet should run in most XSL processors, including Internet Explorer 5's.
Apparently, many of you tested that assumption and things didn't run as advertised. The symptom in all cases was that the entire document, save one word ("by"), was missing. In tracking down the problem, I discovered a few differences between the XSL draft specification and Internet Explorer's implementation. In fairness to Microsoft, the differences reflect the quickly changing specification. Nevertheless, an understanding of how IE processes style sheets will save you countless hours of head scratching.
The Problem
The June issue included an XML document, news.xml, which presented a typical online news story. The document contained elements that described the various parts of the article including its title, dek (subtitle), and byline, as well as formatting information within paragraphs.