WebSphere Message Broker, Version 8.0.0.7 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

A note about copying fields

When you copy an input message element to an output element, the value and type of the output element is set to that of the input element. Therefore, if, for example, you have an input XML document with an attribute, and you want to set a Field element (rather than an attribute) in your output message to the value of the input attribute, you must include a TYPE clause cast to change the element-type from attribute to Field.

For example, given the following input:
<Field01 Attrib01='Attrib01_Value'>Field01_Value</Field01>
To create an output, such as in the following example:
<MyField_A MyAttrib_A='Attrib01_Value' MyAttrib_B='Field01_Value' >
		<MyField_B>Field01_Value</MyField_BC>
		<MyField_C>Attrib01_Value</MyField_C>
	</MyField_A'>
You would use the following ESQL:
-- Create output attribute from input attribute
SET OutputRoot.XMLNSC.MyField_A.MyAttrib_A = InputRoot.XMLNSC.Field01.Attrib01;
-- Create output field from input field
SET OutputRoot.XMLNSC.MyField_A.MyField_B = InputRoot.XMLNSC.Field01;

-- Create output attribute from input field value, noting we have to 
-- "cast" back to an attribute  element
SET OutputRoot.XMLNSC.MyField_A.(XMLNSC.Attribute)MyAttrib_B = 
               InputRoot.XMLNSC.Field01;

-- Create output field from input attribute value, noting we have to 
-- "cast" back to a field element
SET OutputRoot.XMLNSC.MyField_A.(XMLNSC.Field)MyField_C = 
               InputRoot.XMLNSC.Field01.Attrib01;
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2016Copyright IBM Corporation 1999, 2016.

        
        Last updated:
        
        Last updated: 2016-05-23 14:46:10


Task topicTask topic | Version 8.0.0.7 | ac20425_