xml_is_well_formed_content() 是一个系统函数,用于检查提供的 XML 文本值是否表示格式良好的内容。
xml_is_well_formed_content() 在 PostgreSQL 9.1 中添加。
用法
xml_is_well_formed_content (text) →boolean
xml_is_well_formed_content() 等同于将 xmloption 设置为 content 时的 xml_is_well_formed()。
变更历史
- PostgreSQL 9.1
- 添加(提交 a0b7b717)
示例
xml_is_well_formed_content() 的基本用法示例
postgres=# SELECT xml_is_well_formed_content('<foo>bar</foo>');
xml_is_well_formed_content
----------------------------
t
(1 row)
postgres=# SELECT xml_is_well_formed_content('<foo>bar');
xml_is_well_formed_content
----------------------------
f
(1 row)
参考资料
- PostgreSQL 文档: xml_is_well_formed_content()
