cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with XSLT code to select different attribute based on Account Number value

0 Kudos

Hi Team,

Can you please advise or help with XSLT code on below request ?

I have the target structure as below

<myg:paymentOrder xsi:type="myg:TransferWithinBankPaymentOrderIo">
<myg:creditAccount>
<myg:accountNumber>XXXXTBXXXXXXXXXXX/myg:accountNumber>
<myg:accountCurrencyCode>USD</myg:accountCurrencyCode>
</myg:creditAccount>
<myg:documentNumber>XXXXXXXXX</myg:documentNumber>


I need to select different attribute for PaymentOrder node based on creditAccount/accountNumber value

If accountNumber contains TB, I need to pass attribute

<myg:paymentOrder xsi:type="myg:TransferWithinBankPaymentOrderIo">
or
If accountNumber contains any other value otherthan TB,
I need to pass attribute <myg:paymentOrder xsi:type="myg:TransferToOtherBankNationalCurrencyPaymentOrderIo">

Please advise if it can be done using if or choose function and provide sample code.

Thanks,

Varun

View Entire Topic
0 Kudos

Hi Team,

I did the required XST code and is working standalone when I test in Sylus studio, but when I import the mapping in PO and run it, I am facing below issue with test function. I tried with choose or If functions, both are failing.

"Required attribute 'test' is missing"

Can you please advise, what could be the issue, is the issue related to PO ?

Thanks,

Varun

0 Kudos

Above issue got resolved when I had provided full Xpath.