[xsl] Re: Problem with grouping on elements that are not always present

Subject: [xsl] Re: Problem with grouping on elements that are not always present
From: Dieter Schmerlaib <dschmerlaib@xxxxxxxxxxxxxxxx>
Date: Thu, 12 Aug 2010 16:42:12 +0930
> Do you use an XSLT 2.0 processor? Or why is version="2.0" in that
> stylesheet?
> And if you use an XSLT 2.0 processor why do you use keys for grouping,
> why not for-each-group?
>
> I am not sure what output you want. Can you post the output you want for
> the input sample you posted?

The reason that 2.0 is I am planning to transition to 2.0. So a for-each-group
may work
the out put I want  is below  I am missing Transactions 1,2,8 ie where there
is no skill requirement.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd";>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>TEST</title>
</head>
<body>
<p>Work Area:</p>
<p>Skill:</p>
<p>
<table border="1">
	<tbody>
		<tr>
			<td><b>Trn #</b></td>
			<td><b>Type</b></td>
		</tr>
		<tr>
			<td><b>000002</b></td>
			<td><b>INSP/FUNC</b></td>
		</tr>
		<tr>
			<td><b>000008</b></td>
			<td><b>INSP/FUNC</b></td>
		</tr>
	</tbody>
</table>
</p>
<p>Work Area:</p>
<p>Skill: ELECTRICAL</p>
<p>
<table border="1">
	<tbody>
		<tr>
			<td><b>Trn #</b></td>
			<td><b>Type</b></td>
		</tr>
		<tr>
			<td><b>000009</b></td>
			<td><b>INSP</b></td>
		</tr>
	</tbody>
</table>
</p>
<p>Work Area:</p>
<p>Skill: ENGINES</p>
<p>
<table border="1">
	<tbody>
		<tr>
			<td><b>Trn #</b></td>
			<td><b>Type</b></td>
		</tr>
		<tr>
			<td><b>000009</b></td>
			<td><b>INSP</b></td>
		</tr>
	</tbody>
</table>
</p>
<p>Work Area: CCC</p>
<p>Skill: AIRFRAME</p>
<p>
<table border="1">
	<tbody>
		<tr>
			<td><b>Trn #</b></td>
			<td><b>Type</b></td>
		</tr>
		<tr>
			<td><b>000005</b></td>
			<td><b>OPTNL CK</b></td>
		</tr>
	</tbody>
</table>
</p>
<p>Work Area: EI&amp;R</p>
<p>Skill:</p>
<p>
<table border="1">
	<tbody>
		<tr>
			<td><b>Trn #</b></td>
			<td><b>Type</b></td>
		</tr>
		<tr>
			<td><b>000001</b></td>
			<td><b>SERV</b></td>
		</tr>
	</tbody>
</table>
</p>
<p>Work Area: EI&amp;R</p>
<p>Skill: ELEC/INST</p>
<p>
<table border="1">
	<tbody>
		<tr>
			<td><b>Trn #</b></td>
			<td><b>Type</b></td>
		</tr>
		<tr>
			<td><b>000003</b></td>
			<td><b>OPTNL CK</b></td>
		</tr>
		<tr>
			<td><b>000004</b></td>
			<td><b>OPTNL CK</b></td>
		</tr>
	</tbody>
</table>
</p>
<p>Work Area: LH ENG</p>
<p>Skill: ELECTRICAL</p>
<p>
<table border="1">
	<tbody>
		<tr>
			<td><b>Trn #</b></td>
			<td><b>Type</b></td>
		</tr>
		<tr>
			<td><b>000006</b></td>
			<td><b>INSP</b></td>
		</tr>
		<tr>
			<td><b>000007</b></td>
			<td><b>INSP</b></td>
		</tr>
	</tbody>
</table>
</p>
<p>Work Area: LH ENG</p>
<p>Skill: AIRFRAME</p>
<p>
<table border="1">
	<tbody>
		<tr>
			<td><b>Trn #</b></td>
			<td><b>Type</b></td>
		</tr>
		<tr>
			<td><b>000006</b></td>
			<td><b>INSP</b></td>
		</tr>
	</tbody>
</table>
</p>
</body>
</html>

Current Thread