pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedStoring HTML in table
2+ messages / 2 participants
[nested] [flat]
* Storing HTML in table
@ 2005-11-21 21:47 Rob <isanamespace@yahoo.com>
2005-11-27 20:33 ` Re: Storing HTML in table Greg Stark <gsstark@mit.edu>
0 siblings, 1 reply; 2+ messages in thread
From: Rob @ 2005-11-21 21:47 UTC (permalink / raw)
To: 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,
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Storing HTML in table
2005-11-21 21:47 Storing HTML in table Rob <isanamespace@yahoo.com>
@ 2005-11-27 20:33 ` Greg Stark <gsstark@mit.edu>
0 siblings, 0 replies; 2+ messages in thread
From: Greg Stark @ 2005-11-27 20:33 UTC (permalink / raw)
To: Rob <isanamespace@yahoo.com>; +Cc: pgsql-sql
Rob <isanamespace@yahoo.com> writes:
> 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.
You should go look at some of the XML database books out there and maybe
you'll find a tool to do what you want. But beware, there's a lot of snake-oil
in this field. Anyone who promises a one-size-fits-all solution to every
problem is probably deluded.
The problem is hard. There's an inherent tension between being able to easily
manipulate parts of the data and flexibility in the type of data you can
represent. One one side is the traditional relational database model where
every record must contain precisely the same fixed list of predetermined
columns. One the other side is the decidely non-relational model where you
just store a large hunk of xml text.
What you're looking for is one of the many systems that attempt to bridge
these two extremes and provide the best of both worlds.
--
greg
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-11-27 20:33 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-11-21 21:47 Storing HTML in table Rob <isanamespace@yahoo.com>
2005-11-27 20:33 ` Greg Stark <gsstark@mit.edu>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox