Help to design a text processing application added by arthurmaciel on Fri May 10 23:47:38 2013

I intend to develop an web app that allows word and sentence mark up in a plain text (probably HTML text will be handled in the future). The user should paste a text and be able to click on a word to markup it as a 'value'. It should be possible to describe the type of this value (among 5 options: aesthetic, ethic, epistemic, ontological, pragmatic) and attach comments. Values could also be a sequence of words (or sentences and even the whole text). 
After marking up values (words or a set of them), they should be highlighted on the text, with colors differing according to their type.
After editing the document, it should be possible to export it on many formats (XML, SXML, txt and even PDF). This file (in XML or SXML format) could be uploaded to the application by another person to continue editing it on another computer. Collaborative online editing would also be possible.

I'm in doubt about how to represent the text and its markup (text inserted into a relational database, use of alists, SXML?) and I would appreciate suggestions.

An example would be: 

Original text: "We need to produce better apples and make the delivery faster"
Values: 
1) content: "better"
   type: aesthetic, pragmatic, ethic 
   comment: the apples could be more beautiful or tasteful or bigger or organic. "Better" could be from the perspective of the consumer (in terms of his/her own satisfaction and health) and/or of the producer (in terms of a better selling product). Needs of the producer and of the consumer does not necessarily match.

2) content: "faster"
   type: pragmatic, aesthetic, ethic
   comment: the delivery should be a simple and clever process, rendering it an aesthetic status from the point of view of logistic process. It could generate more profit to the producer, being an economic value and thus pragmatic. Or it could be an ethical compromise between the producer and the consumer.