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 » Using Wildcards in Namespace v5.0

Post new topic  Reply to topic
 Using Wildcards in Namespace v5.0 « View previous topic :: View next topic » 
Author Message
ayanc
PostPosted: Wed Jan 03, 2007 1:23 pm    Post subject: Using Wildcards in Namespace v5.0 Reply with quote

Voyager

Joined: 15 Nov 2004
Posts: 88

Hi All,

I have a requirement to create a generic flow that will extract a particular segment from the incoming XML message that is using namespace. However the domain being used is currently XML.

Due to the generic nature of the subflow I will not be able to hard code the namespace which would be different for different message flows. So, I have tried to use wildcard characters to address the segment. However things are not running as expected.

For eg:

<Library:Library> -Root Element
<Library:Segment1> - First level Elements
<Library:Segment2>
..............................
...............................
<Library:SegmentN>

In order to access a particular segment at the first level I have tried the following:

DECLARE RF_Seg REFERENCE TO InputRoot.XML.(XML.Element)[1]."*:Segment5";

But the above code did not work. Replacing "*:Segment5" in various other combinations like the following:

{'*' || ':Segment5'}, {'*:Segment5'}, {*}:Segment5, '*:Segment5', etc. did not work for any of them.

I looked at the following link in the online help:

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ak04861_.htm

Quote:

* :NameId, *:NameId[..], (..)*:NameId, (..)*:NameId[..]
All these forms specify a name but no namespace. The target field is located by name and also by type and index where appropriate.


As per the above the syntax for specifying a wildcard NAMESPACE is using *:NAME. I also searched this forum and found the following topic relevant to this issue:

http://www.mqseries.net/phpBB2/viewtopic.php?t=18963

However things are not working that way. I will not be able to change the domain to XMLNS.

I am using WBIMB 5.0 CSD 05

Can any one suggest me a solution?

Thanx.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Jan 03, 2007 1:25 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You can't use Namespaces with the XML domain.

Use the XMLNS domain.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
ayanc
PostPosted: Wed Jan 03, 2007 1:53 pm    Post subject: Reply with quote

Voyager

Joined: 15 Nov 2004
Posts: 88

Hi Jeff,

Thanx for the response.

Agree with you on that. XML domain may not be able to understand NAMESPACES. However I am not using namespace features either.

So, if we approach the problem in a way that "Prefix:Name" is actually a simple element name having a ":" as a Special character.

In other words is there a workaround ... by using wildcards ?

Thanx.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Jan 03, 2007 1:56 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You can use an asterix to mean "any namespace".

But not with the XML domain.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Jan 04, 2007 2:13 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Hi ayanc,

Jeff is correct. Use the XMLNS domain. I know that means changing all of the paths, but you have to change your ESQL anyway. Handling namespaces using the XML domain is going to be complicated and unreliable. You might as well take the hit and do the job properly.
Back to top
View user's profile Send private message
ayanc
PostPosted: Thu Jan 04, 2007 12:31 pm    Post subject: Reply with quote

Voyager

Joined: 15 Nov 2004
Posts: 88

Hi Jeff & Kimbert,

Thanx a lot for your help.

Sorry about persisting on this issue ... I could not get the permission to change the existing code ... seems like the changes would go into "major changes category" ....

I hate to do it this way. But for poor folks like us ...

Code:

DECLARE RF_InputRoot REFERENCE TO InputRoot.XML.(XML.Element)[1];
SET CH_RootField = FIELDNAME(RF_InputRoot);
SET IN_ColonPos  = POSITION(':' IN CH_RootField);
SET CH_NameSpace= SUBSTRING(CH_RootField FROM 1 FOR (IN_ColonPos - 1));
DECLARE RF_InputSegment REFERENCE TO InputRoot.XML.(XML.Element)[1].{CH_NameSpace || ':Segment5'};


A very crude way indeed.

Thanx.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Jan 04, 2007 12:43 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

If this is part of a migration from 2.1, you should really force the issue on XMLNS instead of XML.

The XML domain is deprecated as of version 5.
_________________
I am *not* the model of the modern major general.
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 » Using Wildcards in Namespace v5.0
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.