8.13. XML Type
8.13.XML类型
The xml data type can be used to store XML data. Its advantage over storing XML data in a text field is that it checks the input values for well-formedness, and there are support functions to perform type-safe operations on it; see Section 9.14. Use of this data type requires the installation to have been built with configure --with-libxml.
xml数据类型可以存储XML数据。使用xml类型存储XML数据比用text类型储存的好处就是,前者可以检查输入数据的格式,且提供了丰富的函数对数据进行处理,参见9.15节。要想使用此数据类型,需要在安装时指定configure --with-libxml。
The xml type can store well-formed “documents”, as defined by the XML standard, as well as “content” fragments, which are defined by the production XMLDecl? content in the XML standard.Roughly, this means that content fragments can have more than one top-level element or character node. The expression xmlvalue IS DOCUMENT can be used to evaluate whether a particular xml value is a full document or only a content fragment.
xml数据类型可以存储XML标准定义的格式正确的“文档”以及由XMLDecl?定义的“内容”片段。 大致来说,这意味着内容片段可以具有多个顶级元素或字符节点。 表达式xmlvalue IS DOCUMENT可用于评估特定的xml值是完整文档还是仅是内容片段。
xml数据类型的限制及兼容性等,请参见附录D.3。