Feb 2001C.Watters1 Grammars, SGML, & XML Agreeing on the rules.

Slides:



Advertisements
Similar presentations
XML-XSL Introduction SHIJU RAJAN SHIJU RAJAN Outline Brief Overview Brief Overview What is XML? What is XML? Well Formed XML Well Formed XML Tag Name.
Advertisements

XML: Extensible Markup Language
ISO DSDL ISO – Document Schema Definition Languages (DSDL) Martin Bryan Convenor, JTC1/SC18 WG1.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-1 COS 346 Day 24.
1 CP3024 Lecture 9 XML revisited, XSL, XSLT, XPath, XSL Formatting Objects.
3 November 2008CIS 340 # 1 Topics To define XML as a technology To place XML in the context of system architectures.
CSE 190: Internet E-Commerce Lecture 17: XML, XSL.
1 COS 425: Database and Information Management Systems XML and information exchange.
XML A brief introduction ---by Yongzhu Li. XML --- a brief introduction 2 CSI668 Topics in System Architecture SUNY Albany Computer Science Department.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic XML.
DECO 3002 Advanced Technology Integrated Design Computing Studio Tutorial 5 – XML Basic School of Architecture, Design Science and Planning Faculty of.
Introduction to XML Extensible Markup Language
COS 381 Day 16. Agenda Assignment 4 posted Due April 1 There was no resubmits of Assignment Capstone Progress report Due March 24 Today we will discuss.
Introduction to XML Extensible Markup Language Carol Wolf Computer Science Department.
XML Introduction By Hongming Yu Feb 6 th, Index Markup Language: SGML, HTML, XML An XML example Why is XML important XML introduction XML applications.
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
Copyright © 2002 ProsoftTraining. All rights reserved. XML Document Design.
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
Why XML ? Problems with HTML HTML design - HTML is intended for presentation of information as Web pages. - HTML contains a fixed set of markup tags. This.
XML and XSL Institutional Web Management 2001: Organising Chaos.
IT420: Database Management and Organization XML 21 April 2006 Adina Crăiniceanu
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
Introduction to XML Eugenia Fernandez IUPUI. What is XML? From the World Wide Web Consortium (W3C) The Extensible Markup Language (XML) is the universal.
MSc IT Multimedia XML & XSLT P. Muneesawang. 2 Outline Why XML XSL.
XML What is XML? XML v.s. HTML XML Components Well-formed and Valid Document Type Definition (DTD) Extensible Style Language (XSL) SAX and DOM.
Chapter 1 Understanding the Web Design Environment Principles of Web Design, 4 th Edition.
1 © Netskills Quality Internet Training, University of Newcastle Introducing XML © Netskills, Quality Internet Training University.
XML 1 Enterprise Applications CE00465-M XML. 2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that.
XML - Why: The HTML-Dilemma HTML, SGML, XML - How: Syntax, Concept, Language Elements Basics Well-formed XML-Documents (without DTD) Valid XML-Documents.
What is XML?  XML stands for EXtensible Markup Language  XML is a markup language much like HTML  XML was designed to carry data, not to display data.
Sheet 1XML Technology in E-Commerce 2001Lecture 1 XML Technology in E-Commerce Lecture 1 WWW, HTML, CSS, XML, Meta-modeling.
Introduction to XML Extensible Markup Language. What is XML XML stands for eXtensible Markup Language. A markup language is used to provide information.
Intro. to XML & XML DB Bun Yue Professor, CS/CIS UHCL.
1 XML - Extensible Markup Language. 2 HTML - Hypertext Markup Language n HTML has a fixed tag set. n Use these tags to describe how information is to.
XML About XML Things to be known Related Technologies XML DOC Structure Exploring XML.
XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.
1 Chapter 10: XML What is XML What is XML Basic Components of XML Basic Components of XML XPath XPath XQuery XQuery.
Presentation Topic: XML and ASP Presented by Yanzhi Zhang.
XML Extensible Markup Language
XML 2nd EDITION Tutorial 1 Creating An Xml Document.
Windows Presentation Foundation (WPF) Chapter 16 Dr. Abraham.
XHTML By Trevor Adams. Topics Covered XHTML eXtensible HyperText Mark-up Language The beginning – HTML Web Standards Concept and syntax Elements (tags)
1 Introduction  Extensible Markup Language (XML) –Uses tags to describe the structure of a document –Simplifies the process of sharing information –Extensible.
Introduction to XML This presentation covers introductory features of XML. What XML is and what it is not? What does it do? Put different related technologies.
XML Instructor: Charles Moen CSCI/CINF XML  Extensible Markup Language  A set of rules that allow you to create your own markup language  Designed.
XP 1 Creating an XML Document Developing an XML Document for the Jazz Warehouse XML Tutorial.
ITB Web programming for E- Commerce 1 ITB6227 Programming for E-COMMERCE Lecture Presentation of XML Documents.
XML Design Goals 1.XML must be easily usable over the Internet 2.XML must support a wide variety of applications 3.XML must be compatible with SGML 4.It.
1 Tutorial 11 Creating an XML Document Developing a Document for a Cooking Web Site.
XML Engr. Faisal ur Rehman CE-105T Spring Definition XML-EXTENSIBLE MARKUP LANGUAGE: provides a format for describing data. Facilitates the Precise.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
XML A Language Presentation. Outline 1. Introduction 2. XML 2.1 Background 2.2 Structure 2.3 Advantages 3. Related Technologies 3.1 DTD 3.2 Schemas and.
Copyright © 2003 Pearson Education, Inc. Slide 1-1 Created by Cheryl M. Hughes The Web Wizard’s Guide to XHTML by Cheryl M. Hughes.
Technology for e-Commerce Overview XML Fall 2000C.Watters2 Outline Introduction History and Overview Show me the Code! Applications Protocols Conclusions.
XML CSC1310 Fall HTML (TIM BERNERS-LEE) HyperText Markup Language  HTML (HyperText Markup Language): December  Markup  Markup is a symbol.
XML Technology. Emerging Importance of XML –HTML-tagging is display oriented. –XML-based content tagging has important uses: data mining role-oriented.
Martin Kruliš by Martin Kruliš (v1.1)1.
C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
XML Notes taken from w3schools. What is XML? XML stands for EXtensible Markup Language. XML was designed to store and transport data. XML was designed.
Rendering XML Documents ©NIITeXtensible Markup Language/Lesson 5/Slide 1 of 46 Objectives In this session, you will learn to: * Define rendering * Identify.
I Copyright © 2004, Oracle. All rights reserved. Introduction.
1 Introduction to XML Babak Esfandiari. 2 What is XML? introduced by W3C in 98 Stands for eXtensible Markup Language it is more general than HTML, but.
Beyond HTML: Extensible Markup Language (XML)
Extensible Markup Language (XML) Pat Morin COMP 2405.
XML in Web Technologies
Database Processing with XML
XML Data Introduction, Well-formed XML.
CSE591: Data Mining by H. Liu
Presentation transcript:

