WebSphere Message Brokers
File: ac17290_
Writer: Bill Oppenheimer

Task topic

This build: July 31, 2007 21:18:54

Ordering fields in an XML message

When you create an XML output message in a Compute node, the order in which your lines of ESQL appear is important, because the message elements are created in the order in which you code them.

Consider the following XML message:
 <Order>
   <ItemNo>1</ItemNo>
   <Quantity>2</Quantity>
</Order>
If you want to add a DocType Declaration to this, insert the DocType Declaration before you copy the input message to the output message. For example:
SET OutputRoot.XMLNS.(XML.XmlDecl) = '';
SET OutputRoot.XMLNS.(XML.XmlDecl).(XML.Version) = '1.0';
SET OutputRoot.XMLNS.(XML.DocTypeDecl)Order ='' ; 
SET OutputRoot.XMLNS.(XML.DocTypeDecl).(XML.SystemId) 
	= 'NewDtdName.dtd';

SET OutputRoot = InputRoot;
 -- more ESQL -- 
If you put the last statement to copy the input message before the XML-specific statements, the following XML is generated for the output message. This is not well-formed and fails when written from the message tree to a bit stream in the output node:
<Order>
   <ItemNo>1</ItemNo>
   <Quantity>2</Quantity>
</Order>
<?xml version="1.0"?>
<!DOCTYPE Order SYSTEM "Order.dtd"> 
Related concepts
Message flows overview
ESQL overview
Message modeling
Related tasks
Designing a message flow
Defining message flow content
Managing ESQL files
Related reference
Compute node
Database node
Filter node
ESQL reference
SET statement
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:18:54

ac17290_ This topic's URL is: