Page 1 of 1
Help for a find replace in xml doc
Posted: Fri Aug 03, 2007 11:37 pm
by ahowardmiller
I'm new to TextPipe and I was wondering if someone here could tell me how to do the following find and replace in my xml docs?
The code is as follows:
Code: Select all
<AutoSelect>True</AutoSelect>
<BackColor>InactiveCaption</BackColor>
What I need to do is change text inside backcolor to something else. It is different in each xml doc. Also the backcolor tag is used with other tags to describe their function. However, I only want to change inside the backcolor tag that follows the autoselect tag. All the rest of the backcolor tags have something different proceeding them other them the autoselect tag.
I hope I was clear enough for you all. If you need more info, please let me know. Thanks in advance for the help.
Posted: Mon Aug 06, 2007 12:58 pm
by DataMystic Support
Hi Howard,
Use a Restrict to HTML tag,
Restrict to between tags <AutoSelect>...</AutoSelect>
[ ] Include text
[ ] Match case
and inside this, another restrict to HTML tag for BackColor. Inside this, use a search/replace. The whole lot looks like this:
Restrict to between tags <AutoSelect>...</AutoSelect>
|
+--Restrict to tag <BackColor>...</BackColor>
|
+--EasyPattern [[ longest 0+ chars ]] with [<new value>]
Posted: Mon Aug 06, 2007 7:24 pm
by ahowardmiller
Thanks for the info. As I'm new to your product, could you possible give me a step by step on how to do it. I'm using 7.9.4. I've tried to put it in the way you gave me and I keep getting error messages or the software doesn't find what I want it to find. I know this program can do the changes. I just need to figure out how to use it. Thanks for your help.
Take care,
Aaron D. Howard-Miller
Posted: Mon Aug 06, 2007 7:27 pm
by DataMystic Support
Double click
1. Filters\Restrict\HTML or XML element or attribute
2. Filters\Restrict\HTML or XML element or attribute
3. Filters\Replace\Find EasyPattern
Then drag 2 inside 1, and 3 inside 2.
Then use the settings below. Drop us an email and we can send you the complete filter.
Posted: Tue Aug 07, 2007 9:53 am
by ahowardmiller
Thanks for all the help. My email is
aaron@jahmdesigns.com. I did the filter like you said in the last two posts and it ran this time, but it didn't replace anything. So I must be doing something wrong. I'll probably be able to see what I did wrong when you send me the filter. Once again thank you for all your help.
Take care,
Aaron
Posted: Tue Aug 07, 2007 10:19 am
by DataMystic Support
Sorry, I misread your earlier message, the filter should look like this:
EasyPattern [</AutoSelect>[ 0+ whitespace ]<BackColor>[ 0+ not '<' ]</BackColor>] with [$0]
|
+--Restrict to between tags <BackColor>...</BackColor>
|
+--EasyPattern [[ longest 0+ chars ]] with [new text here]
An email is on its way