web based information course content systems
play

Web-Based Information Course Content Systems Introduction Perl - PowerPoint PPT Presentation

Web-Based Information Course Content Systems Introduction Perl & Cookies Internet and WWW SGML / XML Fall 2006 Protocols CORBA & SOAP HTML and beyond Web Services CMPUT 410: SGML to XML


  1. Web-Based Information Course Content Systems • Introduction • Perl & Cookies • Internet and WWW • SGML / XML Fall 2006 • Protocols • CORBA & SOAP • HTML and beyond • Web Services CMPUT 410: SGML to XML • Animation & WWW • Search Engines • CGI & HTML Forms • Recommender Syst. Dr. Osmar R. Zaïane • Javascript • Web Mining • Databases & WWW • Security Issues • Dynamic Pages • Selected Topics University of Alberta Web Services 1 2  Dr. Osmar R. Zaïane, 2001-2006 Web-based Information Systems University of Alberta  Dr. Osmar R. Zaïane, 2001-2006 Web-based Information Systems University of Alberta Outline of Lecture 11 Objectives of Lecture 11 SGML to XML SGML to XML • Brief Overview of SGML and the Origin of XML • Introduce the Extensible Markup Language • Introduction to XML XML and discuss its use. • Examples of XML Documents • Understand the parsing of XML documents • Syntax and Document Type Definition and how XML can be translated to HTML • Parsing XML for display • See examples of XML • Displaying XML: Style (XSL) & Transformation (XSLT) • Examples and Case Study  Dr. Osmar R. Zaïane, 2001-2006 3  Dr. Osmar R. Zaïane, 2001-2006 4 Web-based Information Systems University of Alberta Web-based Information Systems University of Alberta

  2. Brief Overview of SGML & the Origin of XML SGML, What is it for? • Separation: Syntax rules + content • SGML stands for Standard Generalized Markup • Many sophisticated options document DTD Language • SGML is a meta language, a language for defining other • Focuses on content structure languages. • Very powerful for creating: document document DTD • It was developed in the 1970s and was used by large document – Manuals corporations for representing content of large – Books documents. – Catalogs • SGML is very flexible and provides a set of features for – Document collection describing content of small documents such as short memos, or very long and complex documents such as – … technical manuals in several printed volumes. 5 6  Dr. Osmar R. Zaïane, 2001-2006 Web-based Information Systems University of Alberta  Dr. Osmar R. Zaïane, 2001-2006 Web-based Information Systems University of Alberta Simplified SGML Problems with SGML • SGML has too many optional features making • HTML is derived from SGML and so is XML the language complex • XML is a simplified version of SGML without the • SGML standard is very long and complicated many features that do not apply in the Web context. � difficult to maintain SGML � difficult to build parsers � difficult for programmers to write processing HTML XML programs � difficult to mark up content • XML is a meta-language with SGML flexibility and structure but without SGML complexities � Not always legible  Dr. Osmar R. Zaïane, 2001-2006 7  Dr. Osmar R. Zaïane, 2001-2006 8 Web-based Information Systems University of Alberta Web-based Information Systems University of Alberta

  3. Introduction to XML Outline of Lecture 11 • XML the eXtensible Markup Language is a • Brief Overview of SGML and the Origin of XML standard of the World-Wide Web Consortium • Introduction to XML • The official current version is 1.0 and was originally recommended in 1998 • Examples of XML Documents • The official specification from the W3C are: • Syntax and Document Type Definition http://www.w3.org/TR/1998/REC-xml-19980210 • Parsing XML • More info can be found at: • Displaying XML: Style (XSL) & Transformation (XSLT) http://www.w3.org/XML/ • Many working groups and advisory boards are • Examples and Case Study currently enhancing XML 9 10  Dr. Osmar R. Zaïane, 2001-2006 Web-based Information Systems University of Alberta  Dr. Osmar R. Zaïane, 2001-2006 Web-based Information Systems University of Alberta HTML vs. XML What is Special with XML <?xml version=“1.0” encoding=“ISO8859-1” ?> <Products> <product ID="123"> HTML • It is a language to markup data <HTML> <ProdName>Shovel</ProdName> <BODY> conveys the <price>10.59</price> <H1>Shovel</H1> <Quantity>4</Quantity> • There are no predefined tags like in HTML look-n-feel <H2>10.59</H2> </product> <H2>4</H2> <product ID="456"> <H1>Rake</H1> <ProdName>Rake</ProdName> • Extensible � tags can be defined and <H2>15.00</H2> <price>15.00</price> <HTML> <H2>1</H2> <Quantity>1</Quantity> <BODY> extended based on applications and needs <H1>Hoe</H1> </product> <Table border=1><TR> <H2>12.99</H2> <product ID="789"> <td>Shovel</td> <H2>2</H2> <ProdName>Hoe</ProdName> <td>10.59</td> <td>4</td> • Basically, you can create your own tags and </BODY> <price>12.99</price> </tr><tr> </HTML> <Quantity>2</Quantity> <td>Rake</td> </product> associate meanings to them <td>15.00</td><td>1</td> </Products> </tr><tr> Easy for us to <td>Hoe</td> In XML tags have pinpoint the • You need to follow rules for creating and <td>12.99</td> <td>2</td> </tr></table> meanings � easy for price of a hoe, </BODY> using tags </HTML> a program to find the but what about price of a hoe. a program?  Dr. Osmar R. Zaïane, 2001-2006 11  Dr. Osmar R. Zaïane, 2001-2006 12 Web-based Information Systems University of Alberta Web-based Information Systems University of Alberta

  4. XML inside HTML Rules for Creating XML Documents • Some browsers, such as Microsoft Internet Explorer allow XML inside an HTML document with the <XML> tag • Rule 1 : All terminating tags shall be closed <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <TABLE BORDER = "1" DATASRC = "#xmlDoc"> <BODY> – Omitting a closing XML tag is an error. Example: <THEAD> <XML ID = "xmlDoc"> <TR> <TH>Product Name</TH> <Products> <FirstName>Osmar</FirstName> <TH>Quantity</TH><TH>Price</TH></TR> <product ID="123"> </THEAD> <ProdName>Shovel</ProdName> <TR> • Rule 2 : All non-terminating tags shall be closed <price>10.59</price> <TD><SPAN DATAFLD = "ProdName"></SPAN></TD> <Quantity>4</Quantity> <TD><SPAN DATAFLD = "Quantity"></SPAN></TD> </product> – Omitting a forward slash for non-terminating tags is an error. <TD><SPAN DATAFLD = "price"></SPAN></TD> <product ID="456"> </TR> <ProdName>Rake</ProdName> Example <Available answer=“yes”/> </TABLE> <price>15.00</price> </BODY> <Quantity>1</Quantity> </HTML> • Rule 3 : XML shall be case sensitive </product> <product ID="789"> <ProdName>Hoe</ProdName> – Using the wrong case is an error. Example: <price>12.99</price> <Quantity>2</Quantity> <FirstName>Osmar</firstname> </product> </Products> – It is OK in HTML <H1>my header</h1> </XML> <XML ID=“xmlDoc” src=“products.xml”></xml> 13 14  Dr. Osmar R. Zaïane, 2001-2006 Web-based Information Systems University of Alberta  Dr. Osmar R. Zaïane, 2001-2006 Web-based Information Systems University of Alberta More Rules for Creating XML What is needed? • Rule 4 : An XML document shall have one root • XML needs to be parsed to check whether – Attempting to create more than one root element would generate a syntax error the documents are well formed • Rule 5 : Nesting tag terminations shall not be allowed • XML needs to be printed – Closing a parent tag before closing a child’s tag is an error. • XML needs to be interpreted for Example <Author><name>Osmar</Author></name> – It is OK in HTML <b><I>bold italic text</b></I> information exchange or populating • Rule 6 : Attributes shall be quoted database – Omitting quotes, either single or double, around and XML • XML needs to be queried efficiently attribute’s value is an error. Example <Product ID=“123”>  Dr. Osmar R. Zaïane, 2001-2006 15  Dr. Osmar R. Zaïane, 2001-2006 16 Web-based Information Systems University of Alberta Web-based Information Systems University of Alberta

Recommend


More recommend