Using tohtml to translate &amp

Mike Schwartz mschw at athenet.net
Fri Jun 24 14:09:24 PDT 2011


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




More information about the Filepro-list mailing list