| Author | Message | 
		
		  | kuladeep.dairy | 
			  
				|  Posted: Thu Nov 05, 2009 10:39 am    Post subject: JAVA's evaluateXpath equivalent function in ESQL |   |  | 
		
		  | Apprentice
 
 
 Joined: 11 Jul 2009Posts: 38
 
 
 | 
			  
				| Can you please let me know if we have JAVA's evaluateXpath equivalent function in ESQL? |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | kuladeep.dairy | 
			  
				|  Posted: Thu Nov 05, 2009 1:12 pm    Post subject: Can you please let me know if we have JAVA's evaluateXpath e |   |  | 
		
		  | Apprentice
 
 
 Joined: 11 Jul 2009Posts: 38
 
 
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | smdavies99 | 
			  
				|  Posted: Thu Nov 05, 2009 1:28 pm    Post subject: |   |  | 
		
		  |  Jedi Council
 
 
 Joined: 10 Feb 2003Posts: 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 |  | 
		
		  |  | 
		
		  | kuladeep.dairy | 
			  
				|  Posted: Thu Nov 05, 2009 2:02 pm    Post subject: you could help yourself by telling us where you have looked |   |  | 
		
		  | Apprentice
 
 
 Joined: 11 Jul 2009Posts: 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 |  | 
		
		  |  | 
		
		  | rekarm01 | 
			  
				|  Posted: Thu Nov 05, 2009 2:44 pm    Post subject: Re: JAVA's evaluateXpath equivalent function in ESQL |   |  | 
		
		  | Grand Master
 
 
 Joined: 25 Jun 2008Posts: 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 |  | 
		
		  |  | 
		
		  | mlafleur | 
			  
				|  Posted: Thu Nov 05, 2009 3:20 pm    Post subject: |   |  | 
		
		  | Acolyte
 
 
 Joined: 19 Feb 2004Posts: 73
 
 
 | 
			  
				| You can call the Java method from your ESQL code. |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | rekarm01 | 
			  
				|  Posted: Thu Nov 05, 2009 7:00 pm    Post subject: Re: JAVA's evaluateXpath equivalent function in ESQL |   |  | 
		
		  | Grand Master
 
 
 Joined: 25 Jun 2008Posts: 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 |  | 
		
		  |  | 
		
		  | kuladeep.dairy | 
			  
				|  Posted: Thu Nov 05, 2009 9:04 pm    Post subject: |   |  | 
		
		  | Apprentice
 
 
 Joined: 11 Jul 2009Posts: 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 |  | 
		
		  |  | 
		
		  | kimbert | 
			  
				|  Posted: Fri Nov 06, 2009 1:59 am    Post subject: |   |  | 
		
		  |  Jedi Council
 
 
 Joined: 29 Jul 2003Posts: 5543
 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 |  | 
		
		  |  | 
		
		  | mlafleur | 
			  
				|  Posted: Fri Nov 06, 2009 8:00 am    Post subject: Re: JAVA's evaluateXpath equivalent function in ESQL |   |  | 
		
		  | Acolyte
 
 
 Joined: 19 Feb 2004Posts: 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 |  | 
		
		  |  | 
		
		  | kuladeep.dairy | 
			  
				|  Posted: Fri Nov 06, 2009 10:42 am    Post subject: Can I use jplugin2.jar |   |  | 
		
		  | Apprentice
 
 
 Joined: 11 Jul 2009Posts: 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 |  | 
		
		  |  | 
		
		  | kuladeep.dairy | 
			  
				|  Posted: Fri Nov 06, 2009 10:50 am    Post subject: |   |  | 
		
		  | Apprentice
 
 
 Joined: 11 Jul 2009Posts: 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 |  | 
		
		  |  | 
		
		  | kuladeep.dairy | 
			  
				|  Posted: Fri Nov 06, 2009 2:19 pm    Post subject: My java class is going to look like this |   |  | 
		
		  | Apprentice
 
 
 Joined: 11 Jul 2009Posts: 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 |  | 
		
		  |  | 
		
		  | rekarm01 | 
			  
				|  Posted: Sat Nov 07, 2009 1:42 pm    Post subject: Re: My java class is going to look like this |   |  | 
		
		  | Grand Master
 
 
 Joined: 25 Jun 2008Posts: 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 |  | 
		
		  |  | 
		
		  | kuladeep.dairy | 
			  
				|  Posted: Mon Nov 09, 2009 12:18 pm    Post subject: |   |  | 
		
		  | Apprentice
 
 
 Joined: 11 Jul 2009Posts: 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 |  | 
		
		  |  | 
		
		  |  |