Introduction to XML Jussi Pohjolainen TAMK University of Applied Sciences.

Slides:



Advertisements
Similar presentations
XHTML Basics.
Advertisements

 Fundamentals of Web Design.  Describe the history and theory of XHTML  Understand the rules for creating valid XHTML documents  Apply a DTD to an.
History Leading to XHTML
HTML Hypertext Markup Language –First proposed by CERN in 1989 –It is non-linear so it allows you to jump from place to place –Markup refers to the structure.
XHTML 16-Apr-17.
17-Jun-15 XHTML 2 What is XHTML? XHTML stands for Extensible Hypertext Markup Language XHTML is aimed to replace HTML.
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
Creating a Well-Formed Valid Document. 2 Objectives Introducing XHTML Creating a Well-Formed Document Creating a Valid Document Creating an XHTML Document.
F DIGITAL MEDIA: COMMUNICATION AND DESIGN INTRODUCTION TO XML AND XHTML.
XML Introduction What is XML –XML is the eXtensible Markup Language –Became a W3C Recommendation in 1998 –Tag-based syntax, like HTML –You get to make.
Upgrading to XHTML DECO 3001 Tutorial 1 – Part 1 Presented by Ji Soo Yoon 19 February 2004 Slides adopted from
XML October 24, Unit 6. What is XML? Stands for eXtensible Markup Language It is a markup language, like HTML But, –XML is designed to markup data –HTML.
Introduction to XHTML Professor Stephen Kwan. 2 XHTML HTML StyleSheets XML CascadingStyleSheets(CSS) ExtensibleStylesheetLanguage(XSL) StructureFormatContent.
Introducing XHTML: Module B: HTML to XHTML. Goals Understand how XHTML evolved as a language for Web delivery Understand the importance of DTDs Understand.
Introduction to XML This material is based heavily on the tutorial by the same name at
Introducing HTML & XHTML:. Goals  Understand hyperlinking  Understand how tags are formed and used.  Understand HTML as a markup language  Understand.
Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University.
XP Tutorial 9New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
Basic WEB Architecture 1. Data Driven WEB Architecture 2.
XP The University of Akron Summit College Business Technology Department Computer Information Systems 2440: 140 Internet Tools Instructor: Enoch E. Damson.
ULI101 – XHTML Basics (Part II) What is Markup Language? XHTML vs. HTML General XHTML Rules Block Level XHTML Tags XHTML Validation.
CREATED BY ChanoknanChinnanon PanissaraUsanachote
 XHTML is aimed to replace HTML  XHTML is almost identical to HTML 4.01  XHTML is a stricter and cleaner version of HTML  XHTML is HTML defined as.
