Using tohtml to translate &
flowersoft at compuserve.com
flowersoft at compuserve.com
Sat Jun 25 11:40:31 PDT 2011
Not with the edit, but why don't you just import the field as it is into
filePro and then remove the "&" or "'" or """ using instr and
mid statements?
I haven't tested the code below but it (or something similar) should work.
If:
Then: fd=""{yourxmldata
LOOP1 If: fd co "&"
Then: ca=instr(fd,"&");
fd=mid(fd,"1",ca)<"&"<mid(fd,(ca+"5"),"999"; goto LOOP1
LOOP2 If: fd co "'"
Then: ca=instr(fd,"'");
fd=mid(fd,"1",ca){"'"{mid(fd,(ca+"6"),"999"; goto LOOP2
LOOP3 If: fd co """
Then: ca=instr(fd,""");
fd=mid(fd,"1",ca){"\""<mid(fd,(ca+"6"),"999"; goto LOOP3
-----Original Message-----
From: filepro-list-bounces+flowersoft=compuserve.com at lists.celestial.com
[mailto:filepro-list-bounces+flowersoft=compuserve.com at lists.celestial.com]
On Behalf Of Mike Schwartz
Sent: Friday, June 24, 2011 5:09 PM
To: 'filePro'
Subject: RE: Using tohtml to translate &
> > I have to read some incoming XML files that are encoded with &,
> >>, etcetera. filePro 5.0.14 doesn't have a "FROMHTML()" function
> available.
Ok, I *ALMOST* have the following edit working to un-unicode a field.
I just have a problem with how to quote the < and > character:
ununi °{ {!" "!} @ | !&!<&> | !<!<"<"> | !>!<"<"> | *}
This string works OK for 1 or more "&" strings. It removes the
"&", replaces it with an "&" and closes up the extra spaces.
However, with a "test < test" string, it gives leaves me with a
string looking like "test < test" and with "test > test" it gives me a
syntax error.
The following string seems to work:
ununi °{ {!" "!} @ | !&!<&> | !<!<z> | !>!<q> | *}
any suggestions?
Thanks!
Mike Schwartz
_______________________________________________
Filepro-list mailing list
Filepro-list at lists.celestial.com
Subscribe/Unsubscribe/Subscription Changes
http://mailman.celestial.com/mailman/listinfo/filepro-list
More information about the Filepro-list
mailing list