University of Nottingham School of Computer Science & Information Technology Introduction to XML 1. The XML Language Tim Brailsford.

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

CSCI N241: Fundamentals of Web Design Copyright ©2004 Department of Computer & Information Science Introducing XHTML: Module B: HTML to XHTML.
DOCUMENT TYPES. Digital Documents Converting documents to an electronic format will preserve those documents, but how would such a process be organized?
What is XML? a meta language that allows you to create and format your own document markups a method for putting structured data into a text file; these.
XML and Enterprise Computing. What is XML? Stands for “Extensible Markup Language” –similar to SGML and HTML –document “tags” are used to define content.
1 XSLT – eXtensible Stylesheet Language Transformations Modified Slides from Dr. Sagiv.
1 © Netskills Quality Internet Training, University of Newcastle XML.
SPECIAL TOPIC XML. Introducing XML XML (eXtensible Markup Language) ◦A language used to create structured documents XML vs HTML ◦XML is designed to transport.
© De Montfort University, XML – a meta language Howell Istance and Peter Norris School of Computing De Montfort University.
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 3: XHTML Coding © 2007 Prosoft Learning Corporation All rights reserved ITD 110 Web Page.
HTML5 and CSS3 Illustrated Unit B: Getting Started with HTML
1 CP3024 Lecture 9 XML revisited, XSL, XSLT, XPath, XSL Formatting Objects.
XML Unit 6 October 31. XML, review XML is used to markup data Used to describe information Uses tags like HTML –But all tags are user-defined –Must be.
Tutorial 9 Working with XHTML
CS 898N – Advanced World Wide Web Technologies Lecture 21: XML Chin-Chih Chang
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.
Tutorial 11 Creating XML Document
Upgrading to XHTML DECO 3001 Tutorial 1 – Part 1 Presented by Ji Soo Yoon 19 February 2004 Slides adopted from
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
Introducing XHTML: Module B: HTML to XHTML. Goals Understand how XHTML evolved as a language for Web delivery Understand the importance of DTDs Understand.
Introducing HTML & XHTML:. Goals  Understand hyperlinking  Understand how tags are formed and used.  Understand HTML as a markup language  Understand.
Manohar – Why XML is Required Problem: We want to save the data and retrieve it further or to transfer over the network. This.
Topics The "bigger picture" –The "XML sales pitch" –XML/XHTML vs. SGML/HTML –XML in electronic publishing –XML and the future, web 2.0 XML basics: –Building.
XML – Extensible Markup Language Sivakumar Kuttuva & Janusz Zalewski.
Scientific Markup Languages Birds of a Feather A 10-Minute Introduction to XML Timothy W. Cole Mathematics Librarian & Professor of.
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.
Another PillowTalk Presentation  2004 Dynamic Systems, Inc. Introduction to XML for SOA Lee H. Burstein,
1 herbert van de sompel CS 502 Computing Methods for Digital Libraries Cornell University – Computer Science Herbert Van de Sompel
1 © Netskills Quality Internet Training, University of Newcastle Introducing XML © Netskills, Quality Internet Training University.
CS134 Web Design & Development Creating a Basic Web Page Mehmud Abliz.
XML 1 Enterprise Applications CE00465-M XML. 2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that.
XHTML. Introduction to XHTML What Is XHTML? – XHTML stands for EXtensible HyperText Markup Language – XHTML is almost identical to HTML 4.01 – XHTML is.
XML Basics Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University Extensible Meta Language Markup Language.
Sheet 1XML Technology in E-Commerce 2001Lecture 1 XML Technology in E-Commerce Lecture 1 WWW, HTML, CSS, XML, Meta-modeling.
 XML is designed to describe data and to focus on what data is. HTML is designed to display data and to focus on how data looks.  XML is created to structure,
