Storing HTML in table

From: Rob <isanamespace(at)yahoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Storing HTML in table
Date: 2005-11-21 21:47:51
Message-ID: hq2dnTZ-cos83R_enZ2dnUVZ_tednZ2d@speakeasy.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi:

I need to store markup in a database to control how the browser renders the
page information.

I would like complete control over this information -- so if sometime in the
future it's decided to totally redesign the layout. Also, at some point a
tool will be created so novice computer users can enter nicely formatted
markup -- meaning you won't have to know HTML to use this tool.

In it's raw form, data will be stored like this:

<p>some header goes here</p>
<p><img src='foo.gif'></p>
<p>more text here</p>

A few ideas are to:
* Use css
Store the data like: <span class='text_stuff'>text here</span>
<span class='img_stuff'><img src=...></span>

* Store in XML and XSLT

* Don't use HTML -- but something that will parse keys into HTML.
E.G. [:bold] or [:img]

But what happens if you have a single item that's [:bold], <span
class="text-bold"> or etc. and need to take away the bold and change the
font size? It just seem that there is an easy way of doing this that I'm
not thinking of.

Does anyone recommend a certain way for storing HTML in a table?

Thanks,

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bath, David 2005-11-22 00:02:47 Re: idea for a geographically distributed database: how best to implement?
Previous Message Tom Lane 2005-11-21 21:19:28 Re: tid_le comparison for tuple id (ctid) values?