SlideServe
Menu
Préférences
© SlideServe · v2026

Understanding XML Namespaces and The SICK ROSE Poem

rosine avatar
11 diapositives · 249 Views · Sep 29, 2014

This document explores the poem "The SICK ROSE" by William Blake, along with an in-depth analysis of XML namespaces and data models. It elucidates the poem's themes of love and destruction through metaphorical language. Additionally, it provides a comprehensive guide to XML elements and attributes, including serialization, entity references, and character references. The content illustrates how XML namespaces function to prevent naming collisions in complex documents, ensuring clear and concise data representation across diverse software systems.

Understanding XML Namespaces and The SICK ROSE Poem - slide 1
01 / 11Understanding XML Namespaces and The SICK ROSE Poem
1 / 17

Télécharger la présentation

Understanding XML Namespaces and The SICK ROSE Poem
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Intro to TEITomaž ErjavecXML entities and namespaces Zadar, 2010

  2. poem stanza stanza title line line line line line line line line The SICK ROSE O Rose thou art sick The invisible worm, That flies in the night In the howling storm: Has found out thy bed Of crimson joy And his dark secret love Does thy life destroy. XML data model • <poem><title>The SICK ROSE</title> <stanza><line>O Rose thou art sick.</line> <line>The invisible worm,</line> <line>That flies in the night</line> <line>In the howling storm:</line></stanza> <stanza><line>Has found out thy bed</line> <line>Of crimson joy:</line> <line>And his dark secret love</line> <line>Does thy life destroy.</line></stanza></poem> serialization ~ data model

  3. Empty elements • elements with content: <tag> … </tag> • empty elements have no content:<tag/> • used for indicating “points” in the document, for example page breaks • formally<tag/> = <tag></tag>

  4. Entities • XML documents can also contain entity references, which are, when processing the document, substituted by their interpretation (the entity) • an entity reference starts with the character ampersand and ends with the semicolon: &…; • a few entities are predefinirane in XML: &lt;= < &gt;= > &amp;= & &apos; ='&quot; =" • < and & are “magic” characters and must always be escaped when using them in the text: • 1 < 2 must be written as 1 &lt; 2 • Procter & Gamblemust be written as Procter &amp; Gamble • entities are also used for other purposes

  5. Character references • Character references are used for cases where certain characters cannot represented (entered, stored, transmitted, displayed) directly. • Character reference starts with • &# followed by the decimal number of the character, or by • &#x followed by the hexadecimal number of the character, and ending with ;, e.g.: Saarbr&#252;cken • When processing, such references are substituted by their Unicode codepoint • Codepoints can be found on the Unicode Web pages

  6. XML namespaces A single XML document may contain elements and attributesthat are defined for and used by multiple software modules. Such documents, containing multiple markup vocabularies, pose problems of recognition and collision. Software modules need to be able to recognize the elements and attributes which they are designed to process, even in the face of "collisions" occurring when markup intended for some other software package uses the same element name or attribute name. XML namespaces allow constructions of names so as to avoid clashes between names from different markup vocabularies. This is accomplished by assigning expanded namesto elements and attributes.

  7. XML Namespaces provide a two-part naming system for element types and attributes The xmlns prefixed attributes give the URI and the local prefix of the namespaces Qualified names consist of the prefix, colon, and local part of the name The meaning of the prefix of qualified names is inherited - and possibly overridden - by child elements The default namespace is introduced by the attribute xmlns, without a local prefix

  8. <?xml version="1.0" ?> <html:html xmlns:html="http://www.w3.org/HTML/1998/html4" xmlns:nms="http://www.names.net/address"> <html:head><html:title>Addresses</html:title></html:head> <html:body> <nms:addresses nms:version="1.0"> <html:hr/> <nms:person> <nms:title>Mr.</nms:title> <nms:first>Simon</nms:first> <nms:last>Schuster</nms:last> </nms:person> <html:hr/> <!-- ... --> </html:body> </html:html>

  9. <?xml version="1.0" ?> <html xmlns="http://www.w3.org/HTML/1998/html4" xmlns:nms="http://www.names.net/address"> <head><title>Addresses</title></head> <body> <nms:addresses nms:version="1.0"> <hr/> <nms:person> <nms:title>Mr.</nms:title> <nms:first>Simon</nms:first> <nms:last>Schuster</nms:last> </nms:person> <hr/> <!-- ... --> </body> </html>

  10. XML Namespace Myths There is less to XML Namespaces than meets the eye! The URI is not a URL - it does not need to refer to a DTD or to be accessible; it is never resolved: <?xml version="1.0" ?> <isbn:book xmlns:isbn="urn:ISBN:0-395-36341-6“xmlns:nms="booya://completely-silly-address/ha/ha"> ... The XML Namespaces recommendation is compatible with XML 1.0, hence it does not provide a way to validate a document against two or more DTDs; in fact, it is almost impossible to validate a document using XML Namespaces against a DTD.

  11. Namespaces and TEI With any luck, the only time you will see namespaces in TEI documents is on the root element: <TEI xmlns=“http://www.tei-c.org/ns/1.0”> However, you will need to deal with them if you ever program in XSLT!