Introduction to markup language and oXygen XML editor
1. 1
NeDiMAH workshop:
Editing texts in a digital world: Text encoding and visualisation
Cluj-Napoca, 27.4.2015 to 2.5.2015
Roman Bleier, Trinity College Dublin
Email: bleierr@tcd.ie
What is a markup
language and
Introducing the oXygen
environment
2. 2
Often used example scriptura continua – white
space and punctuation as markup
What is the use of a markup
language?
Spring and Fall (1880) by Gerard
Manley Hopkins (taken from wikipedia,
s.v. Scriptio_continua)
3. 3
● For computers plain text is just a series of
whitespace and characters
● We humans understand the following line as
address information. What does a computer
understand?
David G. Curtin Esq.R.D.C Stagmount House Rockchapel
Co. Cork Ireland
Computers do not understand texts
in the same way as humans do
4. 4
● Markup languages (ML) are not programming
languages
● Tags or elements are used to add information to
content, e.g. HTML to structure text, images, etc.
on a webpage
● These tags or elements have to be interpreted
by processing software (e.g. web browser)
What is a markup language?
5. 5
● A ML must specify how markup is to be
distinguished from text/content
● Examples:
● HTML: <h1>This is a heading</h1>
● LaTeX: begin{document} Text end{document}
● A ML must specify what markup is allowed and
what is required (e.g. XML root element is
required for XML documents)
What is a markup language?
6. 6
● Procedural markup: defines what processing is
to be carried out at particular points in a
document
● Descriptive or semantic markup: describes the
content
Different types of markup
Example based on J. Flanders, Descriptive Markup (2007).
Procedural markup says: "center this text"
Descriptive markup says "just FYI, this text is a
(centered) heading"
8. 8
HTML encoding of the address information
<div>
<p>David G. Curtin Esq.R.D.C,</p>
<p>Stagmount House.</p>
<p>Rockchapel.</p>
<p>Co. Cork.</p>
</div>
HTML elements do not
add meaning to the
text, proceedureal
markup
9. 9
Semantic encoding of
address information with XML
<div facs="#L1916_1590_img_4">
<ab>
<address>
<addrLine>David G. Curtin Esq.R.D.C,</addrLine>
<addrLine>Stagmount House.</addrLine>
<addrLine>Rockchapel.</addrLine>
<addrLine>Co. Cork.</addrLine>
</address>
</ab>
</div>
<div facs="#L1916_1590_img_4">
<ab>
<address>
<persName ref="#P11">David G. Curtin
<roleName type="title">Esq.R.D.C</roleName>
</persName>
<street>Stagmount House</street>
<settlement>Rockchapel</settlement>
<region>Co. Cork</region>
</address>
</ab>
</div>
10. 10
● Word processing software (Microsoft Word,
Libre Office, LaTeX)
● Web authoring (HTML)
● For describing graphics (SVG)
● Storage, description and exchange of metadata
(Dublin-Core, RDF, MARCXML)
● Modelling of humanities data and digital scholary
editing (TEI, EpiDoc, MENOTA)
Applications of markup languages
11. 11
oXygen XML editor: initial setup
● oXygen is a XML editor and development
environment with a lot of support for TEI
● Support for XML development
(XSLT, XPath, XQuery, XSL-FO, etc.)
● supports many other languages
(HTML, CSS, JavaScript, etc.)
● Download and install the trial version of oXygen:
http://www.oxygenxml.com/download.html
12. 12
oXygen XML editor: first project
● Create a project folder somewhere on your
harddrive
● Name it 'TEI workshop April 2015'
● In the project folder create the folder 'Intro to
XML'
● Start oXygen and create a new project, name it
'TEIworkshopApril2015'
● The following slides show step-by-step how this
is done.
15. 15
oXygen XML editor: create new project
In the pop-up window 'New Project', enter the name of your project and select a
place where you would like to save the project file.
Project folder name:
TEI workshop April 2015
In project folder create
another folder:
Intro to XML
Give your project file a file
name: e.g.
TEIworkshopApril2015.xpr
.xpr is the extension for
oXygen project files
16. 16
oXygen XML editor: add a folder
Add Folder/Add Files:
You can add individual folder or
files to your project
If a folder is added the folder
content is also added to your
project
Add the folder 'Intro to XML'
17. 17
oXygen XML editor: create first XML file
In the pop-up window choose 'XML
Document' and give the document the
file name: helloWorld.xml
Press the button 'Create'
19. 19
oXygen XML editor: validate XML file
If you validate your XML file you
should get an error message:
„There is no schema or DTD
associated with document...“
„A well-formed document requires a
root element.“
20. 20
oXygen XML editor: add a DTD
Add a simple DOCTYPE
declaration:
<!DOCTYPE text [
<!ELEMENT text (#PCDATA)>
]>
If you validate your document now
you should still get the Error:
„A well-formed document requires a
root element.“
21. 21
oXygen XML editor: add a root element
We will learn this afternoon what a
root element is. However, if you
add the following line of XML code
your document should be valid:
<text>Hello World!</text>
Try to validate your document
again. There should be no more
error messages and a 'green lights'
on bottom an right side will show
you that the XML document is
indeed valid XML.
Valid XML