CEAL Preconference Workshop XML Wooseob Jeong Assistant Professor
CEAL Preconference Workshop: XML Wooseob Jeong Assistant Professor School of Information Studies University of Wisconsin – Milwaukee March 2, 2004 San Diego, CA Sponsored by School of Information Studies, University of Wisconsin – Milwaukee University of California – San Diego Library 1
Why XML? o Simply because it’s already everywhere. n n n MS Office XHTML - WYSIWYG PDF RDF - Dublin Core, RSS MARC in XML E-books 2
What is XML? o o Extensible Markup Language XML is a concept, not an application. n n n o Meta Language Linguistics for individual languages XHTML is an application of XML. Brief history of XML n n SGML – HTML Not enough … why? 3
Learning XML o No technical experience needed. n n n o Even no HTML experience is welcome. HTML vs. XHTML (different families) Again, XML is a concept. Good starts on XML n http: //www. infomotions. com/musings/gettin g-started/ 4
XML is simple but very strict. o You can make your own mark up set as you like with minimal requirement. n n o Every tag should be paired. Tags should be in a hierarchy. However, once you establish the set, you have to follow it. It’s the law! No exception. Otherwise, your document won’t be displayed at all. n n “Well-formedness” – minimum requirement DTD (Document Type Definition) 5
Philosophy of XML o Separation of presentation information from its content. No decorating information allowed in contents. n n Presentation should be rendered by methods outside the document, currently either CSS or XSLT CSS has been used in HTML as well as in XML. o Ex) http: //www. uwm. edu/~dhedberg/MENU. xml XSLT is more powerful. o Ex) http: //web. utk. edu/~rgilmou 1/xml 4 lita/ More Examples 6
Markup information o Presentational Markup: Describe Appearance <blockquote> 1234 N. Oakland Ave. Milwaukee, WI 53201 </blockquote> o Semantic Markup: Indicates Meaning <address> <street>1234 N. Oakland Ave. </street> <city>Milwaukee</city> <state>WI</state> <zip>53201</zip> </address> 7
Your First XML Document o Using Note. Pad, please follow the instruction at n o http: //supervoca. com/xml/first. htm The result should look like n http: //supervoca. com/xml/first. xml 8
Restaurant Menu Exercise o o Well-formedness CSS (Cascading Style Sheet) n o XSLT (Extensible Stylesheet Language Transformations) n n o Simple but not flexible It is an xml document itself. Complex but really powerful Online Exercises 9
Menu CSS Exercise o o o Use Note. Pad and type yourself, please! Watch out “save as” option. Modify “menu. xml” with your favorite foods, adding CSS info. Modify “menu. css” with your prefences. Comprehensive CSS reference n http: //www. w 3 schools. com/css/default. asp 10
Menu XSLT Exercise o o o Modify “menu 2. xml” by adding XSLT info. Modify “menu 2. xsl” with your preference. It is like a limited programming language. n n o o Selective displays with the same data. Examples You may use HTML tags freely, but every attribute’s value should be quoted. Watch out typos! 11
Unicode in XML o o Unicode is the default character set in XML. What’s Unicode? n n o http: //unicode. org/ Why is it so important? Where is ASCII? Multilingual vs. Multiscript Word. Pad or MS Word should be used for Unicode documents. n Save as “Unicode Text” 12
“united. xml” <? xml version="1. 0"? > <? xml-stylesheet type="text/css" href="united. css"? > <united> <English>Eradicate extreme poverty and hunger</English> <Chinese>消�极端��和��</Chinese> <French>Réduire l'extrême pauvreté et la faim</French> <Russian>Ликвидация крайней нищеты и голода</Russian> </united> 13
“united. css” English {display: block; color=red} French {display: block; color=blue} Chinse {display: block; color=green} Russian {display: block; color=purple} 14
More Unicode Exercise o Multilingual/multiscript sources n n o o United Nations International Bible Society Since an XSLT file is an XML document, you can use any languages or any scripts in your XSLT. Only Windows 2000 or XP supports Unicode fully. CSS – “bible. xml” XSLT – “biblecjk. xml” 15
SMIL Exercise (1) o o o Synchronized Multimedia Integration Language Still an XML application! Multiple media are played together. n o Example: Closed Captioning. Real. Text Exercise n Based on Real Player setting 16
SMIL Exercise (2) o Locate an audio source. n o o Ex) Voice of America at http: //voanews. com Locate its transcript. Modify “example. smil” file according to your information. Modify “example. rt” file with your transcript. It can be a “Karaoke” application. 17
SMIL Exercise (3) o o o Online Exercise http: //supervocab. com/xml Locate any CJK real audio file on the web, and copy the URL to the form. n o o Ex) http: //homepage. thirdwave. com/didreat/kor/real. htm Type the script in CJK. Choose a character set and a font. n SMIL in Real Audio does still support local character sets only. 18
Document Type Definition o What is DTD? n n o The master plan dictates all the rules for elements, attributes, and entities. You may make your own DTD, but once you make it, you should follow the rule. No exception! Why is DTD important? n Data Exchange 19
Elements, Attributes, and Entities o Elements n o Attributes n o Building blocks of markup (tags) Qualifying Elements (properties) Entities n n Referencing External Content and Saving Typing Ex) special characters 20
DTDs o XHTML o TEI (Text Encoding Initiative) o EAD (Encoded Archival Description) o RDF (Resource Description Framework) n Dublin Core; RSS 21
Validation o To be a same type of document, it should be valid for its DTD. <!DOCTYPE TEI. 2 PUBLIC "-//TEI//DTD TEI Lite XML ver. 1. 1//EN" "http: //www. tei-c. org/Lite/DTD/teixlite. dtd"> o Online validation tool o Well-formedness vs. Validation 22
TEI Letter Transcript Exercise o o The purpose of this exercise is to make a valid TEI document transcribing a letter. Use a remote TEI DTD n n o o TEIXLite DTD <!DOCTYPE TEI. 2 PUBLIC "-//TEI//DTD TEI Lite XML ver. 1. 1//EN" "http: //www. teic. org/Lite/DTD/teixlite. dtd"> Modify “letter. xml” and “letter. css” with your text and preference. Do a validation test, please. 23
Dublin Core o o Most Frequent Example in RDF http: //dublincore. org/ <? xml version="1. 0"? > <!DOCTYPE rdf: RDF PUBLIC "-//DUBLIN CORE//DCMES DTD 2002/07/31//EN" "http: //dublincore. org/documents/2002/07/31/dcmes-xml-dtd. dtd"> <rdf: RDF xmlns: rdf="http: //www. w 3. org/1999/02/22 -rdf-syntax-ns#" xmlns: dc="http: //purl. org/dc/elements/1. 1/"> <rdf: Description rdf: about="http: //www. ilrt. bristol. ac. uk/people/cmdjb/"> <dc: title>Dave Beckett's Home Page</dc: title> <dc: creator>Dave Beckett</dc: creator> <dc: publisher>ILRT, University of Bristol</dc: publisher> <dc: date>2002 -07 -31</dc: date> </rdf: Description> </rdf: RDF> 24
RSS (RDF Site Summary) o o “Rich Site Summary” More practical and active example in RDF n n http: //supervocab. com/rss RSS feeds are so many on the web. o o o http: //mtgear. net/index. rdf http: //homepage. mac. com/cyberdog_to_go/ibl og/B 1549800066/rss. xml http: //blog. isism. net/b 2 rdf. php 25
Other important parts in XML (1) o XSL n n XSL Transformations XSL Formatting Objects o o Ex) PDF URI (Uniform Resource Identifiers) n n URL (Uniform Resource Locator) ISBN/ISSN 26
Other important parts in XML (2) o XLINK n n o More than what HTML links do Ex) inbound link information, behavior of links (when, how to activate) XPointer n n n More than what HTML anchors do XPointers refer to particular parts of or locations in XML documents. Ex) linking to the third sentence of the seventeenth paragraph in a document 27
Other important parts in XML (3) o Namespace n n n o An XML namespace is a collection of names, identified by a URI reference Problem: same element names Ex) title in HTML and title of a book Schema n n Alternative to DTD Data type 28
Popular E-book Formats o o Adobe: basically PDF Microsoft Palm Free E-book Projects n n o http: //etext. lib. virginia. edu/ebooks/ebooklist. html http: //www. sois. uwm. edu/xml/ Authoring tools n Universal CJK support cannot be found yet. 29
Conclusion o XML is a concept. n o o There are many XML applications. XML should separate its presentation information from its contents. XML’s default character set is Unicode. XML should be “well-formed” at least. DTD/Schema is very important for data/information interchange. 30
- Slides: 30