[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Find/replace algorithm
Thank you Michael. I like the idea of keeping the processing cost constant but I was going to use regular expressions in my map, so I may still have to loop through the lookup structure. From: Michael Kay mike@xxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Sent: Wednesday, March 24, 2021 7:48 PM To: xsl-list <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: Re: Find/replace algorithm My instinct would be (a) build a map containing the replacements (b) for each text node, tokenize the content, then scan the tokens looking each one up in the map. The big advantage of this approach is that the cost is constant regardless how many substitutions there are, whereas most other approaches have a cost that increases linearly with the number of substitutions. Michael Kay Saxonica EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/612310> (by email <> )
|
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
|