Reputation: 8829
I have a paragraphs of text in the database, f.i.:
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
<b>Proin sed lacus id felis</b> bibendum posuere sed vitae mi.
<square-red> Nullam sit amet erat non tortor laoreet cursus.
I need to provision these as XML web service representation. In this case - 3 paragraphs of text with some well formed tags (as <b>
), and also something that is completetly invalid (<square-red>
without closing tag). Other possibilites include lists and link to images (for links I could use Atom's links element).
The client that receives this XML needs to know about styling (like bold), that there are 3 paragraphs and that some of them have special meeaning, i.e. the whole paragraph have to displayed in red color.
Is there any good format for representing such data in XML? Are there any best practicies for representing rich text?
Upvotes: 0
Views: 865
Reputation: 5413
I believe XSL Formatting Objects or XSL-FO
is designed for this purpose, but I have never seen it used by anyone so support may be limited. A standards-compliant approach would be better than an ad-hoc one in my opinion though, even if the standard is rarely-used.
Upvotes: 1