Skip to main content
Inspiring
May 30, 2012
Question

ruleProcessors - does anyone still use them?

  • May 30, 2012
  • 2 replies
  • 1319 views

I used to use the rule processors until I found out about evaluateXPathExpression do be so much easier to use an have never looked back. Is there anyone out there still using rule processors? If so, why?

This topic has been closed for replies.

2 replies

Legend
May 30, 2012

With an early CS4 we found that evaluateXPathExpression() was actually faster, but had a memory leak causing erratic InDesign Server crashes. Since then we've stuck to XML rules.

Recently I retried evaluateXPathExpression for those assumed performance gains but could not reproduce the effect, it was roughly the same. Therefor we still stick to XML rules, but will revisit the topic again soon with more exhaustive tests.

Btw, we use XML rules with single XPath and collect the results into an array. Originally XML rules were meant for incremental processing. If I remember that correctly they also allow for optimizations such as "skip the children here" - never used that.

With the mentioned short comparison test I could neither reproduce the memory leaks, maybe they're gone.

On the other hand there are plenty ways to reduce use of XPaths at all, by navigating the tree on your own, removing wildcard "/*/" and depth  "//" searches that were chosen just for laziness of typing and so forth. Just today I eliminated most parts of one XPath and reduced local execution time by 60 percent.

For completeness sake you should also consider the ExtendScript XML subsystem with its .xpath() function, it has some advantages if your XML does not exceed a certain size.

Dirk

Harbs.
Legend
May 30, 2012

Dirk Becker wrote:

For completeness sake...

My guess is that ActionScript XML processing would be the best performant-wise...

Legend
May 30, 2012

I still have to see ActionScript executing on an InDesign Server.

On the other hand we should also mention XSL.

Dirk

Inspiring
May 30, 2012

I use them, purely for performance reasons.  If I remember right, they're at least twice as fast (half as slow?) as evaluateXPathExpression().

Jeff