WebSphere Message Brokers
File: ac06020_
Writer: Bill Oppenheimer

Task topic

This build: July 31, 2007 21:17:50

Accessing multiple occurrences of an element in a message in the MRM domain

You can access MRM domain elements following the general guidance given in Accessing known multiple occurrences of an element and Accessing unknown multiple occurrences of an element. Further information specific to MRM domain messages is provided in this topic.

Consider the following statements:

DECLARE brw NAMESPACE 'http://www.ibm.com/Borrowed';

SET OutputRoot.MRM.brw:Borrowed[1].VideoTitle = 'MRM Greatest Hits Volume 1';
SET OutputRoot.MRM.brw:Borrowed[2].VideoTitle = 'MRM Greatest Hits Volume 2';

The above SET statements operate on two occurrences of the element Borrowed. Each statement sets the value of the child VideoTitle. The array index indicates which occurrence of the repeating element you are interested in.

When you define child elements of a complex type (which has its Composition property set to Sequence) in a message set, you can add the same element to the complex type more than once. These instances do not have to be contiguous, but you must use the same method (array notation) to refer to them in ESQL.

For example, if you create a complex type with a Composition of Sequence that contains the following elements:

StringElement1
IntegerElement1
StringElement1

use the following ESQL to set the value of StringElement1:

SET OutputRoot.MRM.StringElement1[1] = 
              'This is the first occurrence of StringElement1';
SET OutputRoot.MRM.StringElement1[2] = 
              'This is the second occurrence of StringElement1';

You can also use the arrow notation (the greater than (>) and less than (<) symbols) to indicate the direction of search and the index to be specified:

SET OutputRoot.MRM.StringElement1[>] = 
               'This is the first occurrence of StringElement1';
SET OutputRoot.MRM.StringElement1[<2] = 
               'This is the last but one occurrence of 
 StringElement1';
SET OutputRoot.MRM.StringElement1[<1] = 
               'This is the last occurrence of StringElement1';

Refer to Accessing known multiple occurrences of an element and Accessing unknown multiple occurrences of an element for additional detail.

Related concepts
Message flows overview
ESQL overview
Message modeling
Related tasks
Designing a message flow
Defining message flow content
Managing ESQL files
Developing message models
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:17:50

ac06020_ This topic's URL is: