Help for a find replace in xml doc

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

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

Help for a find replace in xml doc

Postby ahowardmiller » Fri Aug 03, 2007 11:37 pm

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: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Postby DataMystic Support » Mon Aug 06, 2007 12:58 pm

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>]
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

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

Postby ahowardmiller » Mon Aug 06, 2007 7:24 pm

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: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Postby DataMystic Support » Mon Aug 06, 2007 7:27 pm

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.
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

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

Postby ahowardmiller » Tue Aug 07, 2007 9:53 am

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: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Postby DataMystic Support » Tue Aug 07, 2007 10:19 am

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
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: No registered users and 2 guests