About the XML/XSL example

This page was written in 1999.

On this page I will first explain the XML document, then the XSL stylesheet and its problems.

The XML document

For the JDF we have chosen for the following XML structure (abbreviated):

<JDF>
<project>
	<name>Name of project</name>
	<component>Name of component</component>

	<role id="pm">
		<name>Name of role</name>
		<person mail="E-mail of person">Name of person</person>
		<abbreviation>Abbreviation of role</abbreviation>
	</role>

plus as many roles as are necessary.

	<briefing>
		<description>Description of the Job.</description>
		<deadline>Date</deadline>
		<reference>
			Reference to the briefing document(s), if applicable.
			See below for further explanation of references
		</reference>
	</briefing>



	<task>
		<name>Name of taks</name>
		<supervisor>Abbreviation of supervising role</supervisor>
		<performer>Abbreviation of performing role</performer>
		<description>Detailed description of the task</description>
		<reference>
			References to VR, internal documents etc.
			See below for further explanation of references
		</reference>
		<reference type="file">
			More references to VR, internal documents etc.
			See below for further explanation of references
		</reference>
		<comment by="author">Comment</comment>
	</task>

plus as many tasks as are necessary.

</project>
</JDF>

References can be placed in any element, in a task or the briefing or even a role, when necessary. A type attribute may be used. At the moment I defined type="file" (for files) or type="url" (for links). The XSL gives any type="file" a yellow colour, any type="url" a blue colour and all other references, plus links within the JDF, a red colour.

<reference type="url | file">
	<name>Name of reference</name>
	<description>Detailed description of the reference.</description>
	<url>Link to Web page or file</url>
</reference>

The XSL stylesheet

The XSL stylesheet reads out the XML document and displays it on the screen.

I also wrote a more detailed description of the XSL sheet. On this page I describe the possible IE5 implementation error.

The XSL style sheet first displays general job information (name, description, briefing and roles) and then prints out all tasks. I have liberally used style sheets for the headers, link colours etc. In addition, I have used a bit of JavaScript to hide the tasks until the user clicks on the appropriate link.

All this works fine. However, I found one very annoying and possibly fatal flaw in the Explorer 5 implementation of XSL. This centers around the <task> and <role>

As you can see in the XML above, <task> and <role> are on the same level: they are both children of <project>. I want to do the following:

  1. First, I want to read out the <supervisor> of a specific task. I get an abbreviation, like "pm".
  2. Then, I want to match this abbreviation with the <role> that has the same abbreviation.
  3. Finally, I want to read out the complete <role>, including e-mail address etc.

Now it seems that the Explorer 5 implementation of XSL doesn't allow me to make the second step. For some reason it cannot compare one variable (task/supervisor) to another (role/abbreviation). Since this is pretty fundamental database functionality, the prospects for XSL are not very good.

That is why it's a better idea to use JavaScript to display the XML file.