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 » JAVA's evaluateXpath equivalent function in ESQL

Post new topic  Reply to topic Goto page 1, 2  Next
 JAVA's evaluateXpath equivalent function in ESQL « View previous topic :: View next topic » 
Author Message
kuladeep.dairy
PostPosted: Thu Nov 05, 2009 10:39 am    Post subject: JAVA's evaluateXpath equivalent function in ESQL Reply with quote

Apprentice

Joined: 11 Jul 2009
Posts: 38

Can you please let me know if we have JAVA's evaluateXpath equivalent function in ESQL?
Back to top
View user's profile Send private message
kuladeep.dairy
PostPosted: Thu Nov 05, 2009 1:12 pm    Post subject: Can you please let me know if we have JAVA's evaluateXpath e Reply with quote

Apprentice

Joined: 11 Jul 2009
Posts: 38

Appreciate your help..
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Nov 05, 2009 1:28 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

A saying that was commonly used in a '70's TV series

Patience Grasshopper

If someone reading this forum knows an answer I'm sure they'll post it.
you could help yourself by telling us where you have looked for the answer
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
kuladeep.dairy
PostPosted: Thu Nov 05, 2009 2:02 pm    Post subject: you could help yourself by telling us where you have looked Reply with quote

Apprentice

Joined: 11 Jul 2009
Posts: 38

Davis,
am sorry.

I checked in the infocenter. I do not see any equivalent function in ESQL. 6 months ago I developed a message flow usig ESQL. I had to write a ESQL function to evaluate XPATH. it breaks the XPATH ,say /A/B/C, into tokens A, B and C, and references them one by one to get the value.

that interface had to handle very simple xpaths like that.But now for my new interface, I am looking for a standard ESQL function to evaluate XPTAHs.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Thu Nov 05, 2009 2:44 pm    Post subject: Re: JAVA's evaluateXpath equivalent function in ESQL Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

ESQL does not support XPath directly, but the ESQL SELECT and THE functions can offer similar functionality.

Some of the properties for built-in nodes support XPath. Consult the Info Center for more details.
Back to top
View user's profile Send private message
mlafleur
PostPosted: Thu Nov 05, 2009 3:20 pm    Post subject: Reply with quote

Acolyte

Joined: 19 Feb 2004
Posts: 73

You can call the Java method from your ESQL code.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Thu Nov 05, 2009 7:00 pm    Post subject: Re: JAVA's evaluateXpath equivalent function in ESQL Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

mlafleur wrote:
You can call the Java method from your ESQL code.

No. Message flows can only call static Java methods from ESQL.
Back to top
View user's profile Send private message
kuladeep.dairy
PostPosted: Thu Nov 05, 2009 9:04 pm    Post subject: Reply with quote

Apprentice

Joined: 11 Jul 2009
Posts: 38

Iwill have to handle about 100 XPATHs in my code. In that case i will have to call this static java function for 100 times. I dont know if it impacts the performance!

One basic question, i went thru JAVA 1.4.2(our Broker is running on this version of JAVA) API documentation to see if any class provides a function similar to evaluateXpath. I couldnt find any.
any insights on this would be helpful. Many thanks.


Last edited by kuladeep.dairy on Fri Nov 06, 2009 10:48 am; edited 1 time in total
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Nov 06, 2009 1:59 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I think your options are:
a) stay with ESQL, and learn to use the SELECT statement.
b) switch to Java, and use evaluateXPath
Back to top
View user's profile Send private message
mlafleur
PostPosted: Fri Nov 06, 2009 8:00 am    Post subject: Re: JAVA's evaluateXpath equivalent function in ESQL Reply with quote

Acolyte

Joined: 19 Feb 2004
Posts: 73

rekarm01 wrote:
mlafleur wrote:
You can call the Java method from your ESQL code.

No. Message flows can only call static Java methods from ESQL.


So he can create a class with a static method with an MbElement argument (reference in ESQL). Then he can call the MbElement.evaluateXPath method in that static method. This is a possible solution for using the evaluateXPath functionality via ESQL. Or he could use some other XPath java library to return what he needs.
Back to top
View user's profile Send private message
kuladeep.dairy
PostPosted: Fri Nov 06, 2009 10:42 am    Post subject: Can I use jplugin2.jar Reply with quote

Apprentice

Joined: 11 Jul 2009
Posts: 38

Thank you for your response.

A sample XPATH that i will have to handle is as shown below. I was wondering how it is possible to use ESQL SELECT in this case.

boolean((/ABC/Policy/Pa/PersonalAutoNamedNonOwnerCov/PersonalAutoNamedNonOwnerCovLiabilityCoverage/CoverageOnPolicyIndicator = 10) and (/ABC/Policy/Pa/PersonalAutoNamedNonOwnerCov/PersonalAutoNamedNonOwnerCovLiabilityCoverage/CoverageType = 'SL'))

As suggested i am planning to use the jar below and write a static java method that can be invoked from ESQL. please let me know your insights.

C:\IBM\MessageBrokersToolkit\6.0\ibtoolkit\eclipse\plugins\com.ibm.etools.mft.jcn_6.0.2\jplugin2.jar


Last edited by kuladeep.dairy on Fri Nov 06, 2009 10:51 am; edited 1 time in total
Back to top
View user's profile Send private message
kuladeep.dairy
PostPosted: Fri Nov 06, 2009 10:50 am    Post subject: Reply with quote

Apprentice

Joined: 11 Jul 2009
Posts: 38

My java class is going to look like this:

import com.ibm.broker.plugin.MbElement;
public class Test {
public Test()
{

}
public static String ESQLEvaluateXpath(MbElement t, String xp)
{

}

}
Back to top
View user's profile Send private message
kuladeep.dairy
PostPosted: Fri Nov 06, 2009 2:19 pm    Post subject: My java class is going to look like this Reply with quote

Apprentice

Joined: 11 Jul 2009
Posts: 38

It is working. Thank you for your support.
Please let me know if there is any performance impact because of this kind of calls.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Sat Nov 07, 2009 1:42 pm    Post subject: Re: My java class is going to look like this Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

kuladeep.dairy wrote:
Please let me know if there is any performance impact because of this kind of calls.

Wouldn't you be in a better position to let us know if there is a performance impact?
Back to top
View user's profile Send private message
kuladeep.dairy
PostPosted: Mon Nov 09, 2009 12:18 pm    Post subject: Reply with quote

Apprentice

Joined: 11 Jul 2009
Posts: 38

I tested.using this funcation i could make 2500 evaluateXPATH calls in about 800 milli seconds. The input XML message had about 5000 elements.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » JAVA's evaluateXpath equivalent function in ESQL
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.