Easy, readable and fast text based format for Rev?

David Bovill david at openpartnership.net
Tue Jun 12 11:56:00 EDT 2007


On 12/06/07, Jim Ault <JimAultWins at yahoo.com> wrote:
>
> The Rev filter command is very fast and I would recommend considering it.
> The one caution is to replace null with empty, if this is a possible
> character.


That would only be in binary data? Databases? When would you get null values
- certainly nothing from within Rev I think? Not in XML?

In my case, some of the content text can have "<" or "/" or ">" in the body,
> so I avoid those.  You seem to have control of your content, so it will
> not
> be problem for you.


Same with me -  content comes mainly from within a Rev application, or
carefully picked external files, I am thinking of base64 encoding everything
else - though I have to figure on whether to use urlEncoding (forgotten the
issues). I am trying to figure which sort of text / xml files I will need to
encode - maybe any XML files with CDATA sections....

Arrays are very fast and can remove duplicates.
> Also think of compound keys for the arrays, which I use for
> forward+reverse
> lookups in the same array.
>
> Moving data around, consider built-in
> compress(var)
> decomprerss(var)


Yes. So if there is a 3 part strategy:

   1. Safe one line stuff without funny chars = > create "name [tab]
   value" line
   2. htmltext and some other types of "xml" ish data without tabs -
   strip out CR and do as above
   3. Anything else base64 encode (or should that be urlEncode)

I am not clear yet on the details of XML without CDATA - with regard to
non-existence of tabs and CR in content? Are they always escaped - if so
then stripping out CR and maybe tab as well to make one line works.



More information about the use-livecode mailing list