<!DOCTYPE slides [
  <!ELEMENT slides - - (slide)*>
  <!ELEMENT slide  - - (title,body?)>
  <!ATTLIST slide  type CDATA #REQUIRED>
  <!ELEMENT title  - - (#PCDATA)> 
  <!ELEMENT body   - - (item|code|table)*>
  <!ELEMENT item   - - (#PCDATA|b|i)*>
  <!ELEMENT code   - - (#PCDATA)>
  <!ELEMENT table  - - (tr)*>
  <!ELEMENT tr     - - (td)*>
  <!ELEMENT td     - - (#PCDATA|b)*>
  <!ELEMENT b      - - (#PCDATA)*>
  <!ELEMENT i      - - (#PCDATA)*>
  <!ENTITY lt "&#60;"> 
  <!ENTITY gt "&#62;">
  <!ENTITY amp "&#38;">
]>

<slides>

<slide type="title">
    <title>DSSSL</title>
</slide>


<slide type="normal">
    <title>DSSSL</title>
    <body>
        <item>Document Style Semantics and Specification Language</item>
        <item>Used to Specify style sheets for SGML documents</item>
    </body>
</slide>

<slide type="normal">
    <title>Why use DSSSL?</title>
    <body>
        <item>SGML is machine readable</item>
        <item>SGML is not very human readable</item>
        <item>DSSSL serves to convert data in SGML into more readable form</item>
        <item>Some format it can convert to are RTF, HTML, Latex</item>
    </body>
</slide>

<slide type="normal">
    <title>Major Components of DSSSL</title>
    <body>
        <item>Style Language</item>
        <item>Flow Object</item>
        <item>Transformational Language</item>
        <item>Document Model</item>
        <item>Query Language</item>
    </body>
</slide>


<slide type="normal">
    <title>Style Language</title>
    <body>
        <item>Describes the formatting of SGML (XML) documents</item>
        <item>Based heavily on Scheme (both syntax and functionality)</item>
        <item>A "grove" is constructed from the SGML document which is
              formatted into a flow object by style rules.</item>
        <item>A processor then converts the tree to a document</item>
    </body>
</slide>

<slide type="normal">
    <title>Style Language Examples</title>
    <body>
        <code>
(element p 
    (make paragraph font-size: 12pt))

(element (ul li)
    (make paragraph ...))

(element empty
    (empty-sosofo))

(define four (+ 2 2))
        </code>
    </body>
</slide>

<slide type="normal">
    <title>Flow Objects</title>
    <body>
        <item>Provide a mechanism for describing the layout of a document</item>
        <item>Pages, paragraphs, tables, image, etc</item>
        <item>Formatting specifications are contained within the
              construction rules</item>
        <code>
(make paragraph
    font-size: 12pt
    font-family-name: "Arial"
    ....)
(make sequence
    font-posture: 'italic
    ...)
       </code>
   </body>
</slide>

<slide type="normal">
    <title>Transformation Language</title>
    <body>
        <item>Superset of the Expression language</item>
        <item>Used to transform one SGML document to another</item>
        <item>Allows for the creation and manipulation of document nodes</item>
        <item>Not widely used (and Jade doesn't even implement it)</item>
    </body>
</slide>

<slide type="normal">
    <title>Document Model</title>
    <body>
        <item>The Tree that gets generated from an SGML document</item>
        <item>The entire tree is known as a "grove" in the DSSSL world</item>
        <item>Elements, attributes, etc are nodes in the tree</item>
    </body>
</slide>

<slide type="normal">
    <title>Query Language</title>
    <body>
        <item>Used to select individual nodes from the grove</item>
        <item>Functions to access attributes, children, ancestors, etc</item>
        <item>Functions to retrieve a nodes position in the tree</item>
    </body>
</slide>

<slide type="normal">
    <title>DSSSL vs XSL</title>
    <body>
        <table>
            <tr><td><b>DSSSL</b></td><td><b>XSL</b></td></tr>
            <tr><td>Style Language</td><td>XSLT</td></tr>
            <tr><td>Flow Object</td><td>XSL-FO</td></tr>
            <tr><td>Transformation Language</td><td>XSLT</td></tr>
            <tr><td>Document Model</td><td>XML Information Set</td></tr>
            <tr><td>Query Language</td><td>XPath</td></tr>
        </table>
    </body>
</slide>

<slide type="normal">
    <title>Construction Rules</title>
    <body>
        <item>DSSSL Documents consist mostly of construction rules</item>
        <item>Map elements in the source document to DSSSL flow objects</item>
        <item>Example: the para tag creates a new paragraph with a 12pt font</item>
        <code>
(element para
    (make paragraph
        font-size: 12pt))
        </code>
    </body>
</slide>

<slide type="normal">
    <title>Process Children</title>
    <body>
        <item>(process-children) returns the tree that results from 
              processing the children of a node</item>
        <item>The results are all linked to the root node</item>
        <item>Similar to "apply-templates" in XSLT</item>
    </body>
</slide>

<slide type="normal">
    <title>Controlling Recursion</title>
    <body>
        <item>Make a new paragraph containing the processed children</item>
        <code>(element para (make paragraph))</code>
        <item>Make a paragraph containing "foo" and ignores para's children</item>
        <code>(element para (make paragraph (literal "foo")))</code>
        <item>Make a paragraph containing the contents of the first title tag under the para</item>
        <code>
(element para 
    (make paragraph 
        (process-first-descendent "title")))
        </code>
    </body>
</slide>

<slide type="normal">
    <title>Modes</title>
    <body>
        <item>Often you want different rules to apply to the same element depending on the context</item>
        <item>Table of contents for example</item>
        <item>Modes allow the specification of construction rules that only sometimes apply</item>
        <code>
(mode toc
    (element chapter ...)
    (element section ...)
    (element para (empty-sosofo)))
(element book
    (make sequence
        (with-mode toc (process-children))
        (process-children)))
        </code>
    </body>
</slide>

<slide type="normal">
    <title>Example: HTML Subset</title>
    <body>
        <code>
(element html (make simple-page-sequence))

(element h1
    (make-paragraph
        font-weight: 'bold
        font-size: 20pt
        space-after: 10pt
        quadding: 'center))

(element p
    (make-paragraph
        font-size: 12pt
        quadding: 'start))

(element i
    (make sequence
        font-posture: 'italic))
        </code>
    </body>
</slide>

<slide type="normal">
    <title>Example: This presentation</title>
    <body>
        <item>This presentation is generated from an XML document by DSSSL</item>
        <item>This slide looks something like</item>
        <code>
&lt;slide type="normal"&gt;
  &lt;title&gt;Example: This presentation&lt;/title&gt;
  &lt;body&gt;
    &lt;item&gt;This presentation is generated from 
          an XML document by DSSSL&lt;/item&gt;
    &lt;item&gt;This slide looks something like&lt;/item&gt;
    &lt;code&gt;
&amp;lt;slide type="normal"&amp;gt; ...
    &lt;/code&gt;
  &lt;/body&gt;
&lt;/slide&gt;
        </code>
    </body>
</slide>

<slide type="title">
    <title>Questions?</title>
</slide>
        
</slides>