XML TUTORIAL Portions from w3 schools By Dr. John Abraham.
XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.
XML Extensible Markup Language
XML 2nd EDITION Tutorial 1 Creating An Xml Document.
XP 1 Creating an XML Document Developing an XML Document for the Jazz Warehouse XML Tutorial.
Accessing Data Using XML CHAPTER NINE Matakuliah: T0063 – Pemrograman Visual Tahun: 2009.
1 Overview of XSL. 2 Outline We will use Roger Costello’s tutorial The purpose of this presentation is  To give a quick overview of XSL  To describe.
1 Credits Prepared by: Rajendra P. Srivastava Ernst & Young Professor University of Kansas Sponsored by: Ernst & Young, LLP (August 2005) XBRL Module Part.
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.
XML Introduction. Markup Language A markup language must specify What markup is allowed What markup is required How markup is to be distinguished from.
1 Tutorial 11 Creating an XML Document Developing a Document for a Cooking Web Site.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2.
1 herbert van de sompel CS 502 Computing Methods for Digital Libraries Cornell University – Computer Science Herbert Van de Sompel
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.
Web Technologies Lecture 4 XML and XHTML. XML Extensible Markup Language Set of rules for encoding a document in a format readable – By humans, and –
Unit 3 — Advanced Internet Technologies Lesson 11 — Introduction to XSL.
University of Nottingham School of Computer Science & Information Technology Introduction to XML 2. XSLT Tim Brailsford.
XML The Extensible Markup Language (XML ), which is comparable to SGML and modeled on it, describes how to describe a collection of data. A standard way.
Introduction to the World Wide Web & Internet CIS 101.
Tutorial 9 Working with XHTML. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Describe the history and theory of XHTML.
 XML derives its strength from a variety of supporting technologies.  Structure and data types: When using XML to exchange data among clients, partners,
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
CIS 228 The Internet Day 2, 9/1/11 Hypertext. The Course Instructor: Bowen Alpern Office hour: GI 137-I, 4-5pm Tu.
Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 14 This presentation © 2004, MacAvon Media Productions XML.
XHTML1 Introduction to Web Pages N100 Building a Simple Web Page.
Rendering XML Documents ©NIITeXtensible Markup Language/Lesson 5/Slide 1 of 46 Objectives In this session, you will learn to: * Define rendering * Identify.
1 Extensible Stylesheet Language (XSL) Extensible Stylesheet Language (XSL)
Beyond HTML: Extensible Markup Language (XML)
XML QUESTIONS AND ANSWERS
Introduction to XHTML.
Markup Languages Gilok Choi 9/17/2018
Prepared for Md. Zakir Hossain Lecturer, CSE, DUET Prepared by Miton Chandra Datta
Allyson Falkner Spokane County ISD
Presentation transcript:

University of Nottingham School of Computer Science & Information Technology Introduction to XML 1. The XML Language Tim Brailsford

University of Nottingham 2 Markup Languages l The word “Markup” is derived from the printing industry l Detailed stylistic instructions for typesetting l Usually hand-written on the copy (eg underlining some text that is to be set in italics). l Markup languages do the same job for computerised documentation systems. l Markup adds logical structure to a document, or indicates how it is to be laid out (on paper or screen). l Markup languages are a set of instructions that are amenable to automatic processing.

University of Nottingham 3 Markup Languages (cont.) l Usually a sequence of characters in a text file that indicate structure or behaviour of the content. l For example (in HTML) l This is bold and this is italic l This is the title. l Markup may be created by directly editing the symbols, but is more usually hidden from end-users. l Examples l HTML l RTF l Hytime

University of Nottingham 4 Generalised Markup Languages l Proprietary markup languages are problematic. l Generalised markup languages are langauges for defining markup languages. l Metalanguages l SGML

University of Nottingham 5 SGML - History l Standard Generalised Markup Language l GML from IBM l text editing l formatting l information retrieval l 1980 SGML first published l 1980’s SGML adopted by US IRS & DOD l ISO standard ISO 8879: Information processing--Text and office systems--Standard Generalized Markup Language (SGML), ([Geneva]: ISO, 1986).

University of Nottingham 6 SGML l SGML defines a system of tag markup This is a pair of SGML tags l SGML is a standard for how to specify a tag set. l Document Type Definition (DTD) l SGML documents contain structural elements that can be described without consideration of how they are displayed. l SGML application. l HTML is an SGML application.

University of Nottingham 7 Benefits of SGML l Documents are created by thinking in terms of structure rather than appearance (which may change over time). l Documents are portable because any SGML compliant software can interpret them by reference to the DTD. l Documents originally intended for one medium can easily be re-purposed for other media, such as the computer display screen.

University of Nottingham 8 What is XML? l XML is based upon SGML, but is substantially simplified for use on the WWW. l Like SGML, XML is a metalanguage l arbitrary definition of elements l l Syntax may optionally be described by a DTD l Valid documents - have a DTD l Well formed documents do not have a DTD l Style and content are completely separate l XML documents contain content l Style is specified by stylesheets

University of Nottingham 9 Example XML Applications l MathML - maths l CML - chemistry l SVG - vector graphics l XHTML - WWW l SMIL - synchronised multimedia l MusicML - sheet music l FpML - financial products l RETML - real estate transactions l and many, many others

University of Nottingham 10 XML Elements l XML documents consist of one or more elements. Elements consist of a pair of tags and (optionally) enclosed text. The XML Companion Elements may have attributes. The XML Companion Elements may contain other elements. The XML Companion Empty elements may be self closing.

University of Nottingham 11 Contents vs Style l XML tags contain meaning not appearance. l This allows extra information to be extracted l Consider the example of the scientific names of animals. l scientific names are in latin l by convention they are always printed in italics The scientific name of the domestic dog is Canis familiaris, and of the domestic cat is Felis catus.

