EBS on Oracle Cloud Infrastructure (MOSC)

MOSC Banner

Translate() function to escape characters in XML

Hi,

We are using OIC version2. We have an integration that gets data from Oracle XML Gateway. One field has data with different characters in it like "|","~","#". We are using translate() function to replace the characters with xml tags to make this xml data.

translate(., "|~#", "</>")

The string is "'|PackingSlip#|PackingSlipNumber#|~PackingSlipNumber#|QuantityReceived#0|~QuantityReceived#|~PackingSlip#'"

The expected output is

<PackingSlip>

  <PackingSlipNumber></PackingSlipNumber>

  <QuantityReceived>0</QuantityReceived>

</PackingSlip>


But the output being generated is:

&lt;PackingSlip>&lt;PackingSlipNumber>test&lt;/PackingSlipNumber>&lt;QuantityReceived>25&lt;/QuantityReceived>&lt;/PackingSlip>


Can you please point out how I have to specify &lt; so that it shows up as "<" in the output?

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center