Posts

Showing posts with the label plsql

Problems visualizing the content of an xml in json format using clob

Problems visualizing the content of an xml in json format using clob I am testing code to query a table, get the result as XML, convert it to JSON format, and display it on screen for testing. My problem is that, when showing the JSON in varchar format (with GetStringVal) it works ok, but if the result is extensive, I show it as Clob (with GetClobVal). In this case, the string shown includes the literal "& quot;" when it should include double quotes. Next, I show you the function that is applied to convert the xml to json, followed by an anonymous block with the tests performed on a small xml. My database is Oracle 12.1 Thanks you for your interest in helping me. --Define a function with the XSLT to convert the XML to JSON SET DEFINE OFF CREATE OR REPLACE FUNCTION style_sheet_json RETURN VARCHAR2 IS l_xslt VARCHAR2 ( 32000 ); BEGIN l_xslt := '<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xml...