Purpose
XMLPARSE() parses the evaluation result of value_expr and generates data of the CLOB type.
Syntax
XMLPARSE
({ DOCUMENT | CONTENT } value_expr [ WELLFORMED ])
Parameters
| Parameter | Description |
|---|---|
| DOCUMENT | Specifies that the parsed content must be a singly rooted XML document. |
| CONTENT | Specifies that the parsed content must be a valid XML fragment. |
| value_expr | The string to be parsed. The result can be a CHAR, VARCHAR2, NCHAR, NVARCHAR2, or CLOB string. Notice: If value_expr evaluates to NULL, the function returns NULL. |
| WELLFORMED | If the content to be parsed is marked WELLFORMED, the validity of CONTENT will not be checked. This parameter is optional. |
Return type
The return type is CLOB.
Example
Parse a valid XML fragment 'abc'.
obclient> SELECT XMLPARSE(CONTENT '<a>abc</a>') FROM DUAL;
+-------------------------------+
| XMLPARSE(CONTENT'<A>ABC</A>') |
+-------------------------------+
| <a>abc</a> |
+-------------------------------+
1 row in set