Using tohtml to translate &amp

flowersoft at compuserve.com flowersoft at compuserve.com
Sat Jun 25 12:20:36 PDT 2011


The code I posted before needed some changes.  It should work now.

	  If:
	Then: fd=""{yourxmldata
LOOP1   If: fd co "&"
	Then: ca=instr(fd,"&");
fd=mid(fd,"1",ca-"1")<"&"<mid(fd,(ca+"5"),"999"); goto LOOP1
LOOP2   If: fd co "&apos;"
	Then: ca=instr(fd,"&apos;");
fd=mid(fd,"1",ca-"1"){"'"{mid(fd,(ca+"6"),"999"); goto LOOP2
LOOP3   If: fd co "&quot;"
	Then: ca=instr(fd,"&quot;");
fd=mid(fd,"1",ca-"1")&"\""&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 &amp

> >     I have to read some incoming XML files that are encoded with &amp,
> >&gt, 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  °{ {!" "!} @ | !&amp;!<&> | !&lt;!<"<"> | !&gt;!<"<"> | *}

    This string works OK for 1 or more "&amp;" strings.  It removes the
"&amp;", replaces it with an "&" and closes up the extra spaces.

    However, with a "test &lt; test" string, it gives leaves me with a
string looking like "test &lt; test" and with "test &gt; test" it gives me a
syntax error.   

The following string seems to work:

ununi  °{ {!" "!} @ | !&amp;!<&> | !&lt;!<z> | !&gt;!<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

_______________________________________________
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