Presentation is loading. Please wait.

Presentation is loading. Please wait.

Hope Greenberg Center for Teaching & Learning

Similar presentations


Presentation on theme: "Hope Greenberg Center for Teaching & Learning"— Presentation transcript:

1 Hope Greenberg Center for Teaching & Learning
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 What is XML? A markup language for describing structured documents.
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 What is the TEI? Text Encoding Initiative founded in 1987.
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 Why use the TEI? With HTML you could do this:
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 Why use the TEI? With CSS you could add some classification:
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 Why use the TEI? <stage>Enter KING.</stage>
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 Extracting the Information
XML: What, Why, When and How Extracting the Information For all speeches where type=“female” list speaker and speech For all speeches where type=“Queen” list by line number Select and print all stage directions by act and scene

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

10 XML File: The Pieces Declaration (what am I?)
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…)

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

12 XML File: The Pieces Elements <p>Hello World!</p>
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 & & & Text or other: external <!ENTITY lady SYSTEM “ NDATA jpeg><figure entity=“lady”></figure>

13 XML File: Some Rules XML documents use a self-describing syntax.
XML: What, Why, When and How XML File: Some Rules XML documents use a self-describing syntax. 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.


Download ppt "Hope Greenberg Center for Teaching & Learning"

Similar presentations


Ads by Google