|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Cardinality fun and games |
« View previous topic :: View next topic » |
Author |
Message
|
Segs |
Posted: Tue Nov 13, 2001 3:28 am Post subject: |
|
|
Voyager
Joined: 04 Oct 2001 Posts: 78 Location: Zurich Financial Services
|
Hi
I've got some XML
<CONTAINER><data><p1><a>Fred</a><b>Fred</b><c>Fred</c><d>Fred</d></p1><p2><a>Fred</a><b>Fred</b><c>Fred</c><d>Fred</d></p2></data></CONTAINER>
When you execute the Esql statements
SET I = CARDINALITY InputRoot.XML.CONTAINER.data.*[]);
SET X = CARDINALITY(InputRoot.XML.CONTAINER.data.P3.*[]);
I and X equate to 2, even though you can't navigate to InputRoot.XML.CONTAINER.data.P3
I would have expected the result of the 2nd statement to be 0.
Am I missing something?
Please have a look at the trace below.
Thanks
Segs...
BIP2537I: Node 'Cardinality_Test.Compute1': Executing statement 'SET X = CARDINALITY(InputRoot.XML.CONTAINER.data.P3.*[]);' at (11, 1).
The statement being executed was 'SET X = CARDINALITY(InputRoot.XML.CONTAINER.data.P3.*[]);'.
No user action required.
BIP2538I: Node 'Cardinality_Test.Compute1': Evaluating expression 'CARDINALITY(InputRoot.XML.CONTAINER.data.P3.*[])' at (11, 9).
The expression being evaluated was 'CARDINALITY(InputRoot.XML.CONTAINER.data.P3.*[])'.
No user action required.
BIP2543E: Node 'Cardinality_Test.Compute1': (11, 50) : Failed to navigate to path element.
The specified path element did not exist.
No user action required.
UserTrace BIP2540I: Node 'Cardinality_Test.Compute1': Finished evaluating 'CARDINALITY(InputRoot.XML.CONTAINER.data.P3.*[])' at (11, 9); result was '2'.
The result of evaluating the expression 'CARDINALITY(InputRoot.XML.CONTAINER.data.P3.*[])' was '2'.
No user action required.
|
|
Back to top |
|
 |
Tibor |
Posted: Tue Nov 13, 2001 3:43 am Post subject: |
|
|
 Grand Master
Joined: 20 May 2001 Posts: 1033 Location: Hungary
|
Segs,
There is no InputBody....P3 element in your XML tree, therefore CARDINALITY() results its parent property, IMO.
|
|
Back to top |
|
 |
Segs |
Posted: Tue Nov 13, 2001 4:33 am Post subject: |
|
|
Voyager
Joined: 04 Oct 2001 Posts: 78 Location: Zurich Financial Services
|
Thanks for this but I've just tested this on 2.0.1 broker and this set X to 0. This must be introduced in 2.0.2. I'll read the 2.0.2 readme's.
Segs |
|
Back to top |
|
 |
Segs |
Posted: Tue Nov 13, 2001 10:15 am Post subject: |
|
|
Voyager
Joined: 04 Oct 2001 Posts: 78 Location: Zurich Financial Services
|
Apparently this is a known problem as is corrected in CSD 2 for MQSI v2.0.2 |
|
Back to top |
|
 |
DaveyD |
Posted: Wed Dec 12, 2001 9:41 am Post subject: |
|
|
Novice
Joined: 11 Dec 2001 Posts: 12
|
Try this instead :
SET I = CARDINALITY (InputRoot.XML.CONTAINER.data[]); |
|
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
|
|
|
|