Feb 2001C.Watters1 Grammars, SGML, & XML Agreeing on the rules

Feb 2001C.Watters2 Overview What is a grammar BNF notation Regular expressions Context free grammars (remember Chomsky) SGML HTML XML (finally) and the DTD

Feb 2001C.Watters3 What is a Grammar? A grammar is a set of rules which can generate a construct from a list of terminals determine if a construct obeys the rules (i.e. is well formed) Example - English construct is a sentence terminals are words

Feb 2001C.Watters4 Simple Grammar Sentence::= Subject Verb Subject::=(Pnoun | (def noun)) Pnoun::=(Joe | Mary) Verb::=(runs | sits) def::=(the | a | an) noun::=(boy | girl)

Feb 2001C.Watters5 Syntax not Semantics Let’s expand definition of noun terminals Noun::=(car | hat | TV) no problem with syntax! Hat running a little vague. They are flying planes. No problem with syntax. Semantics not so clear

Feb 2001C.Watters6 What is a grammar for anyway? 1. Parse Input Examines input and determines if it satisfies the rules of a given grammar  Joe Mary.  If(a<3){jump}  my page 2. Generate output Use the rules to generate well-formed entities  Joe runs.  If(a < 3){b=a}  my page

Feb 2001C.Watters7 BNF Backus Naur (or Normal) Form Notation for describing syntax of a language John Backus and Peter Naur, 1960’s for ALGOL Meta-symbols used ::= LHS is defined by RHS | or category name (defined somewhere else) Example ::= begin end;

