Help for a find replace in xml doc

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
ahowardmiller
Posts: 3
Joined: Fri Aug 03, 2007 11:21 pm

Help for a find replace in xml doc

Post 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.
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Post 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>]
ahowardmiller
Posts: 3
Joined: Fri Aug 03, 2007 11:21 pm

Post 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
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Post 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.
ahowardmiller
Posts: 3
Joined: Fri Aug 03, 2007 11:21 pm

Post 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
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Post 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 :D
Post Reply