Use correlation names to access each XML syntax element in XmlDecl.
These names refer to the elements in input messages, and to elements, attributes, and values that have been set in output messages.
The following table defines the valid correlation names.
Syntax element | Correlation name |
---|---|
XmlDecl | (XML.XmlDecl) |
Version | (XML.Version) |
Encoding | (XML."Encoding") |
Standalone | (XML.Standalone) |
(XML."Encoding") must include quotes, because Encoding is a reserved word.
IF InputRoot.XML.(XML.XmlDecl)* IS NULL THEN -- more ESQL -- IF InputRoot.XML.(XML.XmlDecl)*.(XML.Version)* = '1.0' THEN -- more ESQL -- IF InputRoot.XML.(XML.XmlDecl)*.(XML."Encoding")* = 'UTF-8' THEN -- more ESQL -- IF InputRoot.XML.(XML.XmlDecl)*.(XML.Standalone)* = 'no' THEN -- more ESQL --
-- Create an XML Declaration SET OutputRoot.XML.(XML.XmlDecl) = ''; -- Set the Version within the XML Declaration SET OutputRoot.XML.(XML.XmlDecl).(XML.Version) = '1.0'; -- Set the Encoding within the XML Declaration SET OutputRoot.XML.(XML.XmlDecl).(XML."Encoding") = 'UTF-8'; -- Set Standalone within the XML Declaration SET OutputRoot.XML.(XML.XmlDecl).(XML.Standalone) = 'no';
This ESQL code generates the following XML declaration:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>