{"id":169,"date":"2014-04-24T08:03:50","date_gmt":"2014-04-24T08:03:50","guid":{"rendered":"http:\/\/uahost.uantwerpen.be\/bdmp\/EncodingManual\/?page_id=169"},"modified":"2021-03-19T15:25:42","modified_gmt":"2021-03-19T15:25:42","slug":"elements-and-tags","status":"publish","type":"page","link":"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/general-remarks\/elements-and-tags\/","title":{"rendered":"Elements and Tags"},"content":{"rendered":"<h3 style=\"text-align: justify;\">Elements<\/h3>\n<p style=\"text-align: justify;\">Elements are the building blocks\u00a0of markup languages such as XML. This is an example of a text element:<\/p>\n<div class=\"panel panel-info \"><div class=\"panel-body\"><\/p>\n<p>[xml]\n&lt;text&gt;This is the text&lt;\/text&gt;[\/xml]<\/p>\n<p><\/div>\n<\/div>\n<p style=\"text-align: justify;\">An element starts\u00a0with an opening tag (here: <a title=\"&lt;text&gt;\" href=\"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/encoding-text\/text\/\"><code>&lt;text&gt;<\/code><\/a>), followed by its content (here: <strong>This is the text<\/strong>), and ends with a closing tag (here: <a title=\"&lt;text&gt;\" href=\"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/encoding-text\/text\/\"><code>&lt;\/text&gt;<\/code><\/a>).<\/p>\n<hr \/>\n<h3 style=\"text-align: justify;\">Tags<\/h3>\n<p style=\"text-align: justify;\">Tags mark the start and the beginning of an element. There are three types of tags: opening tags, closing tags, and milestone tags:<\/p>\n<ol style=\"padding-left: 30px; text-align: justify;\">\n<li>An <strong>opening tag<\/strong> starts with an opening angled bracket (<strong>&lt;<\/strong>), followed by the element&#039;s name (here: <strong>text<\/strong>), and ends with a closing angled bracket (<strong>&gt;<\/strong>).<\/li>\n<li>A <strong>closing tag<\/strong> starts with an opening angled bracket and\u00a0a backslash (<b>&lt;\/<\/b>), followed by the element&#039;s name (here: <strong>text<\/strong>), and ends with a closing angled bracket (<strong>&gt;<\/strong>).<\/li>\n<li>A <strong>milestone tag<\/strong> represents what is called an <strong>empty element<\/strong>: an element that does not have any content. These empty elements can be used to point to a specific point in the text, rather than to a selection of text. A good example of an empty element is the\u00a0one that represents a pagebreak: <a title=\"&lt;pb\/&gt;\" href=\"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/encoding-text\/pb\/\"><code>&lt;pb\/&gt;<\/code><\/a>. A milestone tag starts with an opening angled bracket (<strong>&lt;<\/strong>), followed by the element&#039;s name (here: <strong>pb<\/strong>), and ends with a backslash and a closing angled bracket (<strong>\/&gt;<\/strong>).<\/li>\n<\/ol>\n<p style=\"text-align: justify;\">[table]<br \/>\nNo.,type,description,example<br \/>\n1,opening tag,opens an element,&#034;&lt;text&gt;&#034;<br \/>\n2,closing tag, closes an element,&#034;&lt;\/text&gt;&#034;<br \/>\n3,milestone tag, represents an empty element,&#034;&lt;pb\/&gt;&#034;<br \/>\n[\/table]<\/p>\n<hr \/>\n<h3 style=\"text-align: justify;\">Nesting<\/h3>\n<p style=\"text-align: justify;\">Tags beget tags. In the following\u00a0example,\u00a0<a title=\"&lt;text&gt;\" href=\"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/encoding-text\/text\/\"><code>&lt;text&gt;<\/code><\/a>\u00a0is what we call the <strong>parent tag<\/strong> of\u00a0<a title=\"&lt;body&gt;\" href=\"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/encoding-text\/147-2\/\"><code>&lt;body&gt;<\/code><\/a>\u00a0and\u00a0<a title=\"&lt;body&gt;\" href=\"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/encoding-text\/147-2\/\"><code>&lt;body&gt;<\/code><\/a>\u00a0is the <strong>child tag<\/strong> of\u00a0<a title=\"&lt;text&gt;\" href=\"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/encoding-text\/text\/\"><code>&lt;text&gt;<\/code><\/a>.<\/p>\n<div class=\"panel panel-info \"><div class=\"panel-body\"><\/p>\n<p>[xml]\n&lt;text&gt;<br \/>\n\t&lt;body&gt;The body of the text&lt;\/body&gt;<br \/>\n&lt;\/text&gt;[\/xml]<\/p>\n<p><\/div>\n<\/div>\n<p style=\"text-align: justify;\"><div class=\"panel panel-danger \"><div class=\"panel-heading\">\nImportant!<\/div>\n<div class=\"panel-body\"><\/p>\n<p style=\"text-align: justify;\">For an XML document to work, it needs to be well-formed. That means that all <strong>child tags<\/strong> have to be properly nested inside their <strong>parent tags<\/strong> like <a title=\"Matryoshka\" href=\"http:\/\/en.wikipedia.org\/wiki\/Matryoshka_doll\">Russian Matryoshka dolls<\/a>.<\/p>\n<p style=\"text-align: justify;\"><\/div>\n<\/div><\/p>\n<p style=\"text-align: justify;\"><div class=\"panel panel-info \"><div class=\"panel-heading\">\nFor example:<\/div>\n<div class=\"panel-body\"><\/p>\n<p>[xml highlight=&#034;3&#034;]\n&lt;text&gt; &lt;body&gt;&lt;\/body&gt; &lt;\/text&gt;<\/p>\n<p>is CORRECT[\/xml]<\/p>\n<p><em>while:<\/em><\/p>\n<p>[xml highlight=&#034;3&#034;]\n&lt;text&gt; &lt;body&gt;&lt;\/text&gt; &lt;\/body&gt; <\/p>\n<p>is INCORRECT[\/xml]<\/p>\n<p style=\"text-align: justify;\"><\/div>\n<div class=\"panel-footer\">\nNB: If you nest your tags incorrectly, your XML-document\u00a0will produce an error when you try to visualize it in a browser.<\/p>\n<p style=\"text-align: justify;\"><\/div>\n<\/div><\/p>\n<hr \/>\n<p><a name=\"Validation\"><\/a><\/p>\n<h3 style=\"text-align: justify;\">Validation<\/h3>\n<p style=\"text-align: justify;\">While your XML will\u00a0<strong>work<\/strong> (i.e.: be able to be displayed in a browser without producing any errors) as long as it is\u00a0<strong>well-formed<\/strong>, it also needs to be <b>valid\u00a0<\/b>if you want other people to be able to use and process it. In our case, because we work with <a title=\"TEI\" href=\"http:\/\/www.tei-c.org\">TEI<\/a>-compliant XML, this means that our code will need to comply\u00a0to the <a title=\"TEI Guidelines\" href=\"http:\/\/www.tei-c.org\/Vault\/P5\/2.3.0\/doc\/tei-p5-doc\/en\/html\/\">TEI Guidelines<\/a>.<\/p>\n<p style=\"text-align: justify;\">These guidelines do not only specify <strong>which<\/strong> tags we can use (e.g.: that <a title=\"&lt;p&gt;\" href=\"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/encoding-text\/p\/\"><code>&lt;p&gt;<\/code><\/a> describes\u00a0a paragraph, or that <a title=\"&lt;del&gt;\" href=\"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/encoding-text\/del\/\"><code>&lt;del&gt;<\/code><\/a> describes a deletion); they also contain a strict set of rules to\u00a0specify exactly\u00a0<strong>how<\/strong> we can use those tags. For example, they specify that the <a title=\"&lt;body&gt;\" href=\"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/encoding-text\/body\/\"><code>&lt;body&gt;<\/code><\/a> tag (which represents a body of text) must always be the direct child of\u00a0a <a title=\"&lt;text&gt;\" href=\"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/encoding-text\/text\/\"><code>&lt;text&gt;<\/code><\/a> tag. This means that<\/p>\n<div class=\"panel panel-info \"><div class=\"panel-body\"><\/p>\n<p>[xml highlight=&#034;8&#034;]\n&lt;TEI&gt;<br \/>\n\t&lt;text&gt;<br \/>\n\t\t&lt;body&gt;<br \/>\n\t\t&lt;\/body&gt;<br \/>\n\t&lt;\/text&gt;<br \/>\n&lt;\/TEI&gt;<\/p>\n<p>is CORRECT[\/xml]<\/p>\n<p><\/div>\n<\/div>\n<p style=\"text-align: justify;\">while:<\/p>\n<div class=\"panel panel-info \"><div class=\"panel-body\"><\/p>\n<p>[xml highlight=&#034;6&#034;]\n&lt;TEI&gt;<br \/>\n\t&lt;body&gt;<br \/>\n\t&lt;\/body&gt;<br \/>\n&lt;\/TEI&gt;<\/p>\n<p>is INCORRECT[\/xml]<\/p>\n<p><\/div>\n<\/div>\n<p style=\"text-align: justify;\">To help you to follow these rules without having to look them up in the TEI Guidelines for every tag, we have decided to start de description of every tag with a table that contains that tag&#039;s <b>validation information<\/b>.\u00a0Those tables should speak for themselves: every tag\u00a0<strong>must be<\/strong> the direct child of one of the tags in its\u00a0<strong>Contained by<\/strong> section, and every tag\u00a0<strong>can only be<\/strong> the parent tag of those tags specified in its\u00a0<strong>May Contain<\/strong> section. (The table also contains a list of the attributes that tag can contain, but we&#039;ll get to that in the next section when we&#039;re discussing <a title=\"Attributes and Their Values\" href=\"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/?page_id=171\">Attributes and their Values<\/a>.)<\/p>\n<p style=\"text-align: justify;\">The BDMP&#039;s full validation schema can also be downloaded from our <a title=\"4. Validation\" href=\"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/the-tags\/4-validation\/\">Validation<\/a> page.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Elements Elements are the building blocks\u00a0of markup languages such as XML. This is an example of a text element: An element starts\u00a0with an opening tag (here: &lt;text&gt;), followed by its content (here: This is the text), and ends with a closing tag (here: &lt;\/text&gt;). Tags Tags mark the start and the beginning of an element. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":19,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-169","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/wp-json\/wp\/v2\/pages\/169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/wp-json\/wp\/v2\/comments?post=169"}],"version-history":[{"count":5,"href":"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/wp-json\/wp\/v2\/pages\/169\/revisions"}],"predecessor-version":[{"id":2403,"href":"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/wp-json\/wp\/v2\/pages\/169\/revisions\/2403"}],"up":[{"embeddable":true,"href":"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/wp-json\/wp\/v2\/pages\/19"}],"wp:attachment":[{"href":"https:\/\/bdmpmanual.uantwerpen.be\/index.php\/wp-json\/wp\/v2\/media?parent=169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}