XML and friends Part 1 - XML and DTD ELAG 2001 workshop 8 Jan Erik Kofoed © BIBSYS Library Automation.

Slides:



Advertisements
Similar presentations
EXtensible HyperText Markup Language Miruna Bădescu Finsiel Romania Copenhagen, 25 May 2004.
Advertisements

Defining XML The Document Type Definition. Document Type Definition text syntax for defining –elements of XML –attributes (and possibly default values)
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.
Dr. Alexandra I. Cristea XHTML.
© De Montfort University, XML – a meta language Howell Istance and Peter Norris School of Computing De Montfort University.
XML Document Type Definitions ( DTD ). 1.Introduction to DTD An XML document may have an optional DTD, which defines the document’s grammar. Since the.
Introduction to XML John Arnett, MSc Standards Modeller Information and Statistics Division NHSScotland Tel: (x2073)
Introduction to XML: DTD
XML Language Family Detailed Examples Most information contained in these slide comes from: These slides are intended.
XML: Extensible Markup Language BA Presented by: Tara Barnes, Lauren Jones, Ryan Kline.
A Technical Introduction to XML Transparency No. 1 XML quick References.
XML: New or Old? XML was not an extention of HTML That already existed! SGML (ISO 8879) XML was a simplification of SGML  80 / 20 rule  (80% of the features.
XML Primer. 2 History: SGML vs. HTML vs. XML SGML (1960) XML(1996) HTML(1990) XHTML(2000)
5-1 Facilitating Business over the Internet: The XML language CR (2004) Prentice Hall, Inc. The xml goals The main objects of xml: Diagrams: Blocks and.
Introducing HTML & XHTML:. Goals  Understand hyperlinking  Understand how tags are formed and used.  Understand HTML as a markup language  Understand.
ITR3 lecture 2: XML Thomas Krichel Structure URIs (we will come back to them in lecture 3) XML Sofix xml example.
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
XML and XSL Institutional Web Management 2001: Organising Chaos.
XML eXtensible Markup Language by Darrell Payne. Experience Logicon / Sterling Federal C, C++, JavaScript/Jscript, Shell Script, Perl XML Training XML.
XML CPSC 315 – Programming Studio Fall 2008 Project 3, Lecture 1.
XML The Overview. Three Key Questions What is XML? What Problems does it solve? Where and how is it used?
Document Type Definitions Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
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.
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.
Introduction to XML. XML - Connectivity is Key Need for customized page layout – e.g. filter to display only recent data Downloadable product comparisons.
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 Extensible Markup Language. What is XML? ● meta-markup language ● a language for defining a family of languages ● semantic/structured mark-up language.
XML Syntax - Writing XML and Designing DTD's
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 (2) DTD Sungchul Hong.
Tutorial 1: XML Creating an XML Document. 2 Introducing XML XML stands for Extensible Markup Language. A markup language specifies the structure and content.
1 Tutorial 13 Validating Documents with DTDs Working with Document Type Definitions.
Lecture 6 XML DTD Content of.xml fileContent of.dtd file.
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.
E0262 – MIS – Multimedia Storage Techniques XML (Extensible Markup Language  XML is a markup language for creating documents containing structured information.
XML 2nd EDITION Tutorial 1 Creating An Xml Document.
XML - DTD Week 4 Anthony Borquez. What can XML do? provides an application independent way of sharing data. independent groups of people can agree to.
CP3024 Lecture 9 XML: Extensible Markup Language.
XML Extensible Markup Language Aleksandar Bogdanovski Programing Enviroment LABoratory
XML Documents Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University Elements Attributes Comments PI Document.
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.
Lecture 16 Introduction to XML Boriana Koleva Room: C54
2 XML Syntax XML Document Structure August 15, :00 Darmstadt Hessen Germany fine 25 SW 6 Markup Content.
An Introduction to XML Sandeep Bhattaram
XML Introduction. What is XML? XML stands for eXtensible Markup Language XML stands for eXtensible Markup Language XML is a markup language much like.
XML & varieties, e.g. VoiceXML By: Shawn Ramdass, Saji Abraham & Billy Santamorena.
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.
1 herbert van de sompel CS 502 Computing Methods for Digital Libraries Cornell University – Computer Science Herbert Van de Sompel
Well Formed XML The basics. A Simple XML Document Smith Alice.
What is XML? eXtensible Markup Language eXtensible Markup Language A subset of SGML (Standard Generalized Markup Language) A subset of SGML (Standard Generalized.
Introduction to XML XML – Extensible Markup Language.
Document Type Definition (DTD) Eugenia Fernandez IUPUI.
XML Databases – do they really exist? Jan Erik Kofoed BIBSYS Library Automation ELAG 2005 at CERN, Geneva.
Module Road Map Assignment Road Map Notice we have linked the conduit directly to the presentation layer. This is normally a bad idea!
XML The Overview. Three Key Questions What is XML? What Problems does it solve? Where and how is it used?
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
HTML is about making documents. Simple Code for Simple Layout My Document This is an example HTML document First paragraph Second paragraph This is the.
SNU OOPSLA Lab. A Tour of XML © copyright 2001 SNU OOPSLA Lab.
Unit 4 Representing Web Data: XML
The XML Language.
Chapter 7 Representing Web Data: XML
Creating an XML Document
Web Programming Maymester 2004
Allyson Falkner Spokane County ISD
XML IST 421.
Presentation transcript:

XML and friends Part 1 - XML and DTD ELAG 2001 workshop 8 Jan Erik Kofoed © BIBSYS Library Automation

XML © Jan Erik Kofoed XML – eXtensible Markup Language Describing content The grammar of the language is given, but ”any” word is allowed Readable for both man and machine Generally usable as meta language Uses tags for describing content

XML © Jan Erik Kofoed SGML and XML SGML – Standard Generalized Markup Language, ISO 8879:1986(E) XML – Extensible Markup Language 1.0 2nd Ed., W3C Recommendation XML is compatible with SGML SGML is of many considered as difficult and expensive XML is designed to be easy to implement and to operate together with SGML and HTML

XML © Jan Erik Kofoed Design goals for XML 1.XML shall be straight forwardly useable over the internet. 2.XML shall support a wide variety of applications. 3.XML shall be compatible with SGML. 4.It shall be easy to write programs which process XML documents. 5.The number of optional features in XML is to be kept to the absolute minimum, ideally zero. 6.XML documents should be human-legible and reasonably clear. 7.The XML design should be prepared quickly. 8.The design of XML shall be formal and concise. 9.XML documents shall be easy to create. 10.Terseness in XML markup is of minimal importance.

XML © Jan Erik Kofoed HTML and XML HTML – HyperText Markup Language 4.01, W3C Recommendation –Now replaced by: XHTML - Extensible HyperText Language 1.0, W3C Recommendation Both XML and HTML is compatible with SGML. HTML describes presentation. XML describes content. XHTML is HTML with XML syntax.

XML © Jan Erik Kofoed HTML shows layout Book Hamsun, Knut: Markens grøde. Oslo, Aschehoug, 1948

XML © Jan Erik Kofoed XML is marking the content Hamsun, Knut Markens grøde Oslo Aschehoug 1948

XML © Jan Erik Kofoed One simple document Åse Østby Furuveien Skogheim

XML © Jan Erik Kofoed Remember to add encoding! Åse Østby Furuveien Skogheim

XML © Jan Erik Kofoed Architecture of XML-documents Processing instruction Element content –Empty element Attribute Comment Entity &entity; CDATA ]]> DTD

XML © Jan Erik Kofoed Example is the root element. ]]> Hamsun, Knut Markens grøde Kristiania Gyldendal 1917 <Dedication "Til Marie" on the title page. >

