You are viewing documentation about an older version (1.16.0). View latest version

snowflake.snowpark.functions.parse_xml¶

snowflake.snowpark.functions.parse_xml(e: Union[Column, str]) → Column[source]¶

Parse the value of the specified column as a JSON string and returns the resulting XML document.

Example:

>>> df = session.sql(
...     "select (column1) as v from values ('<t1>foo<t2>bar</t2><t3></t3></t1>'), "
...     "('<t1></t1>')"
... )
>>> df.select(parse_xml("v").alias("result")).show()
------------------
|"RESULT"        |
------------------
|<t1>            |
|  foo           |
|  <t2>bar</t2>  |
|  <t3></t3>     |
|</t1>           |
|<t1></t1>       |
------------------
Copy