[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

text replacement with mixed content

Subject: text replacement with mixed content
From: Geert Bormans <geert@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 30 Aug 2011 21:35:40 +0200
 text replacement with mixed content
Hi all,

thanks for reading this.

I have an interesting task.

All through a document I need to replace each occurrence of "my foo" with "<replaced>your bar</replaced>"
But the texts contain mixed content tags, so I might as well find "my <bold>foo</bold>" that needs to become "<replaced>your bar</replaced>" as well


Note that the I need to keep the tags balanced, so I must not end up with "<replaced>your bar</replaced></bold>" in the later case

I have some algorithms in mind, but I am not happy with any of them.
So I thought I might as well ask here, hoping one of you can come up with something really elegant


the replacement tags are pulled out of another document,
so as a bonus, the text to be replaced could be "my.foo", requiring me likely to build correct regexes automatically


so, thanks in advance for your help

Geert

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.