Re: heavy parsing of text, storing both versions

From: Date: Fri, 20 Feb 2004 01:02:33 +0000
Subject: Re: heavy parsing of text, storing both versions
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-178307@lists.php.net to get a copy of this message
Justin French wrote:
Hi all, I'm building a CMS that does heavy parsing of a "HTML shorthand" plain text to XHTML strict, in a similar way to Textile <http://www.textism.com/tools/textile/>. 1. Parse the text on demand into HTML -- the parsing script is to heavy/slow for this. 2. Store both the plain (shorthand HTML) text and parsed XHTML versions of each field -- the problem with this being that i'm storing double the data in the database... 3. write a reverse set of functions which converts the XHTML back to the shorthand on demand for editing -- this seems great, but I don't like the idea of maintaining two functions for such a beast.
Well, you pretty much listed all of the options. Personally, I'd probably go with #2 because hard drive space is cheap. But... if the process is really that intensive and you're really that concerned about space, then I'd do #3. It doesn't seem like it'd be that hard to maintain as you're just reversing everything and how often do you expect it to change? Sorry I can't offer a better option. :) -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.general (#178307) next »