NUN.ME.SHU logo
NUN.ME.SHU banner
XML/XSL/CSS architecture
Switch to printer friendly page layoutView XML source of this pageNun.Me.Shu - presentation

Presentation concepts of the Nun.Me.Shu architecture.



Transformation and Styling
The translation of XML-content into "a webpage" in general has two aspects: transformation and styling.
Elements like a paragraph, an introduction, or a quote have the same transformation; their text content simply has to be copied from the input (XML) to the output (HTML). But they might have to be styled differently. Maybe you'd like a quote to be displayed in italics, and an introduction in a box with a 1 pixel wide border. Since transformation is the same, from the standpoint of simplifying the XSL stylesheet, it is best if these content types are represented with the same XML element. Since they all are some kind of paragraph, let's call these <para>. To enable different styling options we add an attribute that identifies the role of the text content.
    a quote: <para role="quote">this is some quote</para>
    an intro: <para role="intro">this is some introductory text</para>

The XSL stylesheet template for the transformation of any type of paragraph then can be as simple as
    <xsl:template match="para">
       <div class="{@role}">
          <xsl:apply-templates/>
       </div>
    </xsl:template>

In addition, the styling of each type of paragraph is defined in a Cascading StyleSheet (CSS) file, for instance as:
    .quote {
          color: #553344;
          font-style: italic }
    .intro {
          font-size: 110%;
          text-align:center;
          padding:4px;
          border:1px solid #CCAAAA}

Note that the role attribute value for a <para> element in the source XML file is used by the XSL template as value for the class attribute of an HTML <div> element, and that this class attribute value corresponds with a style name in the CSS file.


In the Nun.Me.Shu architecture there are two ways of marking a "block of text":
    <para> - stand-alone block of text, represented in HTML by <div>
    <emphasis> - inline block of text, represented in HTML by <span>
both have role attributes (options are predefined in dtd) to indicate the role the block of text plays.
To reduce the amount of typing a content editor has to do, there are some abbreviations for certain roles of <para> and <emphasis>. For instance:
    <para role="title"> can be abbreviated to <title>
    <emphasis role="bold"> can be abbreviated to <b>
    <emphasis role="italics"> can be abbreviated to <i>