ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » question on cardinality function behaviour

Post new topic  Reply to topic
 question on cardinality function behaviour « View previous topic :: View next topic » 
Author Message
nab054371
PostPosted: Wed Nov 15, 2006 2:58 pm    Post subject: question on cardinality function behaviour Reply with quote

Disciple

Joined: 15 Nov 2006
Posts: 173

Input XML Message:

<HTTPTest>
<URL>http://localhost:7080/svc1</URL>
<InputData>
<Data>Test</Data>
</InputData>
<InputData>
<Data>Test1</Data>
</InputData>
<OutputData>
<Data/>
</OutputData>
</HTTPTest>


Compute node esql:

CREATE COMPUTE MODULE testCARD_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- CALL CopyMessageHeaders();
CALL CopyEntireMessage();
SET OutputRoot.XML.HTTPTest.HTTPTestCARD = CARDINALITY(InputRoot.XML.HTTPTest.*[]);
RETURN TRUE;
END;

CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;

CREATE PROCEDURE CopyEntireMessage() BEGIN
SET OutputRoot = InputRoot;
END;
END MODULE;


I was expecting SET OutputRoot.XML.HTTPTest.HTTPTestCARD = CARDINALITY(InputRoot.XML.HTTPTest.*[]); to come back with 4.However it comes up with 8.
Why?Am I missing something here?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Nov 15, 2006 3:12 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You're using the wrong parser.

Use XMLNSC.

It's the compact parser.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
nab054371
PostPosted: Thu Nov 16, 2006 8:56 am    Post subject: Reply with quote

Disciple

Joined: 15 Nov 2006
Posts: 173

I am nto sure I agree with that.CARDINALITY function is independent of the parser used.Anyway when I do it with XMLNSC it gives me 0?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Nov 16, 2006 9:01 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

CARDINALITY is working correctly for your Input XML message when parsed by the XML Parser, if your input data has line endings after your closing tags!

That is, there's a difference in the logical tree created for the XML "<A><b>q</b></A>" than for the XML "<A>
<b>q</b>
</A>"

The second will include more nodes to cover the line endings.

If you get zero when you use XMLNSC, then you're coding your statement wrong, or you didn't parse your data with XMLNSC.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
JosephGramig
PostPosted: Thu Nov 16, 2006 12:22 pm    Post subject: Reply with quote

Grand Master

Joined: 09 Feb 2006
Posts: 1244
Location: Gold Coast of Florida, USA

For instance, if you set the parser to XMLNSC in the MQInput node but use RfhUtil and put XML in the MQ Message Format field, you will get the XML parser.

This is because XMLNSC is the default parse and you over rode that...
_________________
Joseph
Administrator - IBM WebSphere MQ (WMQ) V6.0, IBM WebSphere Message Broker (WMB) V6.1 & V6.0
Solution Designer - WMQ V6.0
Solution Developer - WMB V6.1 & V6.0, WMQ V5.3
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » question on cardinality function behaviour
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.