I need to change a string in a file, substituting a different value for the 0.0 in ‘VERSION="0.0&quot’. If I use Text Replace and match as a regular expression, this string matches: ‘VERSION=\"0.0\"’. But if I save my project and restart FinalBuilder, the pattern has been changed to
‘VERSION=\"0.0\"’, which doesn’t match. This appears to be due to the xml format of the save file, causing the " to be replaced with a " when the xml is read from the file.
Any ideas on how I can get this to work across saves & loads?
Thanks,
Keith Hearn
Devicescape, Inc.
Adding a little more data to my original post. When I first set up the search/replace and save, here is the xml from the .fbp5 file for the search and replace strings:
VERSION="%VERSION%&quot
VERSION=\"0.0\&quot
And after I exit and restart Finalbuilder, I see that the patterns have changed. I then save again and look at the .fbp5 file and they are:
VERSION="%VERSION%&quot
VERSION=\"0.0\&quot
So " seems to get replaced by " when the xml file is read.
Keith
Hmmm, some of the lines I was copying from the .fbp5 files in my previous posts got eliminated when I posted (but it was there when I looked at a preview).
It looks like the forum stripped out the Property tags and end tags in my post, but not when I previewed it.
I’ll try again with backslashes in front of the open angle brackets and see if that works.
The originals lines were:
<property multivalue=“0” name=“ReplaceText” type=“string”>VERSION=&amp;amp;quot;%VERSION%&amp;amp;quot</property>
<property multivalue=“0” name=“SearchText” type=“string”>VERSION=\&amp;quot;0.0\&amp;quot</property>
The lines after a read and save were:
<property multivalue=“0” name=“ReplaceText” type=“string”>VERSION="%VERSION%&amp;amp;quot</property>
<property multivalue=“0” name=“SearchText” type=“string”>VERSION=\"0.0\&amp;quot</property>
Nope, that didn’t work either. I’m going to replace the angle brackets with parens. Hopefully that will not get messed up. This would be easier if the preview showed what the actual post ends up showing.
After first save:
(Property MultiValue=“0” name=“ReplaceText” type=“string”)VERSION=&amp;amp;quot;%VERSION%&amp;amp;quot(/Property)
(Property MultiValue=“0” name=“SearchText” type=“string”)VERSION=\&amp;quot;0.0\&amp;quot(/Property)
Aftrer a read and re-save:
(Property MultiValue=“0” name=“ReplaceText” type=“string”)VERSION="%VERSION%&amp;amp;quot(/Property)
(Property MultiValue=“0” name=“SearchText” type=“string”)VERSION=\"0.0\&amp;quot(/Property)
“This time fer sure!” – Bullwinkle Moose
If your action parameters are getting mangled, one solution may be to use variables to store part of the value. I can’t work out from your above posts what you actually want to store (sorry!) but for example, I had a problem where the trailing space in a field was getting lost. The solution was to create a variable called %Space%, which contained a single character, then make the value of the field “Somevalue%space%”. You may be able to do something similar by storing an ampersand in a variable or something.
Steve
Keith - looks like a bug in the escaping code for xml… can you please email us the string you are trying to save… that way we can be sure it doesn’t get mangled by the forum software (send to support [at] finalbuilder dot com) thanks.
.t8
fixed! new build is:
https://www.finalbuilder.com/downloads/finalbuilder/500/FB500_128.exe