IBM FileNet P8, 5.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 欄位。


前次更新: 2016 年 3 月
bpfe014.htm

© Copyright IBM Corp. 2016.