606625ec253338dbc163e2ed16a54d0d.ppt
- Количество слайдов: 42
ECT 360 Introduction to the Class Prof. Robin Burke ECT 360 Fall 2004
Outline Introductions ¢ Course and Syllabus ¢ XML ¢ XHTML ¢ Homework #1 ¢
Introductions ¢ Student information sheet
Administrativa ¢ Contacting me l l l ¢ Questions l l l ¢ CS&T 453 x 25910 rburke@cs. depaul. edu Try the course discussion forum Automatically mailed to all students I will also post announcements here Course web site l http: //josquin. cs. depaul. edu/~rburke/courses/ f 04/ect 360/
About Me 3 rd year at CTI ¢ Ph. D in AI, 1993 ¢ Research ¢ AI applications in E-Commerce l "smart catalogs" l Taught web development since 1996 ¢ What I hope to get out of teaching this class ¢
Course ¢ Introduction to XML l l ¢ concentrate on XML's uses for the web many other uses! Three parts l l XML standard XML validation XML transformations Some DOM programming
Course cont'd Seven homework assignments ¢ Midterm project ¢ Final project ¢ Allocation ¢ Homework – 40% l Midterm project – 30% l Final project – 30% l
Midterm project ¢ ¢ ¢ Instead of a midterm 10/6 Two-person teams Choose an XML language and report on it Possibilities l l SVG, Voice. ML, XSL-FO, Math. ML, SMIL, SOAP, WSDL, UDDI, BPEL 4 WS, XBRL anything else you think interesting
Midterm project Proposal ¢ Due next week 9/15 ¢ Email message with the following ¢ Name / email address for each partner l 1 st/2 nd/3 rd choice for XML application l
Grading ¢ ¢ Three Components Knowledge l Does the work display correct technical knowledge? Reasoning l Does the work indicate good problem-solving skills? Communication l Written work: Is the answer well-written English? l Code: Does the answer display good coding / documentation style
Grading, cont'd ¢ A = Excellent work l l ¢ B = Very good work l l ¢ Complete knowledge of the subject matter No major errors of reasoning in problem solutions Competent written answers Readable coding style C = Average work l l ¢ Thorough knowledge of the subject matter Well-considered and creative solutions Well-written answers Employment of impeccable coding style Some gaps in knowledge of subject matter Some errors or omissions in problem solving Written answers may contain grammatical and other errors Coding may be stylistically awkward D = Below average work l l Substantial gaps in knowledge of subject matter. Problem solving incomplete or incorrect Poor English in written answers Ineffective coding style
Resources ¢ Text l ¢ Carey, P. New Perspectives on XML (Comprehensive). Thomson Learning Tools l XML Spy • 4. 3 included with book l XML Spy Enterprise 2004 • available in 7 th floor lab
Discussion enhancement ¢ Card distribution
XML e. Xtensible Markup Language ¢ Misnomer ¢ Not a language l Technology for creating languages l
XML ¢ ¢ ¢ Looks a little bit like HTML But with a wide variety of tag names Reason l HTML and XML have a common ancestor • SGML l ¢ Developed for entry and management of very large documents Why do we need XML?
Web publishing with HTML ¢ ¢ ¢ Develop content Determine how content should be displayed on pages Encode content in HTML Content available to users Problem l what happens when content changes • design decisions must be rethought l what happens when design changes • HTML must be rewritten l designer and author must work closely
Web publishing with XML Develop XML application for content ¢ Develop content ¢ Content encoded in XML ¢ Design pages ¢ Write stylesheet to render pages in HTML ¢ Content available to users ¢
Benefits If design changes, only stylesheet is affected ¢ Different pages / displays can be generated from the same content ¢ Designer and author need not interact ¢
Big picture ¢ Modularity is a good thing l l ¢ decoupling of data's structure from its use in a particular application lowers effort of repurposing data Modularity requires standards l non-application specific data representation • not in the interest of any application vendor ¢ XML is the language in which such standards can be expressed
XML applications Purpose-specific languages that conform to the XML standard ¢ Many are standardized ¢ In-house languages easy to develop ¢ XML is becoming the default choice for data storage format ¢ l MS Office 2003
Example: Syllabus <syllabus xmlns="http: //josquin. cs. depaul. edu/~rburke/namespaces/sylla bus"> <course-number>ECT 360</course-number> <course-title>Introduction to XML</course-title> <prereqs> <note>One quarter of programming</note> <and> <or> <course-number>CSC 211</course-number> <course-number>CSC 261</course-number> <equivalent/> </or> <course-number>IT 130</course-number> </and> </prereqs> </course>. . . see full example. . .
Note Structure determined by needs of application ¢ Other design choices could be made ¢ separate components of course number l text for prerequisites l
Note Mixed content ¢ Use of external namespaces ¢ Entities ¢ Internal referencing ¢
The rules of XML ¢ ¢ Documents consist of elements, attributes and content l (and a few other things) Elements are set off by tags in angle brackets l start tag for element foo <syllabus> l end tag for element foo </syllabus> Anything in between the start tag and end tag is element content Attributes are additional data associated with an element l indicated by name/value pairs inside the start tag • <hwk ref="hwk 2">
More rules ¢ ¢ Comments l enclosed by special character sequence l <!-- --> Document prolog l before the first element l contains declarations l typically • declare that it is xml • declare the relevant document type ¢ Processing instructions l information that the XML parser doesn't use l passed along to the application l Special tag <?
Entities ¢ Special characters l l Certain characters part of the language Need a way to indicate these • < < ¢ Entities can be defined as part of a document type l l useful for inserting standard text ©right; might insert a standard copyright notice
Document tree Document is just one form of XML ¢ More useful for computation ¢ l Tree representation
XML Tree
Tree ¢ Nodes elements l text nodes l ¢ Attribute lists
Paths A path traverses the tree ¢ XPath provide syntax for tree traversal ¢ Example ¢ l /section[2]/meeting[1]/day/
Transformation ¢ XML transformations change the XML tree adding l deleting l changing contents l
Well-formed vs valid ¢ A well-formed document is one that obeys the syntactic rules l l <foo bar="2"><baz>thud</baz>&zap; </foo> l ¢ it can be parsed well-formed document A valid document has been validated against some standard l l l what is the entity zap? is baz a legal subelement for foo? unknown without a definition for foo
XML Validation is the process of checking an XML document against a standard ¢ Different languages for defining such standards ¢ DTD – document type definition l XML Schema l RELAX NG l others l
Document type ¢ The document type specifies the legal structure of the XML document order, contents of elements l legal attributes and default values l etc. l ¢ Designing a document type means deciding what data will be stored and how
HTML ¢ ¢ HTML is not XML-compliant XML is case-sensitive l ¢ XML requires quotes around attributes l ¢ HTML optional XML requires end tags l ¢ HTML is not Optional in some cases for HTML XML requires /> syntax for empty elements l HTML does not
XHTML ¢ ¢ ¢ Latest HTML standard Makes HTML XML-conformant Different flavors l Transitional • allows style information as part of the document (align attribute) l Frameset • allows frames l Strict • no frames, no style attributes • assumes use of a stylesheet for rendering
Benefits of XHTML ¢ XML l ¢ decouples data from application XHTML decouples content from style l for web documents l
Modularity = More pieces
More pieces = More flexibility
Converting to XHTML ¢ No sloppiness l l tags must nest end tags everywhere quotes on attribute values remove deprecated elements / attributes • replace with style ¢ XML-specific l /> for empty elements • like img l declarations • xml • doctype • namespace l lowercase
Example HTML XHTML conversion ¢ Validation ¢ l on-line validator
Assignment #1 Convert a file to XHTML ¢ Use the online-validator or XML Spy ¢ Due ¢ before class time next week l submit to COL l
606625ec253338dbc163e2ed16a54d0d.ppt