comps.xml transforms

Transforming Red Hat's comps.xml File


Introduction

I recently started to play with XML/XSLT. One of the results is that I have thrown together an XSLT stylesheet that presents the Red Hat comps.xml file in a hyperlinked web format.

Recent versions (>= 1.4) of mozilla make it easy to play with XML transformation. You only need to set up a .xsl stylesheet file and reference it at the top of your XML file. Then load the XML file in mozilla and refresh it as you change your stylesheets.

To generate a final html file you can also use mozilla by launching edit from your browser window, and then saving the edit window as HTML.

But it is much better to install and use a tool meant for this purpose. Thus the generated html used on this site was derived from xalan-java. With a JRE environment installed and the approprate xalan jar files in the CLASSPATH I generated the Red Hat 8.0 comps.html file with:

  java org.apache.xalan.xslt.Process -IN comps.xml -XSL comps.xsl -HTML -OUT comps.html

Here is an example xalan script to make the job easier.

NOTE: If you are using Java version 1.4.*, then xalan may spit out annoying error messages; for example with j2sdk1.4.1 xalan did not like my definition for non-breakable space near the top of the stylesheet documents. It would spit out tons of error messages, but happily generate the html files. This does not happen with Java version 1.3.* FYI, the messages were of the genre:

    Element type "xsl:template" must be declared.

It may also spit out, depending on the complexity of your xsl file, messages like:

   No more DTM IDs available

To get around both of these problems I used the -Xbootclasspath option to java. See the example xalan script.

Back to normal view

Site Contact:
http://penguin.triumf.ca/home/
This web site hosted at: Triumf - Canada
Created: 21 Feb 2003 @ 18:53 GMT
Last modified: 25 Apr 2004 @ 11:56 GMT