Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to XML John Arnett, MSc Standards Modeller Information and Statistics Division NHSScotland Tel: 0131 551 8073 (x2073)

Similar presentations


Presentation on theme: "Introduction to XML John Arnett, MSc Standards Modeller Information and Statistics Division NHSScotland Tel: 0131 551 8073 (x2073)"— Presentation transcript:

1 Introduction to XML John Arnett, MSc Standards Modeller Information and Statistics Division NHSScotland Tel: 0131 551 8073 (x2073) mailto:John.Arnett@isd.csa.scot.nhs.uk http://isdscotland.org/xml

2 Contents What is XML? Anatomy of an XML Document Conformance and Validation Summary Find Out More

3 What is XML? –a programming language –a software panacea –an object-oriented technology –HTML with funny tags –a replacement for HTML… but it is re-shaping publishing on the web XML is not…

4 What is XML? –Meta-markup language derived from SGML (Standard Generalised Markup Language) –Open Standard, currently XML 1.0 2 nd edition (W3C Recommendation 6 October 2000) Stands for Extensible Markup Language

5 What is XML? –XML is the universal format for structured documents and data on the Web –A data object is an XML document if it is well-formed, as defined in [the W3C] specification (more on this later) W3C says

6 What is XML? Data Content and Presentation Sample dataset 1 0 1 0 SEX 15061976SarahJackson147678 12111979LesleyMartin111672 23081983AlisonMcKenzie198457 06011971IanJones134376 DOBFORENAMESURNAMEID Flat file, database, spreadsheet, etc

7 Record – data oriented structure 111672 Martin Lesley 0 12111979 What is XML?  Structured  Searchable  Easy to understand  Portable

8 What is XML? HTML – document oriented structure Record Id: 11672 Surname: Martin Given Name: Lesley Sex: Male Date of Birth: 12 November 1979 Record Id: 11672 Surname:Martin Given Name:Lesley Sex:Male Date of Birth: 12 November 1979  Easy to understand  Portable  Structured  Searchable

9 What is XML? XML to the rescue! Martin Lesley M 12 11 1979  Easy to understand  Portable  Structured  Searchable

10 What is XML? –Text based –Open standards –Widely used HTML and XML are…

11 What is XML? –Structured –Separates data from presentation –Self-describing –Searchable –Extensible i.e. any number of tags allowed But XML also…

12 Anatomy of an XML Document –character data tab, carriage return and line feed Unicode characters –markup XML documents consist of text

13 Anatomy of an XML Document Markup Hello, World Wide Web! –start-, end- and empty element tags tag names are case sensitive! –entity and character references –comments

14 Anatomy of an XML Document Character data Hello, World Wide Web! –Reserved characters &,, ‘ and “

15 Anatomy of an XML Document Declaration Hello, World Wide Web! –Optional first line of markup (but W3C recommended) –Used to match documents to parsers

16 Anatomy of an XML Document Root Element Hello, World Wide Web! –Uniquely named element –Contains all the data and links to other documents

17 Anatomy of an XML Document Elements XML Bible 24.99 E.R. Harold J. Forbes –Define the content of the XML document –May contain other elements, character data or can be empty

18 Anatomy of an XML Document Attributes –Add data about the elements

19 Anatomy of an XML Document –Built-in entities & = & “ = " < = < > = > ‘ = &apos; Handling reserved characters –CDATA Sections getX() 10) cerr

20 Anatomy of an XML Document Namespaces –Preventing naming collisions Dr Peter Parker White Teeth 5.99 AYT2379

21 Conformance and Validation –One root element –Start and end tags match content –Empty elements are terminated as –Tags are correctly nested –All attributes enclosed in “quotes” All XML processors must check well- formedness constraints

22 Conformance and Validation –specified in Document Type Definitions (DTDs) or Schemas –a valid XML document must be well-formed –a well-formed document need not necessarily be valid Validating XML processors check against validity constraints

23 Document Type Definitions DTD syntax able to specify –Element attributes limited number of data types default and fixed attribute values –Structure and order of child elements

24 Document Type Definitions –Easy to understand and implement –Lightweight alternative to schemas –But… use non-XML syntax only limited support for data typing and namespaces difficult to extend DTD’s

25 Schemas –Uses XML syntax –Provides built-in and supports user- defined data types –Supports namespaces –Provides several extensibilty mechanisms W3C Schema

26 Schemas Schemas therefore more flexible… but harder to understand than DTD’s

27 In Summary… A language for describing markup languages Extensible, ie. define own tags Readable, structured and self describing Documents must be well-formed Documents may be validated using DTD’s and/or Schemas

28 Find Out More World Wide Web Consortium –www.w3.orgwww.w3.org W3C XML v1.0 Specification –http://www.w3.org/TR/REC-xmlhttp://www.w3.org/TR/REC-xml

29 Find Out More The XML Industry Portal –www.xml.orgwww.xml.org O’Reilly XML site –www.xml.comwww.xml.com XML Cover Pages –www.oasis-open.org/cover/www.oasis-open.org/cover/ Café Con Leche –www.ibiblio.org/xml/www.ibiblio.org/xml/

30 Find Out More Scottish Health and Community Care XML Steering Group –www.isdscotland.org/xmlwww.isdscotland.org/xml

31 XML Tools XSV - Open Source XML Schema Validator –www.ltg.ed.ac.uk/~ht/xsv-status.htmlwww.ltg.ed.ac.uk/~ht/xsv-status.html MSXML 4.0 –www.microsoft.com/downloads/detai ls.aspx?FamilyID=3144b72b-b4f2- 46da-b4b6-c5d7485f2b42www.microsoft.com/downloads/detai ls.aspx?FamilyID=3144b72b-b4f2- 46da-b4b6-c5d7485f2b42

32 XML Tools XML Spy 2004 IDE –www.altova.com/products_ide.htmlwww.altova.com/products_ide.html Free XML Tools and Software –www.garshol.priv.no/download/xmlt ools/www.garshol.priv.no/download/xmlt ools/

33 Printed Sources Numerous printed sources – for more information visit –Charles F. Goldfarb's www.xmlbooks.com www.xmlbooks.com –www.amazon.comwww.amazon.com


Download ppt "Introduction to XML John Arnett, MSc Standards Modeller Information and Statistics Division NHSScotland Tel: 0131 551 8073 (x2073)"

Similar presentations


Ads by Google