Feb 2001C.Watters8 Useful extensions to BNF Optional [else ] repetitive items { | } recursion is allowed ::= | brackets for grouping ( | )

Feb 2001C.Watters9 Regular Expressions Simple way to express languages or strings eg. One ‘a’ followed by (one ‘n’ followed by one ‘d’) or by one ‘t’ a((n d) | t) note: may use + instead of |

Feb 2001C.Watters10 Regular Expressions include Concatenation\sequence A B Selection A|B Kleene Closure (0 or more) A* Positive Closure(1 or more) A + Bounded Repetition(1 to i) A i eg. A(n*| t) = {A, An, Ann, …, At}

Feb 2001C.Watters11 Context-Free Grammars CFG is a set of recursive productions used to generate patterns of strings satisfying the construct of the language SGML and its subsets, HTML and XML are context-free grammars! CFG are more powerful than Regular Expressions

Feb 2001C.Watters12 SGML Standardized General Markup Language Developed by a committee! Led by Charles Goldfarb, a grammar to define the structure of documents rules define the construct or structure terminals are and strings

Feb 2001C.Watters13 XML  DTDs  How to use it  Examples

Feb 2001C.Watters14 DTD - grammar definition for a document type Defines: element types (structure) attributes (terminals) constraints on combinations of these

Feb 2001C.Watters15 Element Type Declaration <!DOCTYPE GarageSale [ ]> today myhouse Rain or shine

Feb 2001C.Watters16 Sub-Elements  ? Means optional 1 or more 0 or more where Graphic etc are also defined as ELEMENTS

Feb 2001C.Watters17 Attributes Let you add extra information to elements CDATA=> character data

Feb 2001C.Watters18 Validating Parser A DTD (document type definition) defines the grammar of a type of document  memo  web page  book Validating Parser uses a DTD to check if a given document satisfies the rules of that grammar

Feb 2001C.Watters19 HTML & XML  HTML is a subset of SGML with a shared DTD  HTMLDOC::=( HEAD BODY )  XML is a subset of SGML with many DTD’s allowed “XML is like HTML with the training wheels off” -Dan Connolly, leader of XML activity at W3C

Feb 2001C.Watters20 XML Uses tags to identify semantics of data looks like HTML, but isn’t Introduction Carolyn Watters XML this and that is license free, platform-independent and well-supported

Feb 2001C.Watters21 HTML Hypertext Markup Language Hypertext Markup Language Presents documents via WWW browsers Document layout and hyperlink specifications Predefined set of tags (ie. Common DTD)

Feb 2001C.Watters22 Statistics Canada Welcome to Stats Canada Statistics Canada …….. We like numbers….. What we do Census Special surveys a href=“online.html”>Online data

Feb 2001C.Watters23 HTML HTML - Advantages Simple - fixed set of tags Portable - used with all browsers Linking - within and to external documents HTML - Disadvantages Limited tag set Can’t separate the definition from content Can’t define structure of contents

Feb 2001C.Watters24 XML XML allows anyone to define a document structure separate from its display structure Explicit Definition - DTD

Feb 2001C.Watters25 Some Code Schema Entity Passport Details SubEntities Last Name First Name Address Entity Address SubEntities Street City Town State Province ……..

Feb 2001C.Watters26 DTD

Feb 2001C.Watters27 Internal DTD and Instance <!DOCTYPE passport_details [ <!ELEMENT address (street,(city|town),(state|province),(ZIP|postal_code),country,contact_no?, * )> ]> Smith Jo Stephen 1 Great Street GreatCity GreatState 1234 GreatLand

Feb 2001C.Watters28 Shared DTD XML Document specifies the DTD Smith Jo Stephen 1 Great Street GreatCity GreatState 1234 GreatLand

Feb 2001C.Watters29 Coordinating Heterogenous Databases Separation of Structure / Content / Display Document Validity Checking Potential Use in Standards Importance of XML

Feb 2001C.Watters30 Example Boeing Boeing places a DTD on its site part purchasers use this DTD Boeing can use multiple XSL stylesheets

Feb 2001C.Watters31 Boeing (cont’d) customer creates an order document, they can verify the validity of that document against the DTD. this ensures they are transmitting only type- valid orders. in turn, Boeing can ensure they are receiving only type-valid documents.

