You need to sign in to do that
Don't have an account?
Venkatesh Devam
Compile Error: Illegal string literal: Line breaks are not allowed in string literals
I am getting error in below statement.
String xmloutput = '<?xml version="1.0" encoding="UTF-8"?>
<ns2:gaTransactionType xmlns:ns2="http://abx.xa.gov">gaPaymentTransaction.xsd ">
<merchantName>Arizona Test Merchant</merchantName>
<merchantNumber>SNA_TEST</merchantNumber>
<service>SNA_TEST_DONATION</service>
<totalAmount>5000</totalAmount>';
String xmloutput = '<?xml version="1.0" encoding="UTF-8"?>
<ns2:gaTransactionType xmlns:ns2="http://abx.xa.gov">gaPaymentTransaction.xsd ">
<merchantName>Arizona Test Merchant</merchantName>
<merchantNumber>SNA_TEST</merchantNumber>
<service>SNA_TEST_DONATION</service>
<totalAmount>5000</totalAmount>';
You have two choices, change your definition to one line, or concatinate it.
(this might not work in the forum presentation, but I am removing all the line breaks.... so it's one long line)
or, here, I add the string delimiting apostrophes and "+" signs to concat the multiline string: