XML functions
This section contains the list of XML functions and a brief description of each function.
| Function | What it does |
|---|---|
| is_wellformed | Takes a string expression and checks that it is well formed XML. |
| xmlencode | Converts an XML field to a string expression. |
| xmldecode | Converts a string expression to XML. |
is_wellformed
Checks that a string expression is syntactically correct XML. Returns true (Boolean) if the resulting string is well formed XML. Note that an XML field can be used to create string expressions.
Use the
following syntax:
is_wellformed (string_expr)where
string_expr is either a string expression or an XML field.xmlencode
Converts from XML to standard string format, encoding all the XML special characters. The resulting string can be used as a string in an XML message.
Use
the following syntax:
xmlencode (string_expr)where
string_expr is either a string expression or an XML field.In
the example below, string_expr is an XML data field
with the value shown under XML format. The string format is the result.
| XML format | String format |
|---|---|
|
<?xml version="1.0"
encoding="UTF-8"?> <!-- edited
with XMLSPY v5 U (http://www.xmlspy.com) by FileNET Corp. (FileNET
Corp.) --> <xs:schema attributeFormDefault="unqualified"
elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <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> |
xmldecode
Converts from string format to XML format.
Use the following syntax:
xmldecode (string_expr)where
string_expr is either a string expression or an XML field.