The crux of client-side XML Processing in IE5 (2/2) - exploring XML
The crux of client-side XML Processing in IE5
Problem #1: XSL system identifier
The official system identifier for the XSL-T namespace is
https://www.w3.org/XSL/Transform/1.0
. The old working draft URL is
https://www.w3.org/TR/WD-xsl
. Some versions of IE will complain about the
new identifier, my copy remains silent but does not process the style sheet correctly.
So I changed back to the old identifier.
Problems #2 and #3: Output method and parameters not supported
The working draft version of XSL did not have the notion of different output options, so I had to remove that directive. The same applies to the parameterization of the style sheet, where I had to fill in the default values by hand and remove the parameter declarations.
The pattern matching does not cascade through the tree levels
After changing the style sheet as outlined above I receive no more errors, but a blank page. Putting some debug messages in the various template clauses reveals that none but the root node are ever matched. This is because no rule exists for therss
element. Adding the following to the stylesheet finally produces the correct result:
<xsl:template match="rss"> <xsl:apply-templates/> </xsl:template>
Phew! Now it works on my machine. I would not be surprised if it does not yet on yours, Try it out and let me know if you run into problems with this little stylesheet.
Conclusion
This little excercise only illustrates the tip of the iceberg that could turn your next project using client-side XML into "codename Titanic." Be careful not to underestimate the effort involved in getting XML to work in browsers even in a tightly controlled environment. Microsoft's component-based update mechanism can also create problems as the XML processor is a Windows component, not part of the browser. So theoretically the same copy of IE installed on two machines could run on two different XML implementations, depending on the version and update status of the underlying operating system. Fun, fun, fun... Feel free to drop me a line with your war stories on this topic. I look forward to hearing from you!
Produced by Michael Claßen
All Rights Reserved. Legal Notices.
URL: https://www.webreference.com/xml/column20/2.html
Created: Sep 26, 2000
Revised: Sep 26, 2000