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 » Accessing Pipe Delimiter inside XML Message

Post new topic  Reply to topic
 Accessing Pipe Delimiter inside XML Message « View previous topic :: View next topic » 
Author Message
Kumar4
PostPosted: Wed Sep 19, 2007 10:07 am    Post subject: Accessing Pipe Delimiter inside XML Message Reply with quote

Apprentice

Joined: 12 Aug 2007
Posts: 27

Hi Folks,

I have a incoming message where the value of the field is something like

<XML FIELD> VALUE1 | VALUE2 | ID1| ID2 </XML FIELD>

Can some one guide me on accessing the ID2 Value from the message(XML FIELD) inside message broker using ESQL.I'm using XMLNS parser to parse the Input Message.

Thanks In Advance
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Sep 19, 2007 10:20 am    Post subject: Reply with quote

Grand High Poobah

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

Why do you have delimited values inside an XML element?

If you're using XMLNS you'll need to hand crank some code. AFAIK there's no ESQL equivalent of strtok (or likewise).
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Wed Sep 19, 2007 10:26 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi Kumar4,

Use SUBSTRING function with (POSITION and REPEAT).

Look up the ESQL doc for the syntax.

Regards.
Back to top
View user's profile Send private message Send e-mail
Kumar4
PostPosted: Wed Sep 19, 2007 10:37 am    Post subject: Reply with quote

Apprentice

Joined: 12 Aug 2007
Posts: 27

Thanks for the reply,

BUt how can you determine the position of the Value, The value will be at the last pipe delimitter, The position might be changing if any of values before to this changes. and also the value might be of different lenght.

I think this can work of any function which can read the pipe delmitters, so that it can access the 3 rd pipe delimitter value.

Thanks again
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Wed Sep 19, 2007 10:41 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi Kumar4,

Position of pipe = POSITION("|" IN xmlField REPEAT 3);

Starting position of ID2 = position of pipe + 1;

So, ID2 = SUBSTRING(xmlField FROM Starting position of ID2);

Now, convert the above into 1 line of code

Regards.
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Wed Sep 19, 2007 10:43 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

String manipulation in ESQL works just like string manipulation in any other programming language.

If you really felt like it, you could define a TDS message definition to parse the contents of this field, and then use CREATE FIELD... PARSE to get a logical tree.
_________________
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 » Accessing Pipe Delimiter inside XML Message
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.