|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
  |
|
ESQL question |
View previous topic :: View next topic |
Author |
Message
|
jbacskai |
Posted: Wed Apr 04, 2007 5:44 am Post subject: ESQL question |
|
|
 Apprentice
Joined: 30 Dec 2002 Posts: 26 Location: Hungary
|
Hi All,
the ESQL guide states:
"You can use the asterisk (*) wildcard character in a path element to match any name. You can also use “*” to specify a partial name. For example, Prefix* matches any name that begins with “Prefix”."
I would like to select the name elements in one step from the following XML
<A>
<B>
<name>Smith</name>
</B>
<C>
<name>Johnson</name>
</C>
...
</A>
using ESQL:
DECLARE ROW1 ROW;
SET ROW1.Rows[] = SELECT I FROM InputRoot.XML.A.*.name AS I;
but It does not work, it just gives back empty result.
Should it work or I should use other ESQL e.g. iteration?
Using prefix* had the same result.
Regards,
Janos |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Apr 04, 2007 5:57 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
SELECT I.name from InputRoot.XMLNS.A.[] as I;
Or something close. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jbacskai |
Posted: Thu Apr 05, 2007 1:58 am Post subject: |
|
|
 Apprentice
Joined: 30 Dec 2002 Posts: 26 Location: Hungary
|
Thanx Jefflowrey for the answer,
but it is applicable on a simple XML, if you have repeating elements on more then one level, then it is not good solution, because you can use [] just at the end of the path.
I found several topic about XPATH, ESQL so we have to use Java compute node to get elements with the same name, but with on different path.
My question is still stands using * in the middle of the path should give or should not give result?
Documentation contains as I wrote, broker toolkit accepts is, and the code is deployable...
Regards,
Janos |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Apr 05, 2007 3:22 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
So what you're saying is you want a simple means to have entirely random access to a tree structure, which by nature is designed for sequential access?
I tihnk you will find, if you look closely, that the * only matches a single element of the path, and not any number of path elemenets.
Solve the problems you need to solve by thinking of the data as trees. _________________ I am *not* the model of the modern major general. |
|
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
|
|
|
|