|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
ESQL syntax |
« View previous topic :: View next topic » |
Author |
Message
|
gappodi |
Posted: Wed Feb 04, 2015 9:44 pm Post subject: ESQL syntax |
|
|
 Voyager
Joined: 05 Sep 2014 Posts: 76
|
I saw the following piece of ESQL code fragment.
IF FIELDTYPE(mappingXML.*[<]) IS NULL THEN
//some code
END IF
My question here is , what "*[<]" resolves to ? I have never seen this kind of syntax before. I always thought only an index can be put between square brackets, or kept empty. What this "<" character mean here ? |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Feb 04, 2015 11:57 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Here is an example of the use of that syntax
Code: |
declate cFieldName CHAR;
SET cFieldName = FIELDNAME(InputRoot.XMLNSC.*[<]);
|
This returns the name of the field at the root of the document regardless of namespace (if present). (for that use the FIELDNAMESPACE function)
for example. With this bit of XML parsed into an XMLNSC tree
Code: |
<Timer>
<ScheduleDate>2015-02-02</ScheduleDate>
<ScheduleQueue>A.IN</ScheduleQueue>
</Timer>
|
It returns 'Timer'.
Does this help? _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
gappodi |
Posted: Thu Feb 05, 2015 12:55 am Post subject: |
|
|
 Voyager
Joined: 05 Sep 2014 Posts: 76
|
Thanks. This really helped with the example. However, I just now found about this in an ESQL documentation guide. Follwing is what I found.
Code: |
You can refer to the last instance of a repeating field using the special [<] array index, and to instances relative to the last (for example, the second to last) as follows:
Field[<] indicates the last element.
Field[<1] indicates the last element.
Field[<2] indicates the last but one element (the penultimate element).
You can also use the array index [>] to represent the first element, and elements relative to the first element in a similar way.
Field[>] indicates the first element. This is equivalent to Field[1]. |
|
|
Back to top |
|
 |
mqjeff |
Posted: Thu Feb 05, 2015 5:35 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Almost all, if not absolutely all, of the Broker Parsers require that the tree have a single root node under the parser. This is especially true of the XMLNSC parser - since XML requires all documents to have a single root node.
So the last child of Root.XMLNSC will also be the first child of Root.XMLNSC.
Also, the ESQL you gave returns the FIELDTYPE, not the FIELDNAME. Which in the case of smdavies99's example will be something like XMLNSC.Folder. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|