Utilize nomes de correlação para acessar cada elemento de sintaxe XML em XmlDecl.
Estes nomes referem-se aos elementos em mensagens de entrada e a elementos, atributos e valores que foram configurados em mensagens de saída.
A tabela a seguir define os nomes de correlação válidos.
Elemento de Sintaxe | Nome de correlação |
---|---|
XmlDecl | (XML.XmlDecl) |
Version | (XML.Version) |
Encoding | (XML."Encoding") |
Standalone | (XML.Standalone) |
(XML."Encoding") deve incluir aspas porque Encoding é uma palavra reservada.
IF InputRoot.XML.(XML.XmlDecl)* IS NULL THEN -- mais ESQL -- IF InputRoot.XML.(XML.XmlDecl)*.(XML.Version)* = '1.0' THEN -- mais ESQL -- IF InputRoot.XML.(XML.XmlDecl)*.(XML."Encoding")* = 'UTF-8' THEN -- mais ESQL -- IF InputRoot.XML.(XML.XmlDecl)*.(XML.Standalone)* = 'no' THEN -- mais 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';
Este código ESQL gera a seguinte declaração XML:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>