<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1589" name=GENERATOR></HEAD>
<BODY><FONT color=#960000>
<DIV><FONT face=Arial color=#000000 size=2><SPAN class=751293912-17042007>Hey 
all,</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2><SPAN 
class=751293912-17042007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#000000 size=2><SPAN class=751293912-17042007>I'm 
trying to make my rule more efficient but I'm not sure how.&nbsp; I've designed 
my rules based around xml objects.&nbsp; Basically, I have these documents and 
XPath queries are executed against the Object to determine if the rule should be 
executed.&nbsp; The problems is, is that we have over 900 rules that need to be 
executed.&nbsp; The performance isn't really that bad but I would like to Make 
it even better.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2><SPAN 
class=751293912-17042007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#000000 size=2><SPAN class=751293912-17042007>To do 
the job,&nbsp; I have written an XmlUtils class to execute the expression.&nbsp; 
The class first gets the XPathFactory.&nbsp; Then compiles the expression and 
then executes the expression.&nbsp; This happens for every expression, and will 
happen each time the same expression is executed.&nbsp; I want to make the rules 
more efficient by getting the XPathFactory once and&nbsp;compiling the 
expression once and then execute the expression n time on the same compiled 
object.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2><SPAN 
class=751293912-17042007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#000000 size=2><SPAN class=751293912-17042007>I 
would like to know if there is a way I can have the rule object that is 
generated by the package build do the compile of the XPath Expression and then 
use it instead of compiling it every time.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2><SPAN 
class=751293912-17042007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#000000 size=2><SPAN class=751293912-17042007>Here 
is a sample of one of my rule criteria.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial><FONT color=#000000><FONT size=2><SPAN 
class=751293912-17042007>&nbsp;&nbsp;&nbsp; </SPAN>asset: 
AssetDocument()</FONT></FONT></FONT></DIV>
<DIV></FONT><FONT color=#000000><FONT size=2><STRONG><FONT face=Arial><SPAN 
class=751293912-17042007>&nbsp;&nbsp;&nbsp; </SPAN>eval</FONT></STRONG><FONT 
face=Arial>( XmlUtils.evaluatePathBoolean( asset, 
"boolean(//ass:asset/ass:properties/ass:property[@name = 
'Desk']/ass:value/text() = 'column')") 
)</FONT></FONT></FONT></DIV></BODY></HTML>