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

Subject: Re: [xsl] Problem with grouping on elements that are not always present
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Wed, 11 Aug 2010 12:19:15 +0200
Dieter Schmerlaib wrote:
I trying to do a two level group using keys and failing given the following data. The first group is on <WorkArea> the second on  <Skill>.  See --Data Start-- below
My problem is that I don't know how to deal with the fact that there is not always a WorkArea or Skill element and I want to include all data even when either or these elements don't exist.

I am trying to use the stylesheet below see --StyleSheet Start--

I am successful when a Skill element exists but not when it doesn't. In addition if there is WorkArea and no skill I do not see the row I want ie There should be an output in my data for all those Sheets without a WorkArea or Skill and with a WorkArea if there is no skill. ie TransactionNo = (1,2,8) do not show up

Thanks
--StyleSheet Start--
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

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?


--

	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

Current Thread