In this chapter, we will use a custom XML schema: email.xsd. This schema is used to model a simple email message:
Root element message contains:
Required from, to elements,
Optional replyTo, cc, bcc elements,
Required subject, body elements,
Optional signature, attachments elements.
A body contains at least one para, literallayout, itemizedlist or orderedlist element (similar to their DocBook counterparts).
A para contains text interspersed with any number of email, ulink, emphasis, inlinegraphic or smiley elements.
An emphasis element has a role attribute with 2 values properly styled by the CSS stylesheet: bold and highlight.
A smiley is an empty element having an emotion attribute with many possible values: happy, wink, vicious, etc.
Using a CSS without custom extensions to style an email message gives good results, but here we want excellent results. And CSS alone cannot solve the following problems:
A message has From:, To:, Subject:, etc, headers. We would like to see the name of these headers displayed in French (De:, À:, Objet:, etc) if the user adds the attribute xml:lang=fr to the root message element.
An emphasis element can contain another emphasis element and this, at any nesting level. We would like emphasis elements having an even number of emphasis ancestors to be displayed using an italic font. We would like emphasis elements having an odd number of emphasis ancestors to be displayed using a plain (non-italic) font.
Like in DocBook, orderedlist elements have a continuation attribute. This attribute has two possible values:
This is the default value of the continuation attribute.
If a message body contains an orderedlist having 2 listitems (therefore numbered 1 and 2), followed by another orderedlist having 2 listitems and if the second orderedlist has continuation=restarts, its listitems are numbered 1 and 2.
If a message body contains an orderedlist having 2 listitems (therefore numbered 1 and 2), followed by another orderedlist having 2 listitems and if the second orderedlist has continuation=continues, its listitems are numbered 3 and 4.
The text of a message can be interspersed with smileys (AKA emoticons) expressing emotions: happy, sad, tired, etc. Not only we would like these smiley elements to be represented graphically (
,
,
, etc) but we also would like to use a combobox embedded in the document view to directly edit the emotion attribute of a smiley element.