CS 299 – Web Programming and Design Introduction to HTML.
Chapter 1 Understanding the Web Design Environment Principles of Web Design, 4 th Edition.
Week 1 Understanding the Web Design Environment. 1-2 HTML: Then and Now HTML is an application of the Standard Generalized Markup Language Intended to.
XML – 1h. XML: Contents What is XML? What is “Well Formed” XML? What is “Valid” XML? –Document Type Definitions –Scalable Vector Graphics (SVG) XML in.
1 © Netskills Quality Internet Training, University of Newcastle Introducing XML © Netskills, Quality Internet Training University.
XHTML - Basics Teppo Räisänen LIIKE/OAMK Introduction XHTML = eXtensible Hypertext Markup Language Transitional ~ HTML 4.01 Goal: to replace HTML.
CS134 Web Design & Development Creating a Basic Web Page Mehmud Abliz.
XHTML1 Building Document Structure Chapter 2. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML)
Introduction. Document Structure Overview  XML declaration (prolog)  Document type declaration  Root element (namespace)  Document header  Document.
3 XHTML.
1 XHTML محمد احمدی نیا 2 Of 19 HTML vs XHTML  XHTML is a stricter and cleaner version of HTML.  by combining the strengths of HTML.
XHTML Web and Database Management System. HTML’s History HTML was initially defined by Tim-Berners-Lee in 1990 at CERN (European Organization for Nuclear.
HTML INTRODUCTION, EDITORS, BASIC, ELEMENTS, ATTRIBUTES.
XHTML. Introduction to XHTML What Is XHTML? – XHTML stands for EXtensible HyperText Markup Language – XHTML is almost identical to HTML 4.01 – XHTML is.
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.
 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 eXtensible Markup Language. Topics  What is XML  An XML example  Why is XML important  XML introduction  XML applications  XML support CSEB.
XP Tutorial 9 1 Working with XHTML. XP SGML 2 Standard Generalized Markup Language (SGML) A standard for specifying markup languages. Large, complex standard.
Chapter 1 Understanding the Web Design Environment Principles of Web Design, 4 th Edition.
HTML Structure & syntax. Introduction This presentation introduces the following: Doctype declaration HTML Tags, Elements and Attributes Sections of a.
Lesson 4.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Creating XHTML Documents Essentials for.
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.
Lecture: Web Design Assis. Prof. Freshta Hanif Ehsan Faculty of Computer Science Kabul Polytechnic University Spring Semester
XML Basics A brief introduction to XML in general 1XML Basics.
XML Schema (W3C) Thanks to Jussi Pohjolainen TAMK University of Applied Sciences.
Copyright © 2003 Pearson Education, Inc. Slide 1-1 Created by Cheryl M. Hughes The Web Wizard’s Guide to XHTML by Cheryl M. Hughes.
XML CSC1310 Fall HTML (TIM BERNERS-LEE) HyperText Markup Language  HTML (HyperText Markup Language): December  Markup  Markup is a symbol.
XP Tutorial 9New Perspectives on HTML and XHTML, Comprehensive 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
Objective: To describe the evolution of the Internet and the Web. Explain the need for web standards. Describe universal design. Identify benefits of accessible.
CSS THE MISSING MANUAL Introduction. Benefits of CSS Style sheets offer more formatting choices than are offered in straight HTML  EXAMPLE: When you.
Tutorial 9 Working with XHTML. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Describe the history and theory of XHTML.
CIS 228 The Internet 9/20/11 XHTML 1.0. “Quirks” Mode Today, all browsers support standards Compliant pages are displayed similarly There are multiple.
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
Linked Data & Semantic Web Technology The Semantic Web Part 2. XML Dr. Myungjin Lee.
HTML5 Basics.
CIS 228 The Internet 9/20/11 XHTML 1.0.
Creating a Well-Formed Valid Document
Tutorial 9 Working with XHTML
Coding, Testing and Valdating a Web Page
XHTML Basics.
XHTML Basics.
XHTML Basics.
Tutorial 9 Working with XHTML
XHTML Basics.
XHTML Basics.
محمد احمدی نیا XHTML محمد احمدی نیا
Presentation transcript:

Introduction to XML Jussi Pohjolainen TAMK University of Applied Sciences

What is XML? eXtensible Markup Language, is a specification for creating custom markup languages W3C Recommendation Primary purpose is to help computers to share data XML is meta-language. This means that you use it for creating languages. XML is an extensive concept.

XML Document Every XML-document is text-based => sharing data between different computers! => sharing data in Internet! => platform independence!

Binary vs. Text Problems with Binary format – Platform depence – Firewalls – Hard to debug – Inspecting the file can be hard Since XML is text-based, it does not have the problems mentioned above. What are the disadvantages in text format?

XML Doc Advantages Easy data sharing, text documents are readable between any device. Documents can be modified with any text editor. Possible to understand the contents of the xml- document just by looking at it with text editor. Easy to manipulate via programming languages Two levels of correctness: Well formed and Valid.

.doc – file format Windows MS Word 2000 Mac OS X Since.doc is closed binary-format, there are very few alternatives for word processors that fully support the doc – file format

.docx – file format (Office Open XML) Windows MS Word 2007 Mac OS X Hopefully in the future there will be loads of free programs that support this new open and easy access file format title. Now the format is open and it's much easier to access

SGML vs. XML SGML: Standard Generalized Markup Language XML HTML (.html) XHTML (.xhtml) MathML (.mml) OOXML (.docx)

XML – Meta Language XML is meta language, which you can use to create your own markup languages. There are several XML Markup Languages made for different purposes All the languages have common xml-rules Languages: XHTML, OOXML, Open Document, RSS, SVG, SOAP, SMIL, MathML... List: –

XHTML - Example <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " Minimal XHTML 1.0 Document This is a minimal XHTML 1.0 document.

SVG - Example <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" " <svg width="100%" height="100%" version="1.1" xmlns=" <circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red"/>

MathML (Open Office) x =... x = {-b +-sqrt{b^{2}-4{ac}} } over {2 {a}}

RSS Example W3Schools Home Page Free web building tutorials RSS Tutorial New RSS tutorial on W3Schools XML Tutorial New XML tutorial on W3Schools

XML Editors XML Spy EditiX Microsoft XML Notepad Visual XML XML Viewer Xeena XML Styler, Morphon, XML Writer…

WELL FORMED XML - DOCUMENT Rules that Apply to Every XML-Document

Correctness There are two levels of correctness of an XML document: 1.Well-formed. A well-formed document conforms to all of XML's syntax rules. 2.Valid. A valid document additionally conforms to some semantic rules. Let's first look at the XML's syntax rules (1).

Simple Generic XML Example Introduction to XML XML is...

XML-Declaration XML-declaration is optional in XML 1.0, mandatory in 1.1. – Recommendation: use it. Version: 1.0 or 1.1 Encoding: character encoding, default utf-8 Standalone: – is the xml-document linked to external markup declaration – yes: no external markup declarations – no: can have external markup declaration (open issue..) – default: "no"

Comparing Declarations Introduction to XML XML is... Introduction to XML XML is... Same Declaration

Element vs. Tag vs. Attribute Element consists of start tag, optional content and an end tag: – Introduction to XML Start tag – Content – Introduction to XML End tag – Start tag may have attribute –

Rules about Elements Only one root - element Every element contains starting tag and an ending tag Content is optional: Empty element – Tag – names are case-sensitive: – Elements must be ended with the end tag in correct order: – problem here <!– Error 

Rules about Attributes XML elements can have attributes in the start tag. Attributes must be quoted: –

Naming Tags Names can contain letters, numbers, and other characters Names must not start with a number or punctuation character Names must not start with the letters xml (or XML, or Xml, etc) Names cannot contain spaces

Well-Formed XML XML document is well-formed if it follows the syntax rules. XML document must be well-formed! – it's not an xml-document, if it does not follow the rules..

Is this Well-Formed XML Document? Minimal XHTML 1.0 Document This is a minimal XHTML 1.0 document.

Is this Well-Formed XML Document? Minimal XHTML 1.0 Document This is a minimal XHTML 1.0 document.

VALID XML DOCUMENT Defining the Structure for XML documents

Valid XML XML document is valid if – 1) It is well formed AND – 2) It follows some semantic rules XML document is usually linked to an external file, that has semantic rules for the document. – The file can be dtd (.dtd) or schema (.xsd) Semantic rules? – Name of tags, order of elements

