Re: Processing two documents, which order?
I'm having trouble seeing how this description of the problem relates to the code given below.
From first principles, if you do a nested loop then you're doing either 300*33000 operations or 33000*300 - its not a big difference either way. On the other hand if you use keys, then you are basically doing 300+33000 operations either way - but the key will be smaller if you build it on the smaller document, so that's what I would do.
Using regex matching with a dynamically computed regex looks like bad news - or is it really a regex in the source document? Saxon precompiles the regex if it's known statically, but if not there's no caching or anything - it gets compiled on each use. From this viewpoint, using each regex once (in a single analyze-string call) is going to be better.
Michael Kay Saxonica
This is the template to do the work
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