<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet title="Full view" href="presentation_print.css" type="text/css" ?>
<?oxygen RNGSchema="presentation.rng" type="xml"?>

<TEI xmlns="http://www.tei-c.org/ns/1.0"
    xmlns:ev="http://www.w3.org/2001/xml-events"
    xmlns:xh="http://www.w3.org/1999/xhtml"
    xmlns:xlink="http://www.w3.org/1999/xlink">
    <xh:script type="application/ecmascript" src="xml_events.js">
    </xh:script>

    <teiHeader>
        <fileDesc>
            <titleStmt>
                <title type="Main">Introduction to Marking up Humanities Texts</title>
                <title type="Sub"></title>
                <author><name>Stewart Arneil</name></author>
                <author><name>Greg Newton</name></author>
                <author><name>Martin Holmes</name></author>
            </titleStmt>
            <publicationStmt><p>University of Victoria Humanities Computing and Media Centre. Released under the Mozilla Public Licence 1.1.</p></publicationStmt>
            <sourceDesc>
                <p>No source: created in machine-readable form.</p>
            </sourceDesc>
        </fileDesc>
        <profileDesc></profileDesc>
    </teiHeader>  
    <text>
        <front>
            <titlePage>
                <docTitle>
                        <titlePart type="Main">Introduction to Humanities Text-Encoding</titlePart>
                    <titlePart type="Sub">Using XML-based Tools on Humanities Texts</titlePart>
                </docTitle>
                <docAuthor><name>Martin Holmes</name></docAuthor>
                <docAuthor><name>Stewart Arneil</name></docAuthor>
                <docAuthor><name>Greg Newton</name></docAuthor>
            </titlePage>
            <argument><p>In the first session, we'll look at some humanities computing projects which use documents encoded according to the XML schemas created by the Text-Encoding Initiative. We'll introduce basic XML concepts, and then mark up a document in TEI XML, showing how we can use a schema to help us figure out the document structure, and to confirm that the document is well-formed and valid. We'll then link our document to a CSS stylesheet, and see how it appears in a browser.</p>
            <p>In the second session, we'll learn how to create a CSS file to style an XML document. Then we'll look at some of the limitations of CSS which have emerged from this process, and go on to look at an alternative approach: using XSLT to render the XML into HTML for the browser.</p></argument>
        </front>
        <body>
            <div>
                <head>Session 1 Overview</head>
                <list>
                  <item><ref target="http://www.youtube.com/watch?v=-Q12BVrJ5XM">Technology in literature</ref>: there's nothing new here...</item>
                    <item>
                        <title>Example projects: what might be possible with documents written in XML</title>
                    </item>
                    <item>
                        <title>Brief look at the origins of markup</title>
                    </item>
                    <item>
                        <title>Document analysis: preparing to mark up a text</title>
                    </item>
                    <item>
                        <title>Basic mechanics of XML</title>
                    </item>
                    <item>
                        <title>Marking up a text</title>
                    </item>
                </list>
            </div>
            
            <div>
                <head>Examples of Humanities Computing projects from UVic</head>
                <list>
                    <item>
                        <title><ref target="http://mariage.uvic.ca/">Le Mariage sous L'ancien Régime</ref>: an electronic anthology</title>
                        <p><ref target="http://mariage.uvic.ca/">http://mariage.uvic.ca/</ref>. This is an anthology of texts and images from around the 17th century in France.</p>
                    </item>
                    <item>
                        <title>Relating spatial and literary references in <ref target="http://mapoflondon.uvic.ca/">Early Modern London</ref></title>
                        <p><ref target="http://mapoflondon.uvic.ca/">http://mapoflondon.uvic.ca/</ref>. This project links a large historical map of London to a variety of information about streets, churches and other landmarks, with a focus on the literary history of the city.</p>
                    </item>

                    <item>
                        <title>A collection of <ref target="http://pear.hcmc.uvic.ca:8080/ach/site/abstracts.htm">abstracts for a conference</ref></title>
                        <p><ref target="http://pear.hcmc.uvic.ca:8080/ach/site/abstracts.htm">http://pear.hcmc.uvic.ca:8080/ach/site/abstracts.htm</ref>. The ACH/ALLC 2005 Conference was held at UVic, and we created this system to produce the online schedule with abstracts in XML, XHTML, PDF and Text format, as well as the printed abstracts book.</p>
                    </item>
                    
                    <item>
                        <title>Linguistic analysis of <ref target="http://web.uvic.ca/hrd/iallt2003/oldenglish/OEparagraph-1.html">Old English</ref></title>
                        <p><ref target="http://web.uvic.ca/hrd/iallt2003/oldenglish/OEparagraph-1.html">http://web.uvic.ca/hrd/iallt2003/oldenglish/OEparagraph-1.html</ref>. This experimental project focuses on syntactic analysis of Old English sentence structure, giving readers access to very detailed linguistic information about the text they're reading.</p>
                    </item>