University of Nottingham 12 Contents vs Style l XML tags contain meaning not appearance. l This allows extra information to be extracted l Consider the example of the scientific names of animals. l scientific names are in latin l by convention they are always printed in italics The scientific name of the domestic dog is Canis familiaris, and of the domestic cat is Felis catus. In HTML The scientific name of the domestic dog is Canis familiaris, and of the domestic cat is Felis catus. NB there is no distinction between scientific names and emphasis. In HTML The scientific name of the domestic dog is Canis familiaris, and of the domestic cat is Felis catus. NB there is no distinction between scientific names and emphasis.

University of Nottingham 13 Contents vs Style l XML tags contain meaning not appearance. l This allows extra information to be extracted l Consider the example of the scientific names of animals. l scientific names are in latin l by convention they are always printed in italics The scientific name of the domestic dog is Canis familiaris, and of the domestic cat is Felis catus. In XML The scientific name of the domestic dog is Canis familiaris, and of the domestic cat is Felis catus. NB emphasis and scientific names are different tags. They may both be displayed as italic, but they can be treated separately. In XML The scientific name of the domestic dog is Canis familiaris, and of the domestic cat is Felis catus. NB emphasis and scientific names are different tags. They may both be displayed as italic, but they can be treated separately.

University of Nottingham 14 Rendering of XML l XML files contain content not appearance l Stylesheets contain appearance and behaviour l XML data is rendered by being transformed into some form suitable for display l RTF (for simple printing) l PDF or PostScript (for printing or display) l HTML (for display over the web) l HTML 4.0 / DHTML (for complex interfaces) l The transformation is defined by a stylesheet l Rendering may be done by standalone software, or by a web browser, or on a web server.

University of Nottingham 15 Standalone Rendering HTML XML XSL

University of Nottingham 16 Client Side Rendering XML XSL HTML Server (any) Browser with XSL engine (eg MS IE > 5.0) XML XSL

University of Nottingham 17 Server Side Rendering HTML Browser (any) Server with XSL engine eg Apache/Tomcat/Cocoon XML XSL HTML

University of Nottingham 18 Client vs Server Stylesheets l Client side stylesheets are processed in client l XML is delivered to the client l XSL/CSS must be supported by client l MS IE supports CSS & XSLT (non-standard in 5.x mostly standard in 6.x) l Netscape 7 & Mozilla supports CSS and possibly XSLT via plugins. l Server side stylesheets are processed in server l XML is not delivered to the client, it is transformed usually to HTML or PDF l XSL/CSS must be supported by server l Cocoon is an Open Source project, implementing XSL as a Java servlet l Any browser can then be used

University of Nottingham 19 Cocoon on Nottingham Servers l Any file placed in a directory called public_html is accessible within the Nottingham network with the url: l Files with the.xml extension are automatically processed by cocoon. l Providing that they have an XSL stylesheet and the correct Cocoon processing instructions they will be “transformed” into (usually) HTML.

University of Nottingham 20 A Simple XML Document

University of Nottingham 21 A Simple XML Document Root element (one per document) XML declaration

University of Nottingham 22 A Simple XML Document

University of Nottingham 23 A Simple XML Document Define root element and specify DTD.

University of Nottingham 24 A Simple XML Document

University of Nottingham 25 A Simple XML Document This is a comment (as SGML / HTML)

University of Nottingham 26 A Simple XML Document

University of Nottingham 27 A Simple XML Document This defines the XSL stylesheet

University of Nottingham 28 A Simple XML Document

University of Nottingham 29 A Simple XML Document This is a Cocoon processing directive (NB not standard XML, but required by Cocoon 1.7.4).

University of Nottingham 30 Adding Content St. Laurent S 1998 XML: A Primer MIS Press

University of Nottingham 31 Benefits of a DTD l DTDs are optional in XML l DTD allows validation of documents l DTD defines the application l Vital for collaborative development l IPR implications l DTD allows entity definitions (ie symbols, shortcuts, “foreign” characters etc.).

University of Nottingham 32 XML Namespaces l Namespaces are mechanisms to ensure that elements are unique l Namespaces in XML are optional l Consider the following: The Title The Title

University of Nottingham 33 Ensuring uniqueness l Unique element names l Unique attribute content The Title The Title The Title The Title

University of Nottingham 34 xmlns attribute l The xmlns attribute is used to declare namespaces l This must be a URI The Title <title xmlns=“ text=“The Title” /> The Title

University of Nottingham 35 Namespace Abbreviations l If an element doesn’t have a namespace defined it inherits that of its parent. l Where multiple namespaces are used together aliases may be declared <demo xmlns:first =“ xmlns:second =“ > The Title

University of Nottingham 36 XML Namespaces l Namespaces in XML are optional l Namespaces ensure that elements are unique l In different contexts a given tag might mean different things - eg consider l To me it might mean a book in a bibliography l To a bookshop it might contain stock details l To a travel agent it might contain information about flight bookings! l Namespaces attach unique labels to a given tag set. l URLs are usually used as namespace labels.