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 » Move NextSibling repeat question

Post new topic  Reply to topic
 Move NextSibling repeat question « View previous topic :: View next topic » 
Author Message
sunny_30
PostPosted: Wed Sep 24, 2014 3:17 pm    Post subject: Move NextSibling repeat question Reply with quote

Master

Joined: 03 Oct 2005
Posts: 258

what is difference in below 2 lines please:

MOVE myRef NEXTSIBLING REPEAT NAME;
MOVE myRef NEXTSIBLING REPEAT TYPE NAME;

thank you
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Sep 24, 2014 3:27 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The word "TYPE"...

Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Sep 25, 2014 4:49 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mqjeff wrote:
The word "TYPE"...





Seriously.

Adding that parameter changes how MOVE works.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
sunny_30
PostPosted: Thu Sep 25, 2014 6:56 am    Post subject: Reply with quote

Master

Joined: 03 Oct 2005
Posts: 258

Lets assume its xmlns data, does it mean the 'REPEAT TYPE NAME' ensures the XML-schema datatypes AND the field-names match before the MOVE?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Sep 25, 2014 7:02 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

If a TYPE clause, NAME clause, or both are present, the target is again moved in the direction specified (PREVIOUSSIBLING or NEXTSIBLING, or FIRSTCHILD or LASTCHILD) but to a field with the given type, name, or both. This is particularly useful when the name or type (or both) of the target field is known, because this reduces the number of MOVE statements required to navigate to a field.
Back to top
View user's profile Send private message
sunny_30
PostPosted: Thu Sep 25, 2014 8:40 am    Post subject: Reply with quote

Master

Joined: 03 Oct 2005
Posts: 258

thank you !
so its not a dataType, its fieldType
Infocenter says " this is the type of the field, not the data type of the field that the parameter identifies."

i always used REPEAT NAME and omitted the TYPE clause in there.
May be its a best practice to use it if the intention would be move to same-named sibling field, typically XML data
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Sep 25, 2014 12:26 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

The REPEAT clause is just a shorthand so that the programmer does not have to re-specify the NAME and TYPE.

As you rightly said ( and you should really have looked in the info center before ) the TYPE is not the data type. It is the 'field type' which is NAME, NAMEVALUE or VALUE in most cases. XMLNSC and some other parsers use some parser-specific field types as well.

If you are navigating an XMLNSC message tree it is probably safest to specify the NAME explicitly, and not use the REPEAT clause. Why? Because XMLNSC almost always creates one NAMEVALUE element to represent a simple XML tag, but if the tag contains a mixture of CDATA and ordinary text it will instead create a NAME node with one or more VALUE children. So a REPEAT clause would be over-specific, and could cause the MOVE to skip the exceptional case.

In 99.9% of real-world scenarios, using REPEAT will be OK - but integration developers are paid to think about the 0.1% cases.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
sunny_30
PostPosted: Thu Sep 25, 2014 12:53 pm    Post subject: Reply with quote

Master

Joined: 03 Oct 2005
Posts: 258

Thank you.
kimbert wrote:
Because XMLNSC almost always creates one NAMEVALUE element to represent a simple XML tag, but if the tag contains a mixture of CDATA and ordinary text it will instead create a NAME node with one or more VALUE children.

Just to clarify. So, for this example scenario you described, you are suggesting to use "REPEAT NAME" or "NAME 'fieldname'" but not "REPEAT TYPE NAME" correct ?
Assuming the sibling name to MOVE to, and the fieldname where the Ref is currently pointed to, are both same, wouldnt "REPEAT NAME" & "NAME 'fieldname'" result in same exact behavior ?
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Sep 26, 2014 12:49 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
So, for this example scenario you described, you are suggesting to use "REPEAT NAME" or "NAME 'fieldname'" but not "REPEAT TYPE NAME"
Yes - exactly that.
Quote:
Assuming the sibling name to MOVE to, and the fieldname where the Ref is currently pointed to, are both same, wouldnt "REPEAT NAME" & "NAME 'fieldname'" result in same exact behavior ?
Yes - I think they would. The REPEAT keyword just makes the intention more obvious and saves a few keystrokes.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
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 » Move NextSibling repeat question
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.