Using tohtml to translate &
Mike Schwartz
mschw at athenet.net
Tue Jun 28 12:08:21 PDT 2011
> -----Original Message-----
> From: Kenneth Brody [mailto:kenbrody at spamcop.net]
>
> On 6/24/2011 5:09 PM, Mike Schwartz wrote:
> >>> 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?
>
> You appear to have hit an "undocumented restriction" :-) in filePro,
regarding
> the apparent-but-not-really nesting of punctuation such as "<"
> within an edit. (ie: you have a quoted "<" within the "<...>" item.)
>
> If that "undocumented restriction" :-) were eliminated, the following
would
> work:
>
> unhtml { @ | (!"&"!unhtml2!";"!) | * }
> unhtml2 !amp!<"&"> | !eq!<"="> | !lt!<"<"> | !gt!<">">
>
> Note, too, that your construct:
>
> {!" "!} @
>
> is redundant, as the "@" will eat all trailing spaces.
>
> --
> Kenneth Brody
OK. The "undocumented restriction" must have crept in since filePro
3.0, since page 12-13, number 3 under "Rules for Defining Edits" says that
will work.
Just put it down on the bottom of the "wishlist" (if that still
exists), since this isn't causing me a major problem.
Thanks!
Mike Schwartz
More information about the Filepro-list
mailing list