ESP pages are written in XML. Here we describe what they look like.
The basic outline | System elements and XHTML elements | Adding Dublin Core metadata (optional)
You can find blank template pages (called template-blank.xml
) in the Oracc schemas directory installed on your own computer and in the 00web/ directory
on Oracc. When you edit a template page in Emacs, save it as FILENAME.xml
, where FILENAME = the name of your file, with no spaces in it.
The content of each ESP page is defined in its own XML file. Here is an example of an XML page file:
<?xml version="1.0" encoding="utf-8"?> <esp:page xmlns:esp="http://oracc.org/ns/esp/1.0" xmlns="http://www.w3.org/1999/xhtml" > <esp:name>Home</esp:name> <esp:title>Home</esp:title> <html> <head> <meta name="DC.rights.copyright" content="Released under a CC-BY-SA 3.0 license"> </head> <body> <p>Good morning.</p> </body> </html> </esp:page>
All XML documents must start with the XML declaration:
<?xml version="1.0" encoding="utf-8?>
The encoding
attribute should match the encoding used to save the document; utf-8 is recommended in order that the characters display correctly.
The root element is <esp:page>
. The root element of an XML document must declare the namespace prefixes used in that document. Therefore, ensure that the first element in your document includes the following attributes:
xmlns:esp=""http://oracc.org/ns/esp/1.0" xmlns="http://www.w3.org/1999/xhtml"
The <esp:name>
element gives the short name of the page. Keep this short and meaningful as it will appear in the navigation menu and also becomes the page URL. Do not use any special characters (ṣ, š, etc.) within <esp:name>
as they will not display as part of a URL.
The <esp:title>
element gives a longer description (used as the title of the page, and in the site map, for example). Special characters are fine to use within <esp:title>
.
There then follows a skeleton HTML page.
The <html>
element can contain system elements (such as <esp:image>
) and a subset of valid XHTML elements (such as the paragraph, <p>
). The system elements are processed in various ways, most of which cause XHTML elements to be added to the final page. XHTML elements may be processed or may be copied directly to the final page.
Unrecognised elements of any kind (such as <a href=""> or <h2>
or mistyped elements such as <esp:glsoarry>
) will be stripped from the final page, but their content is retained and processed as normal. This is why we recommend using Emacs with the ESP schemas, so that you can check and correct your coding as you work.
The recognised XHTML elements are:
abbr
, acronym
, address
b
, blockquote
, body
, br
code
dd
, dl
, dt
embed
, em
h2
, h3
, head
, html
i
kbd
li
meta
object
, ol
p
, param
q
span
, sub
, sup
table
, td
, th
, tr
ul
For details of these elements, please consult an XHTML reference such as w3schools.com [http://www.w3schools.com/xhtml/xhtml_ref_byfunc.asp]. Always try to use a semantic tag (such as <emph>
or <q>
) in preference to a presentational tag (such as <b>
or <i>
), athough be aware that semantic tags do not display in the same way over all browsers (e.g., <emph>
displays as italics in some browsers and bold in others).
Note that the <meta>
element may be used to add Dublin Core [http://dublincore.org/] metadata specific to each page. DC.title
and DC.identifier
are added automatically to each page where appropriate, and items common to all pages can be added within <esp:common-headers
in parameters.xml
. However, there are many other useful page-specific metadata items, including DC.date.issued
, DC.date.modified
, DC.description
, and so on, which may be placed within the head element on each page.
For example,
<meta name="DC.date.modified" scheme="DCTERMS.W3CDTF" content="2005-02-03" />
You can just leave the head
element empty though: <head />.
Ruth Horry & Eleanor Robson
Ruth Horry & Eleanor Robson, 'Understanding ESP page structure', Oracc: The Open Richly Annotated Cuneiform Corpus, Oracc, 2019 [http://oracc.museum.upenn.edu/doc/help/portals/pagestructure/]