XML functions

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 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

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