Text Encoding & XML

DH 190: Scholarly Text Encoding
Week 2 // January 20, 2016

Prof. Mackenzie Brooks

Reading response for

"The Future is Digital"

 

http://goo.gl/forms/vDG90bvm9V

Key concepts:

digital illiteracy
crisis in scholarly publishing
crisis in the humanities
peer review
remediation
development process
commodification of information

HTML Assignment Review

  • Browsers are forgiving, but!
  • Every HTML document needs <html> ,<head> , and <body> tags.
  • HTML tags/elements always need to be opened and closed, unless they're empty (like <img>).
  • CSS can go in several places, but usually belongs in a separate document
  • Be careful when you copy & paste.
  • Text editors matters!

What is XML?

Extensible

Markup

Language

E xtensible

  • Able to expand
  • Does not contain a fixed set of tags

 

Markup

  • Tags around content
  • Vocabulary
  • Grammar
<title>Example of Using Proofreader's Marks</title>
<p>Traditional proof reading is becoming a dying 
art since so many clients no longer use hardcopies 
to mark-up their corrections by hand. Today most clients simply
write corrections in an email for you to decipher and follow
up with a call, while others write them diligently in a Word 
document.</p>

Descriptive

<title>Example of Using Proofreader's Marks</title>

Presentational

XML cares about what the text is, not how it looks.   

Not just a language, but a

metalanguage.

A language used to formally express the components or structure of another language.

<element>content</element>

<title>Hamlet</title>
 

 

<author>William Shakespeare</author>

 

<forename>William</forename>

<surname>Shakespeare</surname>

<element attribute="value">content</element>

<l n="1710">To be or not to be, that is the question </l>

<date when="2015-01-30">Today</date>

XML is hierarchical.

<groceryList>
    <vegetable>
        <item>Broccoli</item>
        <item>Kale</item>
    </vegetable>
    <dairy>
        <item>Milk</item>
        <item>Yogurt</item>
    </dairy>
    <meat>
        <beef>
            <item>Ground beef</item>
            <item>Steak</item>
        </beef>
        <poultry>
            <item>Drumsticks</item>
        </poultry>
    </meat>
    <alcohol>
        <wine color="white">
            <item>Pinot Grigio</item>
        </wine>
    </alcohol>
<groceryList>

XML should be well formed.

<groceryList>
    <vegetable>
        <item>Broccoli</item>
        <item>Kale</item>
    <dairy>
        <item>Milk</item>
        <item>Yogurt</item>
    <dairy>
    <meat>
        <beef>
            <item>Ground beef
            <item>Steak</item>
        </beef>
        <Poultry>
            <item>Drumsticks</item>
        </poultry>
    </meat>
    <alcohol>
        <item type=wine>Pinot Grigio</item>
        <item><beer>Devils Backbone</item></beer>
    </alcohol>
<groceryList>

This XML is not well formed in 5 places:

XML should be valid.

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="groceryschema.rnc" type="application/relax-ng-compact-syntax"?>
<groceryList
                xmlns="http://www.grocerylist.com">
    <vegetable>
        <item>Broccoli</item>
        <item>Kale</item>
    </vegetable>
    <dairy>
        <item>Milk</item>
        <item>Yogurt</item>
    </dairy>
    <meat>
        <beef>
            <item>Ground beef</item>
            <item>Steak</item>
        </beef>
        <poultry>
            <item>Drumsticks</item>
        </poultry>
    </meat>
    <alcohol>
        <beer>
            <item>Devils Backbone</item>
        </beer>
    </alcohol>
    <chore>Run the dishwasher</chore>
    <chore>Fold laundry</chore>
<groceryList>
            

XML Declaration

Namespace Declaration

<?xml version="1.0" encoding="UTF-8"?>
<groceryList
                xmlns="http://www.grocerylist.com">
            
<?xml-model href="groceryschema.rnc" type="application/relax-ng-compact-syntax"?>

Schema

Encode this recipe:

  • 1 1/2 cups of flour
  • 3 1/2 tsps baking soda
  • 1 tsp salt
  • 1 tbsp sugar
  • 1 1/4 cups milk
  • 1 egg
  • 3 tbsp butter

 

In a large bowl, mix dry ingredients.

Make a well in the center and pour in wet ingredients.

Mix until smooth.

Heat a lightly oiled griddle or frying pan over medium high heat.

Pour or scoop the batter onto the griddle, using approximately 1/4 cup for each pancake.

Brown on both sides and serve hot.

For next week:

  • Finish recipe encoding exercise. Email well-formed XML to Prof. Brooks by 8am 1/25/16.
  • Look at document analysis readings
  • Read the Szpiech article and be ready for discussion.

DH 190 Week 2

By Mackenzie Brooks

DH 190 Week 2

  • 1,277