XML © Jan Erik Kofoed Presented i MS IE is the root element. ]]> Hamsun, Knut Markens grøde Kristiania Gyldendal 1917

XML © Jan Erik Kofoed Two types of XML documents Well formed XML –Must follow certain rules Valid XML –Must be well formed –Must follow rules given in a DTD, Document Type Definition

XML © Jan Erik Kofoed Well formed XML 1.The document must begin with a XML declaration. 2.All elements that contains data must begin with a start and end tag. 3.Empty elements without end tag must end with: /> 4.One root element must span all other elements. 5.Elements may be nested, but cannot be overlapped. 6.Attribute values must be inside quotes: “ “ 7.The characters < and & must only be used to start tags and entities. 8.An element may not have two attributes with the same name. 9.Comments and processing instructions may not appear inside tags.

XML © Jan Erik Kofoed Rules for XML Name of elements and attributes –must start with a letter or _ –can then contain letter, number, -,. or _ –is case sensitive –may not start with xml, XML, Xml, xMl... –non ASCII (“national”) letters are allowed Standard character set is UTF8 (Unicode) –use the encoding attribute.

XML © Jan Erik Kofoed Reserved attributes (1) xml:lang –language code. Defined in RFC xml:space –preservePreserve space, tab and carriage return –defaultThe XML processor decides how spaces shall be processed.

XML © Jan Erik Kofoed Reserved attributes (2) xml:link –simpleone way pointer –documentpointer to a member of a group –extendedmultiple and extended pointer –groupgroup with pointers to documents xml:attribute –old-attribute new-attribute switches attributes

XML © Jan Erik Kofoed Entities in XML Entities starts with & and ends with ; && << >> &qout;” &apos;’ &#xnnnn;character with Unicode value nnnn

XML © Jan Erik Kofoed Document type definition DTD Rules for the structure of XML documents Defines names of elements and attributes Defines succession (order) Defines occurrence Defines type of attributes Defines default values for attributes Defines required elements and attributes

XML © Jan Erik Kofoed DTD: entities (1) General entity – –Ex.: – &www; Parameter entity – –Ex.: –

XML © Jan Erik Kofoed DTD: entities (2) External entities – – &addresses; Non-XML entity – Notation –

XML © Jan Erik Kofoed DTD: ELEMENT –

XML © Jan Erik Kofoed DTD: Definition of occurrences (none)Must occur exactly once. ?Can occur zero or once. +Must occur once or more. *Can occur zero or more.

XML © Jan Erik Kofoed DTD: attributes Example: –

XML © Jan Erik Kofoed DTD: Attribute types –CDATAString –(name | name |...)List of values –ENTITYDefined entity –ENTITIESList of entities –IDUnique identifier –IDREFReference to an ID –IDREFSList of ID references –NMTOKENA word built from name characters –NMTOKENSList of nmtokens –NOTATIONNon-analyzed entities

XML © Jan Erik Kofoed DTD:Examples (1) <!ATTLIST person name CDATA #REQUIRED number ID #REQUIRED sex (M | K) #IMPLIED> <person name=”Mary Hill” number=”p ” sex=”M” />

XML © Jan Erik Kofoed DTD:Examples (2) Gold feber

XML © Jan Erik Kofoed DTD:Examples (3) <!DOCTYPE DOCUMENT [ ]> Susan Jack Chelsea David

XML © Jan Erik Kofoed DTD:Examples (4)

XML © Jan Erik Kofoed DTD:Examples (5a)

XML © Jan Erik Kofoed DTD:Examples (5b) Hamsun, Knut Markens grøde Oslo Aschehoug 1948