Re: [PHP] Re: heavy parsing of text, storing both versions

2004-02-20 Thread Torsten Schabdach
Hi,

2. [...] I'm going to be storing a LOT of data in the DB.
Why not save both as files? Maybe you find a structure for this,  i.e. 
http://example.org/articles/2004/02/19/text34_v3.html or something 
like this. You save the editfiles and cache the xhtml-output.
  The other problem with the above is that I don't wish to merge the
fields with the template at this point -- I want that to be on-the-fly. 
Of course you can when storing as files. Just keep both on serveral 
branches. The public XHTML-stuff to the URL and your raw material on a 
different branch in your filesystem. To cache the output is just a 
option. You can always do the stuff on-the-fly. Just map the URL in a 
secrue way to the filesystem and the parser.

 I guess simple XML would be an option...
Yep. I did this once for a friend. It was great, because we defined a 
couple of tags to work with. It was so easy for him, I didnt need to 
write some forms. He wrote the stuff right in the editor with all the 
tags in mind. I dont know if this is the same situation here. Maybe I'm 
missing something :)

But: While it was a great thing for him, it was a real pain for me to 
write the parser. As long as the stuff kept simple, than there was no 
problem. But when the output depends on some nesting tags, it will 
become real hell! So this is something that would be better to solve 
with PHP5 and SimpleXML and not with PHP4.

--
Torsten
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: heavy parsing of text, storing both versions

2004-02-19 Thread Torsten Schabdach
Hi Justin,

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/.
The problem is this conversion might take place on 2-3 columns of text, 
and unlimited other fields (my CMS has user-defined data models),
Could you please provide a short example or an URL of your data model?
This would clear things a little bit.
2. [...] I'm going to be storing a LOT of data in the DB.
Why not save both as files? Maybe you find a structure for this,  i.e. 
http://example.org/articles/2004/02/19/text34_v3.html or something like 
this. You save the editfiles and cache the xhtml-output.

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.
Only parse one way. I mean only from your format to XHTML. There is no 
need for converting back (I believe). your people edit the text, after 
that they open up the browser and hitting refresh. So that's when your 
parser comes in play. And with caching only once per document.

--
Torsten
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php