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 regarding namespace stripping code

Post new topic  Reply to topic
 Question regarding namespace stripping code « View previous topic :: View next topic » 
Author Message
tony_f
PostPosted: Fri Apr 13, 2012 3:24 am    Post subject: Question regarding namespace stripping code Reply with quote

Novice

Joined: 30 Sep 2011
Posts: 19

Hi

I found this code posted on this forum - I believe by Kimbert.

Code:
CREATE PROCEDURE StripNamespaces(IN StartRefPtr REFERENCE)
BEGIN
   DECLARE FieldRefPtr REFERENCE TO StartRefPtr;
      
   MOVE FieldRefPtr FIRSTCHILD;
   IF LASTMOVE(FieldRefPtr) THEN
      IF FIELDTYPE(FieldRefPtr) IN (0x01000000, 0x03000000) THEN    
           SET FieldRefPtr.(XML.NamespaceDecl)* = NULL;
           SET FieldRefPtr NAMESPACE = '';
      END IF;
        END IF;
      
        WHILE LASTMOVE(FieldRefPtr) DO
           CALL StripNamespaces(FieldRefPtr);
           IF FIELDTYPE(FieldRefPtr) IN (0x01000000, 0x03000000)    THEN          
                SET FieldRefPtr.(XML.NamespaceDecl)* = NULL;
                SET FieldRefPtr NAMESPACE = '';
                END IF;
      MOVE FieldRefPtr NEXTSIBLING;
   END WHILE;
END;


It works really well and does exactly what I wanted. The question is regarding the hex representation of the FIELDTYPE values. How can I identify what the hex values are for a specific fieldtype and is it possible that the hex value could change in future releases?
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Apr 13, 2012 4:06 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Not actually my code - although I may well have commented on that thread.

This code will only work for the XMLNS domain. It will not work with XMLNSC. If this code is working for you, then you must be working on an old message flow that uses XMLNS. Or else you are purposely using XMLNS in a new message flow, and you can tell us why

I'm discounting the possibility that you are using the deprecated 'XML' domain.

The values of the field type constants will not change - if IBM changed that sort of thing it would break a lot of message flows.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Apr 13, 2012 4:08 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

kimbert wrote:
Not actually my code

It did appear to refer to the XMl domain, so I was sure it was at least *very old*.
kimbert wrote:
The values of the field type constants will not change - if IBM changed that sort of thing it would break a lot of message flows.


but you should still use the names instead of the literal values, for readability.
Back to top
View user's profile Send private message
tony_f
PostPosted: Fri Apr 13, 2012 4:23 am    Post subject: Reply with quote

Novice

Joined: 30 Sep 2011
Posts: 19

kimbert wrote:
This code will only work for the XMLNS domain. It will not work with XMLNSC. If this code is working for you, then you must be working on an old message flow that uses XMLNS. Or else you are purposely using XMLNS in a new message flow, and you can tell us why

.


Hmmm, interesting. The message set that I am removing the namespaces from is actually XMLNSC.
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Apr 13, 2012 5:08 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Then your code is working by pure luck. You should change to using XMLNSC.NamespaceDecl as soon as possible.

Refer here for details on XMLNSC field type constants: http://publib.boulder.ibm.com/infocenter/wmbhelp/v8r0m0/topic/com.ibm.etools.mft.doc/ac67192_.htm

Note the Tip at the beginning of that topic.
Back to top
View user's profile Send private message
tony_f
PostPosted: Fri Apr 13, 2012 5:13 am    Post subject: Reply with quote

Novice

Joined: 30 Sep 2011
Posts: 19

kimbert wrote:
Then your code is working by pure luck. You should change to using XMLNSC.NamespaceDecl as soon as possible.

.


A lot of my code works that way

Many thanks Kimbert, I'll change that code right away. Thanks for the link as well.
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 » Question regarding namespace stripping code
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.