Feb 2001C.Watters32 2. Using XML: DOM & SAX  DOM: Document Object Model  The DOM is a standard object application programming interface that gives developers programmatic control of XML document content, structure, formats, and more.  DOM defines a programmatic API for accessing XML documents.

Feb 2001C.Watters33 3. Using XML: presenting data  Need to convert XML tags into appropriate HTML tags for use in a browser!!  Smith  Smith Smith

Feb 2001C.Watters34 Stylesheets are used to present XML: The Cascading Stylesheet Specification (CSS) The Extensible Style Language (XSL) CSSXSL Can be used with HTML?YesNo Can be used with XML?Yes Transformation language?NoYes SyntaxCSSXML

Feb 2001C.Watters35 CSS and XSL CSS - Cascading Style Sheets can predefined HTML display (font etc) these are shared and reused XSL - XML Style language predefine display characteristics for XML entities transform into CSS for browsers to use

Feb 2001C.Watters36 Cascading Style Sheets CSS last_name { font-family: verdana, arial; font-size: 15pt; font-weight:bold; display: block; margin-bottom: 5pt; } first_name { font-family: verdana, arial; font-size: 15pt; font-weight:bold; display: block; margin-bottom: 5pt; } street, city, town, state, province, ZIP, postal_code { font-family: verdana, arial; font-size: 12pt; font-weight:bold; color:green; display:block; margin-bottom: 20pt; margin-top: 40pt; } { font-family: verdana, arial; font-size: 12pt; font-weight:bold; color:blue; display:block; margin-top: 5pt; }

Feb 2001C.Watters37 CSS Most local definition has precidence May be referred to (shared)

Feb 2001C.Watters38 <xsl:stylesheet xmlns:xsl=" xmlns=" result-ns=""> Address XSL (Style Language)

Feb 2001C.Watters39 Understanding A Template Most templates have the following form: The whole element is a template The match pattern determines where this template applies Literal result elements come from non-XSL namespace(s) XSLT elements come from the XSL namespace

Feb 2001C.Watters40 Options for displaying XML XML Document CSS Stylesheet CSS Stylesheet XSL Stylesheet XSL Stylesheet XML enabled Web Broswer XML enabled Web Broswer XML Display Engine XML Display Engine XSL Transformation spec HTML Document Web Broswer XSL Transformation

Feb 2001C.Watters41 2. Using XML: How does browser read XML ? XML parser: A tool for reading XML documents Microsoft's Internet Explorer 4.0 was the first Web browser to implement XML Netscape will support XML metadata in Communicator/Navigator 5.0 as a delivery component code-named Aurora.

Feb 2001C.Watters42 Desktop Middle - Tier Storage Display Multiple view created from the XML-base data Data Delivery, Manipulation: XML exchanged over HTTP manipulated via the DOM Data Integration XML emitted or generated from multiple source XML delivered to other applications or objects for further processing HTML view #1 (eg. Purchasing Agent) HTML view #2 (eg. Consumer) Web Server DB Access, Integration Business Rules (eg. Purchase order) Web Server DB Access, Integration Business Rules (eg. Purchase order) MainframeDatabase XML XML Architecture

Feb 2001C.Watters43 4. Case Study An example of XML Tree structure A simply example: Portfolio.xml Portfolio.xsl

Feb 2001C.Watters44.. story address bookstore menu body review logo name phone date reviewer person summary person books office supplies.. Tree Structure of the example

Feb 2001C.Watters45

Feb 2001C.Watters46 In the major Web Browser products. In Microsoft Office In every major database tool by end of In every HTML tool by end of CommerceNet believes that XML may just be the “killer application” needed to open up the Worldwide Web for Electronic Commerce. Is this for real?

Feb 2001C.Watters47 XML - Advantages Platform and system independent User-defined tags Doesn’t require explicit DTD Display format and content are separate XML - Disadvantages Requires a processing application “Pickier” than HTML Must be converted to HTML to view in browser Summary

Feb 2001C.Watters48 W3 Consortium: kazillions of XML books in every bookstore! Resources

Feb 2001C.Watters49 6. Reference Jon Bosak and Tim Bray, Scientific American, May 1999 [ Norman Walsh: What is XML? Oct. 3, 1998 [ Graphic Communications Association web site [ University College Cork [ Microsoft MSDN online samples [ [ Charles F. Goldfarb, Paul Prescod, The XML Handbook, 1998