cancel
Showing results for 
Search instead for 
Did you mean: 

xslt mapping - xsl if ?

Former Member
0 Kudos

HI,

can you explain me "how to use the xsl if function" ?

My source is an ORDRSP Idoc and i want to use the following.

IF E1EDP20 is existing then ....

and

IF E1EDP20/WMENG = 0 then ...

anyway... is there an option to test the xslt mapping with XML spy or another tool ?

any ideas ?

Accepted Solutions (1)

Accepted Solutions (1)

udo_martens
Active Contributor
0 Kudos

Hi Gordon

<xsl:if test="string-length(//E1EDP20)!=0 and //E1EDP20/WMENG=0"><then>show</then></xsl:if>

Open XML at Spy and choose Assign XSL from menu. Press F10 for execute.

Regards,

Udo

Answers (1)

Answers (1)

iaki_vila
Active Contributor
0 Kudos

Hi Gordon,

I usually use this for question like:

<xsl:if test="count(./PAYMENT) > 0 ">

<...>

</xsl:if>

Here for example only make <..> where the number of nodes of payment is more than 0.

Help here:

http://www.w3schools.com/xsl/xsl_if.asp

Regards.

Former Member
0 Kudos

Is that right ... that there is no "else" ?

iaki_vila
Active Contributor
0 Kudos

Hi,

I think, im not sure, taht there no exits else. You always can ask the opposite, after the first "IF".

Regards.

udo_martens
Active Contributor
0 Kudos

Hi Gordon,

yes, there is no else. You can achieve something like a <i>else</i> with <i>choose - when and otherwise.</i>

Regards,

Udo

Former Member
0 Kudos

Thx Udo,

it´s working fine!