IBM FileNet P8, V5.2.1            

XML 函数

本节包含 XML 函数列表以及每个函数的简要描述。

表 1. XML 函数及其描述表
函数 用途
is_wellformed 获取字符串表达式,并检查它是否是格式良好的 XML。
xmlencode 将 XML 字段转换为字符串表达式。
xmldecode 将字符串表达式转换为 XML。

is_wellformed

检查字符串表达式是否是语法正确的 XML。如果最终获得的字符串是格式良好的 XML,那么此函数将返回 true(布尔值)。请注意,可以使用 XML 字段来创建字符串表达式。

使用以下语法:
is_wellformed (string_expr)
其中 string_expr 是字符串表达式或者 XML 字段。

xmlencode

从 XML 转换为标准字符串格式,并对所有 XML 特殊字符进行编码。可以将最终获得的字符串用作 XML 消息中的字符串。

使用以下语法:
xmlencode (string_expr)
其中 string_expr 是字符串表达式或者 XML 字段。

在下面的示例中,string_expr 是一个 XML 数据字段,其值按 XML 格式显示。结果采用字符串格式。

表 2. XML 格式及产生的字符串格式表
XML 格式 字符串格式
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v5 U 
(http://www.xmlspy.com) by FileNET Corp. 
(FileNET Corp.) -->
<xs:schema xmlns:xs="http://www.w3.org
/2001/XMLSchema" elementFormDefault="qualified"
attributeFormDefault="unqualified">
		<xs:element name="VehicleReply">
				<xs:annotation>
						<xs:documentation>Root</xs:documentation>
	    </xs:annotation>
				<xs:complexType>
						<xs:sequence>
								<xs:element name="Owner_reply" 
type="xs:string"/>
								<xs:element name="VIN_reply" 
type="xs:string"/>
								<xs:element name="RegNumber_reply" 
type="xs:string"/>
								<xs:element name="RegFee_reply" 
type="xs:float"/>
						</xs:sequence>
				</xs:complexType>
		</xs:element>
</xs:schema>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;!-- edited with XMLSPY v5 U (http://www.xmlspy.com) by FileNET Corp. (FileNET Corp.) --&gt;&#10;&lt;xs:schema attributeFormDefault=&quot;unqualified&quot;&#10; elementFormDefault=&quot;qualified&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;&#10; &lt;xs:element name=&quot;VehicleReply&quot;&gt;&#10; &lt;xs:annotation&gt;&#10; &lt;xs:documentation&gt;Root&lt;/xs:documentation&gt;&#10; &lt;/xs:annotation&gt;&#10; &lt;xs:complexType&gt;&#10; &lt;xs:sequence&gt;&#10; &lt;xs:element name=&quot;Owner_reply&quot; type=&quot;xs:string&quot;/&gt;&#10; &lt;xs:element name=&quot;VIN_reply&quot; type=&quot;xs:string&quot;/&gt;&#10; &lt;xs:element name=&quot;RegNumber_reply&quot; type=&quot;xs:string&quot;/&gt;&#10; &lt;xs:element name=&quot;RegFee_reply&quot; type=&quot;xs:float&quot;/&gt;&#10; &lt;/xs:sequence&gt;&#10; &lt;/xs:complexType&gt;&#10; &lt;/xs:element&gt;&#10;&lt;/xs:schema&gt;

xmldecode

从字符串格式转换为 XML 格式。

使用以下语法:
xmldecode (string_expr)
其中 string_expr 是字符串表达式或者 XML 字段。


最近一次更新时间: 2015 年 10 月
bpfe014.htm

© Copyright IBM Corporation 2015.