Introduction to Markup David J. Birnbaum University of Pittsburgh Slavic Digital Text Workshop University of Illinois at Urbana-Champaign
How to Set up an XML Project Examples (critical edition of Igor′ Tale) Document instance (main XML file) –XML Declaration –Doctype Declaration –Data with markup Document Type Definition (DTD) –Elements –Attributes Transformation Stylesheets (XSLT) Target files (HTML) Cascading Style Sheets (CSS) Batch file
The XML Declaration
Doctype Declaration
Document Type Definition
What the Instance Looks Like Title goes here Heading goes here Paragraph text goes here
Non-Empty and Empty Elements Element content … Character data (#PCDATA) content blah, blah, blah Mixed content blah … blah Some elements are empty
Element Declarations 1 Examples Element name and content model #PCDATA = parsed character data (plain text) blah blah blah …
Element Declarations 2 Examples Connectors –Sequence (,) –Any order (|)
Element Declarations 3 Examples Repetition –Exactly one (no repetition indicator) –Zero or one (?) –One or more (+) –Zero or more (*)
Attribute Declarations Example Element name, attribute name, token list, default пѣснь
Document Type Declaration
The Document Instance аще кому хотяше пѣснь пѣснѣ творити,
XSLT Extensible Stylesheet Language for Transformations Can rearrange elements (unlike other stylesheet strategies) Programming language for manipulating XML Use XSLT transformation engine to generate HTML from XML
HTML Hypertext Markup Language Why not just create HTML in the first place? –XML easier to edit and maintain –XML supports multiple output formats from single source
CSS Cascading Stylesheets –External stylesheet –Internal style commands “Decorate the tree” Cannot rearrange elements Likh: трудныхъ повѣстий (4) о пълку Игоревѣ, P: трудныхъ повѣстий о полку Игоревѣ, K: трудныхъ повѣстий о полку Игоревѣ, (4) ПОЛКУ
Batch File saxon -o igor.html igor.xml score.xsl saxon -o commentary.html igor.xml commentary.xsl saxon -o igor1.html igor.xml igor.xsl saxon -o variants.html igor.xml variants.xsl