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 » Any quick way to add namespace?

Post new topic  Reply to topic
 Any quick way to add namespace? « View previous topic :: View next topic » 
Author Message
KIT_INC
PostPosted: Tue Apr 10, 2012 6:13 am    Post subject: Any quick way to add namespace? Reply with quote

Knight

Joined: 25 Aug 2006
Posts: 589

Because of merging, we were given a large number of mqsi 21 esqls from another location. We do not have to migrate them to WMB 7 which is our environment. However we like to reuse some of them. Since we started with WMB6, we already use namespace and XMLNSC. We do not have any experience with this. We know that we have to add namespace declaration and name space prefix to the ESQL code in general. Is using an editor to do a massive serach and replace the only way to do it ?
For example FIND OutputRoot.XML.A.B.C REPLACE InputRoot.XMLNSC.ns:A.ns:B.ns:C where ns is the name space prefix.
Any experience you can share will be greatly appreciated.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Apr 10, 2012 6:51 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I might tend to use a find/replace thingy, like grep or perl or sed or etc, rather than using manual changes in a full featured editor.

But you're still going to have to load the ESQL files into a 7.0 toolkit project and validate them. 2.1 esql has a number of subtle differences that are going to require manual intervention.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Apr 10, 2012 6:53 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

When dealing with namespaces, we have found that local declarations are more convenient rather than global declarations, especially when multiple developers are working in the same area. Therefore, as you are migrating your files, move your namespace decls into the module and out of the global scope. I'm sure others may have differing opinions on this advice. We also standardized the naming convention so that the same XML tag equates to the same namespace tag in all locations.

For future, we want a neat little utility that imports a set of namespaces in all esql files. IMHO. Thanks Vitor.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqsiuser
PostPosted: Tue Apr 10, 2012 6:56 am    Post subject: Re: Any quick way to add namespace? Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

Search and replace (probably "within files") is fine in my view...

Just to put up an alternative:

You can do that with a texteditor, e.g. notepad++ (or ultraedit) or ...

For XML: Use XMLSpy or oXygen, since I have the impression that they can handle large (and probably also a lot of) (XML-)files better (than a plain texteditor)... but, o.k. you want to convert your ESQLs.

BTW: It is called XMLNSC, but you do not need to use namespaces with the XMLNSC parser!
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Apr 10, 2012 7:12 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

lancelotlinc wrote:
For future, we want a neat little utility that imports a set of namespaces in all esql files. IMHO. Thanks Vitor.

You should be able to alter your source management systems so that it runs a script when an .esql file is checked out.

which will work like magic until it

Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Apr 10, 2012 7:17 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

mqjeff wrote:
lancelotlinc wrote:
For future, we want a neat little utility that imports a set of namespaces in all esql files. IMHO. Thanks Vitor.

You should be able to alter your source management systems so that it runs a script when an .esql file is checked out.


I suppose we can use this as a work around until WMB v9. ESQL <import> like the Java <import> would be ideal.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Tue Apr 10, 2012 7:33 am    Post subject: Reply with quote

Grand High Poobah

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

lancelotlinc wrote:
ESQL <import> like the Java <import> would be ideal.


You can currently have a common "imported" esql that contains namespace definitions.

Not exactly the same as an import, but another workaround until WMBv9.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Apr 10, 2012 12:01 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Be careful with this:
Quote:
For example FIND OutputRoot.XML.A.B.C REPLACE InputRoot.XMLNSC.ns:A.ns:B.ns:C where ns is the name space prefix.

Before you do anything, read this:
http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/topic/com.ibm.etools.mft.doc/ac67210_.htm
and this:
http://www.mqseries.net/phpBB2/viewtopic.php?t=57231&sid=b5207927d027df146dc92893feec7c83
and this:
http://www.mqseries.net/phpBB2/viewtopic.php?t=54901&sid=37c887a31b02049dbf06ce5f024ea4a1

XMLNSC is not a plug-in replacement for the old XML domain. ESQL that worked with the XML domain is not guaranteed to work in the same way with XMLNSC.

On the other hand, the XMLNS domain is exactly like the XML domain except that it supports namespaces. So you need to choose between these two options:
a) if you do not need to change the ESQL for other reasons, use XMLNS and just add namespaces to your ESQL.
b) if you are already planning to make changes your ESQL for other reasons then use XMLNSC and make sure that you test carefully.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Apr 10, 2012 9:13 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

And think also about another alternative:

Write a utility function that will assign the given namespace to each of the children... Start at the top. Find where the namespace changes and reassign the changed one going down... Use REFERENCES.

Make it recursive.

Build once reuse multiple times. Quick way of solving your problem with minimal code changes (thinking of a default namespace here).

You could also insert an added benefit by checking the type and transforming certain XML types to XMLNSC types...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Any quick way to add namespace?
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.