1 / 12

XML Basics

XML Basics. Hope Greenberg Center for Teaching & Learning. XML: What, Why, When and How. What is HTML?. A set of markup tags for encoding elements of web documents. E ncoding is the addition of codes to text in order to make it possible for a computer to process that text.

alair
Download Presentation

XML Basics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XML Basics Hope Greenberg Center for Teaching & Learning

  2. XML: What, Why, When and How What is HTML? • A set of markup tags for encoding elements of web documents. • Encoding is the addition of codes to text in order to make it possible for a computer to process that text. • Interpretation of elements is built into a web browser, helped by CSS. • Presentational (sort of) not semantic. • Looks like: <p>Hello world.</p> <p class=“green”>Hello world.</p>

  3. XML: What, Why, When and How What is XML? • A markup language for describing structured documents. • Allows for creation of elements based on need. • Designed to be semantic (meaning is separate from presentation). • Looks like: <p>Hello world.</p> • But can also look like: <para>Hello world.</para>

  4. XML: What, Why, When and How What is the TEI? • Text Encoding Initiative founded in 1987. • Guidelines for encoding machine-readable texts in the humanities and social sciences. • Includes standardized ways to mark up a document’s semantics.

  5. XML: What, Why, When and How Why use the TEI? • With HTML you could do this: <p>Enter KING.</p> <p>Queen.</p> <p> Alas, look here, my lord.</p> <p> Ophelia speaks </p> <p> Oph.</p> <p>Song.</p> <p>Larded all with sweet flowers,</p>

  6. XML: What, Why, When and How Why use the TEI? • With CSS you could add some classification: <p.stage>Enter KING.</p> <p.speaker>Queen.</p> <p.speech> Alas, look here, my lord.</p> <p.stage> Ophelia speaks </p> • and then tell the CSS to make each class LOOK different.

  7. XML: What, Why, When and How Why use the TEI? <stage>Enter KING.</stage> <sp who="Queen” type=“female”> <speaker >Queen.</speaker> <l n="37" part="Y"> Alas, look here, my lord.</l> </sp> <sp who="Oph” type=“female”> <speaker>Ophelia</speaker> <stage>Song. </stage> <l n="38"> Larded all with sweet flowers,</l>

  8. XML: The Pieces XML: What, Why, When and How css web xhtml.xsl XML File print.xsl mobil.xsl Mobil device Schema/DTD Parser

  9. XML: What, Why, When and How XML File: The Pieces • Declaration (what am I?) • Processing Instructions (what will you do with me?) • Elements (what am I made of?) • (tag, attributes, content: PCDATA) • Entities (what else do we need?) • Character, files, • Comments (secret messages) • CDATA (just like this or else…)

  10. XML: What, Why, When and How XML File: The Pieces • Declaration <?xml version=“1.0” encoding=“UTF-16” standalone=“yes”> • Processing instruction <?xml-stylesheethref=“classic.xsl” type=“text/xml”?>

  11. XML: What, Why, When and How XML File: The Pieces • Elements (tag, attributes, content: PCDATA) <p>Hello World!</p> <p type=“cliched”>Hello World!</p> • Entities • Character &amp; &#x26; &#38; • Text or other: external <!ENTITY lady SYSTEM “http://www.uvm.edu/~hag/lady.jpeg NDATA jpeg><figure entity=“lady”></figure>

  12. XML: What, Why, When and How XML File: Some Rules • XML tags are case sensitive. • All XML elements must have a closing tag. • All XML elements must be properly nested. • All XML documents must have a root element. • Attribute values must always be quoted.

More Related