I am using Spark 2.2 XML library to write data in XML format. But i want add CDATA to every value in XML like below.
<RECORD> <PROP NAME="processingTime"> <PVAL> <![CDATA[ 1499713726138 ]]> </PVAL> </PROP> <PROP NAME="isActive"> <PVAL> <![CDATA[ true ]]> </PVAL> </PROP> <PROP NAME="lineOfBusiness"> <PVAL> <![CDATA[ abc ]]> </PVAL> </PROP> <PROP NAME="language"> <PVAL> <![CDATA[ EN ]]> </PVAL> </PROP> <PROP NAME="language"> <PVAL> <![CDATA[ FR ]]> </PVAL> </PROP> </RECORD> Can someone suggest me how to do this in Spark Java?.Thx
CDATA. And no XML processor should ever care whether text is in aCDATAor not. The processed text should always end up the same.CDATAis simple a special encoding that eliminates the need to use<,>, and&entities, making the XML simpler if there are a lot of them.