37.35 TO_XMLTYPE Function
This procedure parses a JSON-formatted varchar2
or CLOB
and converts it to an xmltype.
Syntax
APEX_JSON.TO_XMLTYPE (
p_source IN VARCHAR2,
p_strict IN BOOLEAN DEFAULT TRUE )
RETURN sys.xmltype;
APEX_JSON.TO_XMLTYPE (
p_source IN CLOB,
p_strict IN BOOLEAN DEFAULT TRUE )
RETURN sys.xmltype;
Parameters
Table 37-47 TO_XMLTYPE Function Parameters
Parameter | Description |
---|---|
|
The JSON source ( |
|
If TRUE (default), enforce strict JSON rules |
Returns
Table 37-48 TO_XMLTYPE Function Returns
Return | Description |
---|---|
|
An |
Example
This example parses JSON and prints the XML representation.
DECLARE
l_xml xmltype;
BEGIN
l_xml := apex_json.to_xmltype('{ "items": [ 1, 2, { "foo": true } ] }');
dbms_output.put_line(l_xml.getstringval);
END;
Parent topic: APEX_JSON