Skip to Content
0
Former Member
Aug 01, 2016 at 06:00 PM

XSLT transformation - Using switch and cond check

884 Views

How would "switch" and "cond check" be coded within a loop?

For example, in my transformation I'm looping thru a table that was sent from Abap, like this small sample:

<tt:loop ref=".DATATAB">

<Row ss:Height="14" ss:StyleID="s57">

<Cell><Data ss:Type="String"><tt:value ref="MATNR"/></Data></Cell>

<Cell><Data ss:Type="String"><tt:value ref="QUANT1"/></Data></Cell>

</Row>

</tt:loop>

I would like to assign a different StyleID to the row if I detect a certain value in the line that I'm looping thru.

For example, in simple terms:

If tt:value ref="MATNR" = ‘XXX’.

<Row ss:Height="12" ss:StyleID="s57">

endif.

If tt:value ref="MATNR" = ‘ZZZ’.

<Row ss:Height="14" ss:StyleID="s70">

endif.

I can’t get the syntax right.

Is this possible?

Am I being clear?

Thanks

Leo