[xsl] filtering

Subject: [xsl] filtering
From: "Daniel Heskia" <daniel@xxxxxxxxx>
Date: Mon, 1 Nov 2004 13:01:40 +0100
Hi.
I am trying to filter out data sets that do not have any data in the column
numbers specified in "header" of the xml.

The header specifies that columns 1, 2, 3 and 7 are crucial in this
particular instance and must not be empty. The values differ from time to
time (I cannot hardcode the numbers in the xsl), but the element names in
"header" (AAA, BBB etc.) are static for this type of data).

I need to test if the column numbers specified in the header are non-empty
for each each row. I have tried to assign the values of the header data to
variables and do something like: for each row, if test not(column[$_aaa]='')
create the element. This, however, I cannot get to work.

Does anyone have a good idea?

xml-input:

<root>
  <header>
    <AAA>1</AAA>
    <BBB>2</BBB>
    <CCC>7</CCC>
    <DDD>3</DDD>
 </header>
  <row>
    <column>Dude Looks like a Lady</column>
    <column>Local</column>
    <column>28-10-2004</column>
    <column>51,23</column>
    <column />
    <column>80563</column>
    <column>IE000000004</column>
  </row>
  <row>
    <column>Never Ending Story</column>
    <column>Test</column>
    <column>21-02-2003</column>
    <column>51,23</column>
    <column />
    <column>80563</column>
    <column />
  </row>
</root>

xml-output:
Note 1 element filtered out because column 7 was empty

<root>
  <flow>
    <total_in>2</total_in>
    <total_out>1</total_out>
  </flow>
  <success>
    <AAA>Dude Looks Like a Lady</AAA>
    <BBB>Local</BBB>
    <CCC>IE000000004</CCC>
    <DDD>28-10-2004</DDD>
  </success>
</root>

Current Thread