4/8/99 C. Edward Chow Page 1 XML Edward Chow Some of the presentation material is adapted from articles at xml.com by Norman Walsh and Tim Bray.Norman Walsh Tim Bray Code and information provided by Tim Bray of Texturality on a XML-HTML converter and John Bower of Microsoft on VML are greatly appreciated.
4/8/99 C. Edward Chow Page 2 XML: eXtensible Markup Language A markup language for “richly” structured documents. Structure documents with content info, and structural info. Markups (tags) are used to specify the structural info. It was approved as a W3C recommendation in 2/10/98. It was used as a meta language to specify other markup languages, called XML applications. The list of XML applications grows fast: –SMIL (Synchronized Multimedia Integration Language) –MathML (Math Markup Language) –VML (Vector Graphic Markup Language) –E-commerce transactions, Server API, …
4/8/99 C. Edward Chow Page 3 A SMIL XML Document <audio src="audio/vodpaper.ra" id="Soundtrack 2" title="Soundtrack 2" begin="2s" end="8s" /> <video src="file:///d:/uccs/cs525/doc/videof/uccs.avi" id="videoclip 1" title="video clip 1" /> <audio src="audio/kissingcamel.ra" id="Soundtrack 3" title="kissingcamel" begin="id(Soundtrack 1)(end)"/>
4/8/99 C. Edward Chow Page 4 MathML For (a + b) 2 a + b 2
4/8/99 C. Edward Chow Page 5 VML v\:* {behavior:url(#default#VML);} <v:shape style='top: 0; left: 0; width: 250; height: 250' stroke="true" strokecolor="red" strokeweight="2" fill="true" fillcolor="green" coordorigin="0 0" coordsize=" "> <v:path v="m 8,65 l 72,65,92,11,112,65,174,65,122,100, 142,155,92,121,42,155,60,100 x e"/>
4/8/99 C. Edward Chow Page 6 How XML is used XML SMILMathMLVML XML applications (Languages) Specify XML (Parser) Processor (Specific) Application XML Document XML capable Server/Client Text editor Perl Scripts XML editor
4/8/99 C. Edward Chow Page 7 XML vs. HTML The tag semantics and tag set are “rather” fixed. With CSS1 you can create your own tags. The standard body adds and depreciates tags slowly. XML specifies neither semantics nor tag set. It is a meta-language for describing markup language, i.e., define tag set. The semantics of an XML document will either be defined by the applications process them or by the stylesheet.
4/8/99 C. Edward Chow Page 8 XML vs. SGML XML is a restrict form (application profile) of Standard Generalized Markup Language (SGML). The syntax of XML specified as Extended Backup-Naur Form (EBNF). Modern compiler technique makes the parsing of EBNF-based XML documents fast. The full blown SGML syntax is much more complex and a parser can not be easily made and SGML documents take longer time to process.
4/8/99 C. Edward Chow Page 9 XML Development Goals View XML documents quick and easy as HTML documents. Support wide-variety of applications: authoring, browsing, content analysis,… Compatible with SGML, allow easy conversion of SGML documents to XML. Easy to write programs that process XML documents. (2 weeks for CS graduate). Option features keep to minimum or zero. XML documents should be human-legible and reasonable clear. View with text editor.
4/8/99 C. Edward Chow Page 10 XML Development Goals (2) XML design can be prepare quickly. XML design shall be formal and concise must be expressed in EBNF, amendable to modern compiler tools and techniques. XML document shall be easy to create. Terseness in XML markup is not (minimal) important.
4/8/99 C. Edward Chow Page 11 How is XML Defined? Extensible Markup Language (XML) 1.0 SpecificationExtensible Markup Language (XML) 1.0 Specification 10 February 1998, Tim Bray, Jean Paoli, C. M. Sperberg-McQueen. XML Linking Language (XLink) 3 March 1998, Eve Maler, Steve DeRose XML Pointer Language (XPointer) 3 March 1998, Eve Maler, Steve DeRose Extensible Stylesheet Language (XSL) 16 December 1998, James Clark, Stephen Deach Namespaces in XML 14 January 1999, Tim Bray, Dave Hollander,Andrew Layman
4/8/99 C. Edward Chow Page 12 A Simple XML Document <? For processing instruction Say goodnight Gracie. Goodnight, Gracie. /> for empty element which does not have end-tag
4/8/99 C. Edward Chow Page 13 Embed HTML in XML --> <article xmlns=" xmlns:html="any-old-bollocks" > Test XML, name space, HMTL tag It seems to be critical to include < ?xml-stylesheet href="first-x.css" type="text/css" ?> Otherwise it won't work. The following is the demonstration of < html:ul> and < html:li> tags. What is XML How to create it
4/8/99 C. Edward Chow Page 14 Six Types of Markups in XML Elements: begin with start tag, ends with end-tag Entity references: speicial characters, repeated text, external file content Comments: Processing Instructions: to be pass to application. Marked (CDATA) Sections: transparent text What if we have ]]> as part of the text? Document Type Declarations