Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

XMLToJSON is throwing an error

I am using XMLTOJSON policy and it gives me below error.

{
"fault": {
"faultstring": "XMLToJSON[XML-to-JSON-1]: Execution failed. reason: Unexpected child node after root node",
"detail": {
"errorcode": "steps.xml2json.ExecutionFailed"
}
}
}

When I removed the XMLTOJSON policy I get below XML output

<?xml version="1.0" encoding="UTF-8"?>
<TRS>
<EMPLID>122</EMPLID>
<YEAR>2021</YEAR>
<MONTH>12</MONTH>
<BENEFIT_PREC>0</BENEFIT_PREC>
<AMOUNT>3</AMOUNT>
<CURRENCY_CD>USD</CURRENCY_CD>
</TRS>
<TRS>
<EMPLID>123</EMPLID>
<YEAR>2021</YEAR>
<MONTH>12</MONTH>
<BENEFIT_PREC>0</BENEFIT_PREC>
<AMOUNT>1</AMOUNT>
<CURRENCY_CD>USD</CURRENCY_CD>
</TRS>

XMLTOJSON policy I am using is

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XMLToJSON continueOnError="false" enabled="true" name="XML-to-JSON-1">
<DisplayName>XML to JSON-1</DisplayName>
<Properties/>
<Format>yahoo</Format>
<OutputVariable>response</OutputVariable>
<Source>response</Source>
</XMLToJSON>
1 3 533
3 REPLIES 3