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 » Create nextsibling question/issue

Post new topic  Reply to topic
 Create nextsibling question/issue « View previous topic :: View next topic » 
Author Message
special_agent_Queue
PostPosted: Mon Oct 02, 2006 12:13 pm    Post subject: Create nextsibling question/issue Reply with quote

Centurion

Joined: 27 Jul 2006
Posts: 102

I have a loop. Within this loop, I am using the statement CREATE NEXTSIBLING OF Pointer TYPE NameValue NAME EvalFName VALUE FIELDVALUE(Pointer).

Pointer points to an element.
The statement appears to be creating these new fields as attributes of the parent element, rather than as elements.

Has anyone experienced this, or have any idea why this is happening?
I'm working with v6 of the toolkit and broker. Here's a piece of the input msg, relevant code, and output msg.

Input Message:
<Claim><clm:fileNumber/>
<clm:lossDate>2006-09-11</clm:lossDate>
<clm:lossTime>12:00:00</clm:lossTime>
<clm:ServiceProviderRole>
...
</clm:ServiceProviderRole>
<clm:lossType/>
<clm:catCode/>
<clm:excludeCode/>
<clm:amountPaid/>

Code:
   
CREATE PROCEDURE AddPrefixes(IN StartPtr REFERENCE, IN Prefix CHAR, IN GoToChildren BOOLEAN, IN GoToSibling BOOLEAN)
   BEGIN
      DECLARE Pointer REFERENCE TO StartPtr;
      
      DECLARE Pre CHAR;
      DECLARE Children BOOLEAN;
      DECLARE Sib BOOLEAN;
      SET Pre = Prefix;
      SET Children = GoToChildren;
      SET Sib = GoToSibling;
      DECLARE KeepGoing BOOLEAN true;
      DECLARE FName CHARACTER;
      DECLARE EvalFname CHARACTER;
      WHILE LASTMOVE(Pointer) AND KeepGoing DO
         SET FName = FIELDNAME(Pointer);
         SET EvalFname = Pre || FName;
         CREATE NEXTSIBLING OF Pointer TYPE NameValue NAME EvalFname
            VALUE FIELDVALUE(Pointer);
         DECLARE TempPointer REFERENCE TO Pointer;
         IF Children THEN
            MOVE Pointer FIRSTCHILD;
            IF LASTMOVE(Pointer) THEN
               CALL AddPrefixes(Pointer,Pre,Children,true);
            END IF;
         END IF;
         MOVE Pointer TO TempPointer;
         MOVE TempPointer NEXTSIBLING;
         --SET Pointer = NULL;
         MOVE Pointer TO TempPointer;
         IF Sib THEN
            MOVE Pointer NEXTSIBLING;
         ELSE
            SET KeepGoing = false;
         END IF;
      END WHILE;
   END;
   


Output Message:
<Claim clmfileNumber="" clm="....." clmlossDate="2006-09-11" clm="....." clmlossTime="12:00:00" clm="....." clmServiceProviderRole="........................................." clm="....." clmlossType="" clm="....." clmcatCode="" clm="....." clmexcludeCode="" clm="....." clmamountPaid="" clm="....." clmAttorneyRole="..........." clm="....." clmlossLocation="......................................................................." clm="....." clmInvolvedPartyRole="................." clm="....." clmExposures="..........." clm="....." clmAdjusterRole="................." clm="....." clmstolenProperty="" clm="....." clmlossDescription="" clm="....." clmlaborRates="" clm="....." clmPolicyCoverages="..........." clm="....." clmSalvageRole="..........." clm="....." clmFileHandlers="..........." clm="....">
<fileNumber/>
<lossDate>2006-09-11</lossDate>
<lossTime>12:00:00</lossTime>
<ServiceProviderRole>

Those ... in the "" are actually carriage returns, slight annoyance.

Let me know if you need more info.

Thanks for the help!
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Oct 02, 2006 12:23 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Why are you using Create.. Next Sibling instead of Set?

What domain are you working in?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
special_agent_Queue
PostPosted: Tue Oct 03, 2006 4:36 am    Post subject: Reply with quote

Centurion

Joined: 27 Jul 2006
Posts: 102

xmlns

I'm using create...next because set won't keep the right order (or so i thought). I had pretty much copied the input root with a lil bit of modification to the output root. If I use SET then it puts it at the end(?)
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Oct 03, 2006 4:44 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

It's the preferred choice to use XMLNSC with v6.

If you're inserting into the middle of a tree, yeah.. you probably do need to use create field. You should try looking at the IDENTITY clause of the Create statement.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
special_agent_Queue
PostPosted: Tue Oct 03, 2006 4:51 am    Post subject: Reply with quote

Centurion

Joined: 27 Jul 2006
Posts: 102

thanks, i'll give it a try.

I did try to use the XMLNSC.
That messed it up even more. (It made the new fields attributes of an ancestor 3 or 4 levels up).
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Oct 03, 2006 4:57 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The basic problem is that you're either not creating these fields under a parser - and so it's making a wild guess about what it should be - or that you're not giving these fields a specific field type (attribute, element, etc.) and so it's taking a default value that you don't want.

Start with the IDENTITY clause. If that doesn't fix it, then go back and re-read the reference on the Create statement, particularly the DOMAIN clause and anything else that seems to relate to parsers and node types.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
special_agent_Queue
PostPosted: Tue Oct 03, 2006 5:21 am    Post subject: Reply with quote

Centurion

Joined: 27 Jul 2006
Posts: 102

It appears that IDENTITY would correct the problem, except that with it, there isn't anyway to use a variable for the name of the field created, nor can you use the || operand.

I'll continue to try the other suggestions.
Thanks.
Back to top
View user's profile Send private message
special_agent_Queue
PostPosted: Tue Oct 03, 2006 5:27 am    Post subject: Reply with quote

Centurion

Joined: 27 Jul 2006
Posts: 102

Thanks! Adding the DOMAIN clause worked.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Create nextsibling question/issue
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.