<!--                     
                    <item>
                        <title><ref target="http://mustard.tapor.uvic.ca/cocoon/larkin/">The Whitsun Weddings</ref>, by Philip Larkin</title>
                        <p>In this project, I marked up the text of a poetry collection to highlight the metrical structures and rhyme patterns of the poems. This project is not public because Larkin's work is under copyright.</p>
                    </item>
-->
                </list>
            </div>
            
            <div>
                <head>Two definitions of "markup" from the OED</head>
                <list>
                    <item><title>The amount added by a seller to the cost price of goods to cover overheads and provide profit.</title></item>
                    <item><title>The process of embedding tags in an electronic text so as to distinguish the text's logical, syntactic, or structural components.</title>
                    <p>We're concerned with the latter, but more broadly we're <emph>adding something</emph> to the text in order to <emph>provide profit</emph> for the reader.</p>
                    </item>
                </list>
            </div>
            
            <div>
                <head>Markup is an ancient concept</head>
                <list>
                    <item><title>Take a look at <ref target="material/emma_extract.htm">the extract</ref> from Jane Austen's <emph>Emma</emph>. What instances of "markup" (broad definition) can you see?</title></item>
                </list>  
            </div>
            
            <div>
                <head>Problems with this kind of "markup"</head>
                <list>
                    <item><title>What is metadata and what is not?</title></item>
                    <item><title>What do italics actually mean?</title></item>
                    <item><title>What does a period mean?</title></item>
                    <item><title>Traditional texts are not machine-readable.</title>
                    <p>Our historical textual conventions are very sophisticated, but they're not machine-readable. XML encoding enables us to identify very precisely the structure of a text, and its features. This can be a very painstaking and difficult. It can also force the elimination or resolution of inconsistencies and ambiguities which may be important to the overall effect of the text. Nevertheless, as Unsworth says, there can be "an enormous return on the exercise of foolish consistency". Marking up a text will often force us to articulate clearly our view of what the text is and how it works. This often makes humanists uncomfortable; they thrive on such ambiguities and tensions. However, we can think of markup as a way to make explicit a theory of the text. Any given markup expresses a theory or set of theories about the text. These need not be mutually exclusive -- multiple markups can be applied to the same text -- but within one markup version, we are forced into consistency.</p></item>
                </list>  
            </div>
            
            <div>
                <head>Preparing for markup: Document analysis</head>
                <list>
                    <item><title>Pick your text</title>
                    <p><list>
                        <item>Which edition or MS will you use?</item>
                        <item>What representations of the text are available to you?</item>
                        <item>How reliable are they?</item>
                    </list></p>
                    </item>
                    <item><title>Identify your audience</title>
                    <p>
                        <list>
                            <item>What is their interest in the text?</item>
                            <item>What standards and technologies are they used to working with?</item>
                            <item>What can you provide for them that is not available elsewhere?</item>
                        </list>
                    </p>
                    </item>
                    <item><title>Choose your focus: what features or aspects of the text are important?</title>
                    <p>
                        <list>
                            <item>Rhyme/meter?</item>
                            <item>Paleography?</item> 
                            <item>Physical structure?</item> 
                            <item>Thematic structure?</item> 
                            <item>Linguistic features?</item>
                            <item>What will you change about the text, or add to it?</item>
                            <item>In other words, what is the knowledge you're trying to represent?</item>
                        </list>
                    </p>
                    </item>
                    <item><title>Analyse your document: List the features of the text that you wish to capture in your encoding.</title>
                    <p>Look at some sample documents and think about what features of those texts might be important for various audiences.</p>
                    </item>
                    <item><title> Example: <ref target="http://www.bl.uk/learning/timeline/large126785.html">Page 1 of manuscript of Jane Eyre</ref></title>
                    </item>
                </list>
            </div>
            
            <div>
                <head>XML</head>
                <list>
                    <item>

                        <title>XML consists mainly of <emph>tags</emph> and <emph>attributes</emph>. (See the <ref target="material/simple_note.htm"> example</ref>.)</title>
                    </item>
                                            <item>
                        <title>XML represents a document as a <ref target="material/tree_structure.png">hierarchical tree structure</ref>. The structure can only branch in one direction, and <ref target="material/sonnet_130_structure.htm">elements cannot overlap</ref>.</title>
                    </item>
                    <item><title>Open tag: <code>&lt;name&gt;</code></title></item>
                    <item><title>Close tag: <code>&lt;/name&gt;</code></title></item>
                    <item><title>Full tag: <code>&lt;name&gt;</code>Joe<code>&lt;/name&gt;</code></title></item>
                    <item><title>Empty tag: <code>&lt;pb /&gt;</code></title><p>This is short for <code>&lt;pb&gt;</code><code>&lt;/pb&gt;</code></p></item>
                    <item><title>Attribute: <code>&lt;name type="first"&gt;</code>Joe<code>&lt;/name&gt;</code></title><p>The order of attributes in a tag is not constrained in any way (in other words, we cannot depend on their being in a particular order, or make their order significant; processors will ignore the order of attributes).</p></item>
                </list>
            </div>
            
            <div>
                <head>Rulesets for document structure</head>
                <list>
                    <item>
                        <title>
                            <code>&lt;abbr expan=&quot;United Nations&quot;&gt;UN&lt;/abbr&gt;</code>
                        </title>
                        <p>This is a standard TEI tag; it's purpose is obvious.</p>
                    </item>
                    <item>
                        <title>
                            <code>&lt;abbreviation full=&quot;United Nations&quot;&gt;UN&lt;/abbreviation&gt;</code>
                        </title>
                        <p>This is apparently equivalent; humans can easily tell that it means basically the same thing.</p>
                    </item>
                    <item>
                        <title>
                            <code>&lt;acronym meaning=&quot;United Nations&quot;&gt;UN&lt;/acronym&gt;</code>
                        </title>
                        <p>This is the same information again, in a different format.</p>
                    </item>
                    <item>
                        <title>Machines can't cope with this. They must know what to expect.</title>
                        <p>We must all agree on what tags and attributes we're going to use, what they mean, and how we're going to use them.</p>
                    </item>
                    <item><title>SCHEMAS (or DTDs) define what tags and attributes are
                    used, and where.</title>
                    <p>Schemas and DTDs formalize our agreement. They are also machine-readable, so (for instance) editor applications can use them to constrain our choices and help us to write conformant documents.</p>
                    </item>
                </list>
            </div>
            
            <div>
                <head>Schemas</head>
                <list>
                    <item>
                        <title>Background: <ref target="material/simple_note_full.htm">HTML page</ref> showing a simple XML document and associated ruleset</title>
                        <p></p>
                    </item>
                    <item>
                        <title>Real <ref target="material/mariage.rng">rulesets</ref> (WARNING: Large file!), a.k.a. DTDs and schemas, are complex, but comprehensible by computers (and humans if need be)</title>
                    </item>
                    <item>
                        <title>The Text Encoding Initiative (<ref target="http://www.tei-c.org/">TEI</ref>) provides a set of standard modular rulesets and tools for creating them</title>
                        <p>The TEI site (<ref target="http://www.tei-c.org/">http://www.tei-c.org/</ref>) also provides extensive guidelines on how to mark up texts.</p>
                    </item>
                </list>
            </div>
            
            <div>
                <head>Start New Document with oXygen</head>
                <list>
                    
                    <item>
                        <title>Start the oXygen application as you would any other program</title>
                    </item>
                    <item>
                      <title>Choose New... from the File Menu "XML document", choose XML Document in the New Document dialog box, and click OK. [<ref target="new_doc.png">Screenshot</ref>]</title>
                    </item>
                    <item>
                        <title>Check "Use DTD or schema" checkbox.</title>
                    </item>
                    <item>
                        <title>Choose "RelaxNG", select "XML syntax".</title>
                    </item>
                  <item>
                    <title>Type this into the URL box at the top:<lb/>
                      http://hcmc.uvic.ca/tei.rng</title>
                  </item>
                    <item>
                      <title>Make sure "TEI" is selected in the "Document root" box, then click "OK". [<ref target="create_xml_doc.png">Screenshot</ref>]</title>
                    </item>
                </list>
            </div>
            <div>
                <head>Edit Your Sample Document in oXygen</head>
                <list>
                    <item>
                        <title>Red wiggly lines indicate errors in the file.</title>
                    </item>
                    <item>
                        <title>Insert appropriate tags - note how oXygen helps / constrains you, based on the schema.</title>
                    </item>
                    <item><title>Build a minimal document structure.</title></item>
                    <item>
                        <title>Copy and paste your text from <ref target="http://hcmc.uvic.ca/presentations/xml/material/sonnet_130.htm">http://hcmc.uvic.ca/presentations/xml/material/sonnet_130.htm</ref>.</title>
                    </item>
                    <item>
                        <title>Confirm document is well-formed (blue check) and valid (red check).</title>
                        <p>"Well-formed" means that the document is correctly hierarchical (all tags are closed, and the tag structure forms a correctly branching tree). "Valid" means that the document conforms to the schema (it uses the right tag names attributes, and attribute values in the right places).</p>
                    </item>
                    <item>
                        <title>Save your file.</title>
                    </item>
                    <item>
                        <title>That's the end of this session.</title>
                        <p>Before the next session, try using the TEI <code>&lt;choice&gt;</code>, <code>&lt;orig&gt;</code> and <code>&lt;reg&gt;</code> tags to encode a modern regular form of the poem alongside the original text.</p>
                    </item>
                </list>
            </div>
            
            <div>
                <head>Recap: TEI XML Encoding</head>
                <list>
                    <item><title>Set of modular schemas for XML encoding of humanities documents</title></item>
                    <item><title>Used for: manuscripts, verse, drama, prose, dictionaries, linguistic data, academic articles, etc.</title></item>
                    <item><title>Archival format</title></item>
                    <item><title>Interchange format</title></item>
                    <item><title>NOT a rendering format</title></item>
                </list>
            </div>
            
            <div>
                <head>Session 2 Overview</head>
                <list>
                    <item><title>Introduction to Cascading Stylesheets</title></item>
                    <item><title>Using CSS to style XML</title></item>
                    <item><title>CSS rulesets, selectors and properties</title></item>
                    <item><title>A strategy for writing CSS to style XML</title></item>
                    <item><title>Limitations of CSS</title></item>
                    <item><title>The next level: XSLT</title></item>
                </list>
            </div>
            
            <div>
                <head>Setting up your workspace</head>
                <list>
                    <item><title>Download the XML data file we'll be working on:<lb />
                    <ref target="http://hcmc.uvic.ca/presentations/xml/material/css_intro.xml">http://hcmc.uvic.ca/presentations/xml/<lb/>material/css_intro.xml</ref></title></item>
                    
                    <item><title>Download the schema:<lb />
                    <ref target="http://hcmc.uvic.ca/presentations/xml/material/css_intro.rng">http://hcmc.uvic.ca/presentations/xml/<lb/>material/css_intro.rng</ref></title></item>
                    
                    <item><title>Start a new CSS file in oXygen:<lb/>File / New / CSS.</title></item>
                    <item><title>Save the CSS file. Call it "css_intro.css".</title></item>
                    <item><title>Link the CSS file to your XML file by adding a processing instruction, as we did before:</title></item>
                    <item><title><code>&lt;?xml-stylesheet href="css_intro.css" type="text/css"?&gt;</code></title></item>
                </list>
            </div>
            
            <!--<div>
                <head>A CSS Ruleset</head>
                <list type="no_bullet">
                    <item>
                        <title><code>p{</code><lb/>
                            <code>font-size: 12pt;</code><lb/>
                            <code>text-align: justify;</code><lb/>
                            <code>}</code></title>
                    </item>
                </list>
            </div>-->
            
          <div>
            <head>A CSS Ruleset<graphic url="css_ruleset_01.png" width="780px" height="610px" rend="display: block; clear: all; margin-left: 10%; margin-top: 5px;"/></head>
          </div>
          
          <div>
            <head>A CSS Ruleset: Selectors<graphic url="css_ruleset_02.png" width="780px" height="610px" rend="display: block; clear: all; margin-left: 10%; margin-top: 5px;"/></head>
          </div>
          
          <div>
            <head>A CSS Ruleset: Properties<graphic url="css_ruleset_03.png" width="780px" height="610px" rend="display: block; clear: all; margin-left: 10%; margin-top: 5px;"/></head>
          </div>
          
          <div>
            <head>A CSS Ruleset: Values<graphic url="css_ruleset_04.png" width="780px" height="610px" rend="display: block; clear: all; margin-left: 10%; margin-top: 5px;"/></head>
          </div>
          
          <div>
            <head>A CSS Ruleset: Punctuation<graphic url="css_ruleset_05.png" width="780px" height="610px" rend="display: block; clear: all; margin-left: 10%; margin-top: 5px;"/></head>
          </div>
          
          <div>
            <head>A CSS Ruleset: Recap<graphic url="css_ruleset_06.png" width="780px" height="610px" rend="display: block; clear: all; margin-left: 10%; margin-top: 5px;"/></head>
          </div>
            
            <div>
                <head>Selectors we will use</head>
                <list>
                    <item>
                        <title><code>div{...}</code> (<term>type</term> selector)</title>
                        <p>This is the simplest type of selector. It selects all elements with the tag name "div".</p>
                    </item>
                    <item>
                        <title><code>div p{...}</code> (<term>descendant</term> selector)</title>
                        <p>This selects all <code>p</code> elements which are descendants of <code>div</code>.</p>
                    </item>
                    <item>
                        <title><code>title[level="m"]{...}</code> (<term>attribute</term> selector)</title>
                        <p>This selects all <code>title</code> elements which have an attribute <code>level="m"</code>.</p>
                    </item>
                    <item>
                        <title><code>quote:before{...}</code> and <code>quote:after{...}</code> (<term>pseudo-selectors</term>)</title>
                        <p>These pseudo-selectors are a little more complicated; they enable you to add content which will appear before or after the element. Using these selectors, for instance, you can opening and closing quotation marks before and after a quote.</p>
                    </item>
                    <item>
                        <title>More details: <lb /><ref target="http://www.w3.org/TR/CSS21/selector.html">http://www.w3.org/TR/CSS21/selector.html</ref></title>
                        <p>The link above goes to the CSS 2.1 specification; CSS 3 defines many more selectors and pseudo-selectors, but only a few are currently supported by browsers.</p>
                    </item>
                </list>
            </div>
            
            <div>
                <head>Properties we will use</head>
                <list>
                    <item>
                        <title><code>display: block | inline | none;</code> (hiding and showing elements)</title>
                        <p>Elements can be displayed as blocks (such as paragraphs, which are multi-line wrapping blocks of text), inline (words or phrases that occur within a block, such as italicized terms) or "none" (which means not displayed at all). </p>
                    </item>
                    <item>
                        <title><code>width: 60%;</code> (sizing elements)</title>
                        <p>Width and height can be specified for any block elements, in percentages (relative to the containing block) or units such as pixels (400px) or inches (6in).</p>
                    </item>
                    <item>
                        <title><code>margin-top: 1em;</code> (space around elements)</title>
                        <p>A margin setting does just what you would think: it puts a space between the element and anything contiguous to it. Margins can be set in percentages or units such as pixels, inches or ems (the height of the element's font). Margins can be set separately on all four sides of the element, or in a single setting (<code>margin: 2%</code>).</p>
                    </item>
                    <item>
                        <title><code>text-align: left | right | center | justify;</code></title>
                    </item>
                    <item>
                        <title><code>font-size: 150%;</code></title>
                    </item>
                    <item>
                        <title><code>font-family: georgia, "times new roman", serif;</code></title>
                        <p>The font-family property takes a series of comma-separated values, in order of preference; the browser will use the first one which is available. Font names with spaces should be enclosed in quotes, and the series should end with one of the generic font families (<code>serif</code>, <code>sans-serif</code>, <code>cursive</code>, <code>fantasy</code> or <code>monospace</code>).</p>
                    </item>
                    <item>
                        <title><code>font-style: italic;</code> 
                            <code>font-weight: bold;</code></title>
                    </item>
                    <item>
                        <title><code>color: black;</code> 
                            <code>background-color: white;</code></title>
                    </item>
                </list>
            </div>
            <div>
                <head>Steps in building a stylesheet</head>
                <list type="no_bullet">
                    <item>
                        <title>1. Specify which elements to hide.</title>
                        <p>Some elements are not normally viewed in a document; one good example might be the teiHeader, which is often used only by metadata parsers or coders comfortable with reading XML. Such elements can be hidden by setting <code>display: none</code>.</p>
                    </item>
                    <item>
                        <title>2. Specify which elements are blocks.</title>
                        <p>By default, all elements are displayed as <code>inline</code>. The first step in organizing the layout is to determine which elements should be block elements. Typical examples in TEI would be <code>head</code> tags and <code>p</code> tags.</p>
                    </item>
                    <item>
                        <title>3. Set margins on block elements.</title>
                        <p>Space out the elements on your page by setting <code>margin</code> values. Other properties to consider at this stage are <code>padding</code> and <code>border</code>.</p>
                    </item>
                    <item>
                        <title>4. Set text alignment on block elements.</title>
                        <p>Some elements (such as headings) might be centred, others (such as paragraphs) will look best when justified.</p>
                    </item>
                    <item>
                        <title>5. Set font size on block elements.</title>
                        <p>The hierarchy of a text is often signalled through setting different font sizes for different levels of heading. Blockquotes are sometimes shown with a smaller font size than the surrounding paragraph text.</p>
                    </item>
                    <item>
                        <title>6. Style inline elements.</title>
                        <p>TEI <code>emph</code> tags will typically be italicized, acronyms or abbreviations might be bold, and monograph titles will typically be in italics.</p>
                    </item>
                </list>
            </div>
          
          <div>
            <head>CSS Task 1</head>
            <list type="no_bullet">
              <item>Write your own CSS file to make the css_intro.xml document look exactly like the printout we've given you.</item>
            </list>
          </div>
          
          
          <div>
            <head>CSS Task 2 (much harder)</head>
            <list>
              <item><title>Download the XML data file for task 2:<lb />
                <ref target="http://hcmc.uvic.ca/presentations/xml_css/materials/gowers_sample.xml">http://hcmc.uvic.ca/presentations/xml_css/materials/gowers_sample.xml</ref></title></item>
              
              <item><title>Look at page-images of the original text:<lb />
                <ref target="http://hcmc.uvic.ca/presentations/xml_css/materials/gowers_pages.htm">http://hcmc.uvic.ca/presentations/xml_css/materials/gowers_pages.htm</ref></title></item>
              
              <item>Build a stylesheet that makes the XML appear as close as possible to the page-images, like <ref target="http://hcmc.uvic.ca/presentations/xml_css/gowers_sample.xml">this</ref>.</item>
            </list>
          </div>
          
          
            
            <div>
                <head>Limitations of CSS</head>
                <list>
                    <item><title>There's no interactivity</title>
                    <p>Nothing is clickable, and nothing pops up when you mouse over things.</p></item>
                    <item><title>We can't display images or other embedded content.</title>
                    <p>CSS allows us to specify a background image for an element or for the whole file, but it doesn't allow us to show images in the document, based on a filename or url in the document.</p></item>
                    
                    <item><title>CSS is useful for display of simple documents, or for proofing our markup, but not much more.</title>
                    <p>In order to do something more dynamic with our documents, we need to convert them into something else. In the next part of the session, we'll be converting our XML into HTML using XSLT.</p></item>
                </list>
            </div>
            
            <div>
                <head>XSLT: eXtensible Stylesheet Language Transformations</head>
                <list>
                    <item>
                        <title>XSLT is an XML language</title>
                        <p>XSLT code is expressed in XML format. That makes it a little different from other computer languages you might know.</p>
                    </item>
                    <item>
                        <title>The purpose of XSLT is to turn XML into something else.</title>
                        <p>The input to an XSLT transformation is always XML. The output may be one several formats.</p>
                     </item>
                     <item>
                        <title>XSLT can produce XML, HTML, or text output.</title>
                     </item>
                     <item>
                        <title>We will be writing XSLT to produce XHTML output.</title>
                        <p>XHTML is the most recent form of HTML. It is based on the old HTML many of us are familiar with, but it is expressed in well-formed and valid XML. In other words, it's simultaneously XML and HTML.</p>
                    </item>
                </list>
            </div>
            
            <div>
                <head>Getting started with XSLT</head>
                <list>
                    <item>
                        <title>Create a stylesheet: <lb/>
                        File / New / XSL Stylesheet / Version 1.0.</title>
                        <p>Version 2 also exists, but it's not supported in browsers yet. We're going to view the results of our transformation in a browser, so we need to stick to version 1.0. It should be good enough.</p>
                    </item>
                    <item>
                        <title>Save your file as "css_intro.xsl".</title>
                    </item>
                    <item>
                        <title>Link your XML file to this stylesheet. Replace the old xml-stylesheet instruction with this one:
                        </title>
                    </item>
                    <item><title><code>&lt;?xml-stylesheet href="css_intro.xsl" type="text/xsl"?&gt;</code></title></item>
                    <item>
                        <title>Now simplify your XML file by removing the <code>xmlns</code> attribute in the root element. Also remove the schema declaration.</title>
                        <p>Don't ask why; it's too complicated to explain, and you'll wish you never asked. We just have to do it for this exercise.</p>
                    </item>
                    <item>
                        <title>Open the XML file in your browser.</title>
                        <p>You won't see anything right now, because our XSLT file is empty.</p>
                    </item>
                </list>
            </div>
            
            <div>
                <head>Building the XSLT file</head>
                <list>
                    <item>
                        <title>First, we need to tell the processor what kind of output we want to create:<lb/></title>
                    </item>
                    <item>
                        <title>Add this, between the open and close tags of the XSLT file:<lb/>
                        <code>&lt;xsl:output method=&quot;html&quot; /&gt;</code>
                        </title>
                        <p>This tells the processor we want to create an HTML page. Other options are XML and text.</p>
                    </item>
                </list>
            </div>
            
            <div>
                <head>Our first template:</head>
                <list type="no_bullet">
                    <item>
                        <title>&lt;xsl:template match=&quot;/&quot;&gt;<lb/>
    &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<lb/>
        &lt;head&gt;<lb/>
            &lt;title&gt;&lt;xsl:value-of select=&quot;TEI/teiHeader/fileDesc/titleStmt/title/text()&quot; /&gt;&lt;/title&gt;<lb/>
        &lt;/head&gt;<lb/>
        &lt;body&gt;<lb/>
            &lt;xsl:apply-templates select=&quot;TEI/text/body&quot; /&gt;<lb/>
        &lt;/body&gt;<lb/>
    &lt;/html&gt;<lb/>
&lt;/xsl:template&gt;
                        </title>
                        <p>XSLT works by templates. It parses the XML tree of the input file, and every time it finds something that matches one of its templates, it carries out the instructions in that template. Here, we're matching the root of the document, which is signified by a slash character. We're telling the processor: "When you find the root of the document, output a basic HTML file". Then we're telling it to extract a specific piece of information from the teiHeader, and use that for the title of the HTML page. Finally, we're telling it to continue processing from the text/body level of the tree.</p>
                    </item>
                </list>
            </div>
            
            <div>
                <head>The rest is just templates...</head>
                <list>
                    <item>
                        <title>...which we really have to demonstrate one at a time in oXygen.</title>
                    </item>
                </list>
            </div>
            
            <div>
                <head>Wrapup: How our projects actually work</head>
                <list>
                    <item>
                        <title>The XML documents are stored in an XML Database called eXist:
                        <graphic url="xmldb_structure.png" width="400px" height="549px" rend="display: block; clear: all; margin-left: 20%; margin-top: 5px;"  />
                        </title>
                        <p>eXist is an open-source Java application that runs on the server. It can be integrated with a sophisticated web application server called Cocoon.</p>
                    </item>
                    <item>
                        <title>The Website is managed by Cocoon:
                        <graphic url="cocoon_app.png" width="579px" height="428px" rend="display: block; clear: all; margin-left: 20%; margin-top: 5px;"  />
                        </title>
                        <p>You can see that a number of different languages are actually involved. The query comes in to the system in the form of a URL. This is then passed to an XQuery processor, which creates a detailed query in the XQuery language. eXist deals with the XQuery, gets the data out of the db in XML format, and passes it back into the pipeline. Then the results are processed through XSLT, to produce XML, HTML, Text or XSL:FO. XSL:FO can be passed to our XEP processor to produce PDF. The results are sent back to the browser.</p>
                    </item>
                    
                </list>
            </div>
            
            <!--<div>
                <head></head>
                <list>
                    <item>
                        <title></title>
                        <p></p>
                    </item>
                </list>
            </div>-->
            
        </body>
        <back></back>
    </text>
</TEI>
