[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: extrem performance break down
I would have expected the first pattern to perform pretty badly, because
of the use of [following::text()], which means that every time you look
at a paragraph you also have to look at all the following text nodes.
But in your new pattern you are looking at all the preceding nodes of all the ancestors, and you are doing this for every element, not only for selected elements like p and ul. You could probably get some improvement by reordering the predicates (the optimum order is some combination of putting the cheapest-to-evaluate predicate first, and putting the most-selective predicate first). However, I would suggest a completely different approach. Whenever you have match patterns that need to search the document like this, it's often best to invert things: start by finding the nodes that match this complex condition and put this node-set in a global variable $special, then replace your pattern with match="*[. intersect $special]" Another point to be aware of with pattern matching in Saxon is that it will always work best if Saxon can determine that the pattern will only match elements of one particular element name. So you might well be better off breaking this into separate patterns that start p[....] ul[....] span[.....] Michael Kay Saxonica On 12/12/2012 08:14, Szabo, Patrick (LNG-VIE) wrote: Hi,
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|