Thread: Data Design question: Storing formated documents

Data Design question: Storing formated documents

From
"Dr. Evil"
Date:
I have a complicated question: I am trying to design a database which
will allow users to store, edit, and display WAP pages.  It's a
similar problem to storing, say, HTML or word processing documents.
You have a document which is like a graph.  In the case of WAP it
would look be a hierarchy like this:

Deck
    Card 1
         Text element
         Graphic
         Link element
         Text element
    Card 2
         Graphic element

etc...

Users will be able to construct and edit these pages, which should be
store in the DB.

I could have a datatype like this:

create table ... (
       Deck TEXT,
...)

and then just include a bunch of WAP in the text field, but it seems
that it might be better to store everything parsed out into elements,
instead of trying to parse the text each time it needs to be edited.

What are your thoughts on the right approach to this?

Thanks