DTD Linking <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " Minimal XHTML 1.0 Document This is a minimal XHTML 1.0 document. Rules for XHTML elements (order, names, etc)

DTD Linking Defines the structure, tag names and order for all xhtml - documents W3C has created XML-language "XHTML" by defining it's rules in DTD. W3C has created XML-language "XHTML" by defining it's rules in DTD.

Is this valid XML Document? Minimal XHTML 1.0 Document This is a minimal XHTML 1.0 document. 1.There is no DTD! What language is this? MathML? SVG? XHTML? 2.Assuming this is XHTML, what version of XHTML? Transitional? Strict? 3.Assuming this is XHTML strict, does "jorma" – tag belong to XHTML Language? 1.There is no DTD! What language is this? MathML? SVG? XHTML? 2.Assuming this is XHTML, what version of XHTML? Transitional? Strict? 3.Assuming this is XHTML strict, does "jorma" – tag belong to XHTML Language?

Invalid XHTML-document <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " Minimal XHTML 1.0 Document This is a minimal XHTML 1.0 document.

Validating with W3C Service

Invalid XHTML in Browser? May work... or not. Browser tries to detect the errors and tries to understand them. If it works with one browser, are you certain that it works with all other browsers? And with all the versions with the browsers? What about browsers in handheld devices? And it might work now, but what about future? How will Firefox 5.0 handle incorrect web pages? May work... or not. Browser tries to detect the errors and tries to understand them. If it works with one browser, are you certain that it works with all other browsers? And with all the versions with the browsers? What about browsers in handheld devices? And it might work now, but what about future? How will Firefox 5.0 handle incorrect web pages?

Invalid XML in General Because of HTML heritage, browsers try to understand invalid XHTML-pages This is not the case in other XML-languages. In general, if XML-document is invalid, the processing of the document is cancelled.

Example: MathML and Open Office

Open the Document in External Editor

Modify and Save the Document Break the XML file

Open the Document

Result Nope.. It does not try to understand the errors in the document. It does not handle the document at all. Nope.. It does not try to understand the errors in the document. It does not handle the document at all.

Benefits of WF and Valid XML has strict rules for WF and Valid If application tries to manipulate xml- document it does not have to try to understand the possible errors in the document This means that handling xml-files via programming language is much easier – If the document is correctly formed, manipulate it – If it isn't display error

Case: TAMKOtuki The menu of TAMKOtuki is saved into XML- document: – Since you can be sure, that the xml-document is well formed, reading the contents of the xml- document is fairly easy – Showing the contents in Web-page: – Showing the contents in TAMK-intra: – Showing the contents in Mobile Devices..