Presentation is loading. Please wait.

Presentation is loading. Please wait.

XML. Markup Languages A markup language is a formal way of annotating a document or collection of digital data using embedded encoding tags to indicate.

Similar presentations


Presentation on theme: "XML. Markup Languages A markup language is a formal way of annotating a document or collection of digital data using embedded encoding tags to indicate."— Presentation transcript:

1 XML

2 Markup Languages A markup language is a formal way of annotating a document or collection of digital data using embedded encoding tags to indicate the structure of the document or data file, and the contents of its data elements. This markup provides a computer with information about how to process and display marked-up documents.

3 What is XML? XML is a grammatical system for creating languages… a meta-language Use XML to design your own markup language, consisting of meaningful tags that describe the data they contain Create a language for describing…anything

4 SGML Standard Generalized Markup Language, ISO (International Standards Organization) standard ISO/IEC 8879:1986, first used by the publishing industry, for defining, specifying, and creating digital documents that can be delivered, displayed, linked, and manipulated in a system-independent manner. the parent of XML an international standard for the description of marked- up electronic text a metalanguage: a means of formally describing a language XML is a subset of SGML SGML is much more complex than XML

5 HTML HyperText Markup Language, an SGML- derived markup language used to create documents for World Wide Web applications. HTML emphasizes design and appearance rather than the representation of document structure and data elements.

6 XML A simplified subset of SGML that is designed specifically for use with the World Wide Web and that provides for more sophisticated data structuring and validation than HTML. XML is widely held to be the successor to HTML as the language of the Web.

7 XML What is XML? –EXtensible Markup Language. XML is a set of rules for defining markup languages and describing data. Why XML? –XML is a standard means of delivering structured data via Web applications. –XML is extensible—both a blessing and a burden –Authors can define their own tags and attributes, e.g. CML Chemical markup language –You may hear someone from your IT department mention "well-formed" XML. A well-formed XML file conforms to a set of very strict rules that govern XML. If a file doesn't conform to those rules, XML stops working

8 XML vs. HTML HTML tells Web browsers how to display text, images, etc.— emphasis is on display Unlike HTML, XML can “take database information with it”; emphasis is on structure, relationships, and ‘meaning’ XML is a set of rules that are used to create markup languages while HTML is itself a markup language Use HTML to describe the appearance of a document and XML to describe the structure

9 XML vs. HTML HTML defines only the appearance of your data — it's a pure display language. XML describes the structure and meaning of your data. Using tags that describe the structure and meaning of your data makes it possible to reuse that data in any number of ways. For example, if you have a block of sales data, and each item in the block is clearly identified, you can load just the items that you need into a sales report and load other items into an accounting database. HTML is limited to a predefined set of tags that all users share. XML allows you to create any tag you need to describe your data and the structure of that data.

10 Classes of Documents Poetry Poem Stanza Verse Foot Caesura Monograph Title page Table of contents Chapters Sections Paragraphs Appendix Index

11 Types of Markup Procedural –Display: font, italic, bold, etc. Descriptive –Structural (document components) –Nominal e.g. Referential –Linking

12 Descriptive Markup Defines structural components of a class of documents Defines relationships between data elements Specifies frequency (repeatable, optional, mandatory) Establishes the sequence of elements Codified in a Document Type Definition (DTD) or an XML Schema User-friendly documentation in a tag library

13 Document Type Definitions/Schemas Class of Documents Literary texts Archival inventories Web pages Electronic commerce Catalog records Cultural objects Hypertext documents Protocol TEI EAD Dublin Core BizTalk MARC CDWA/VRA Core HTML

14 Separating Markup and Display Content Presentation Output MARC record ILS Software Browser

15 Separating Markup and Display Content Presentation Output EAD document Stylesheet file Browser, Print

16 Characteristics of Encoding Standards Class of documents Identifiable set of common elements Codification in a standard –MARC 21 standard –EAD DTD and Tag Library Standards maintenance process

17 Something to remember about XML XML does not do anything itself. It is pure information wrapped in XML tags. You must use other means to send, receive or display the data XML is used by XML technologies To create Detailed description to view in a browser PDF for print Summary entry to view in a browser

18 XML Concepts Document Type Definitions/Schemas –Defines document structure Elements –Informational units Attributes –Modify elements Entities –External files Style sheets –Prescribe presentation

19 Elements (nouns) Have start tags and end tags – Moby Dick Have formal names and tag names –Formal name = paragraph –Tag name (generic identifier) =

20 Elements (nouns) May contain text –PCDATA (parsable character data) Moby Dick</title May be empty – (line break) –XML syntax = (empty element syntax)

21 Elements (nouns) May contain other elements –Wrappers –Nesting –Example: September 12 1958

22 XML: elements content English

23 Attributes (adjectives) Modify the meaning of elements – Honda Attributes of cars –Color –Year –Model Honda

24 XML attributes Attributes are simple name/value pairs associated with an element content English 20 Sept 2004

25 Entities A set of characters references as a unit –Special characters Language keyboard Character map: XML software Character entity: $141; &amp –Non-text files (images, sound files) –External data files

26 Style Sheets Separate file Controls presentation of data –Text format: font, size, color –Text layout: tabs, indents, line spacing, line breaks, tables Can supply default text and images

27 XML example OK Computer Radiohead pop 1997 Stanley Road Paul Weller pop 1995

28 XML must be well-formed a root element is required …..all your tags and content… closing tags are required

29 XML must be well-formed (2) elements must be properly nested 10 boxes 10 boxes

30 XML must be well-formed (3) case matters attribute values must be enclosed in quotation marks, e.g. langcode=“fre” element names must obey some basic rules, e.g. cannot start with numbers or punctuation characters, cannot contain spaces

31 Valid XML Valid XML: rules specify elements and attributes used and how used Valid XML provides consistency and facilitates the exchange of data Valid XML is important for displaying, processing and exchanging XML in a wider environment Must conform to a Document Type Definition (DTD) or Schema Archives: Encoded Archival Description - EAD version 1; EAD 2002

32 Valid XML John Rylands University Library of Manchester GB 0133 NCN Papers of Norman Nicholson 1899-1987 0.44 cu.m; 1,201 items English Nicholson, Norman Cornthwaite, 1914-1987 Created by the John Rylands Library archivist ………..

33 Document Type Definitions A Document Type Definition defines the building blocks of an XML document It specifies elements and attributes and defines how they can be used People can agree to use a common DTD for interchanging data You can include a DTD in your XML source file, or point to an external DTD

34 Schemas Schemas perform the same task as DTDs Schemas use XML syntax Schemas support complex data types Schemas are extensible One XML document can point to more than one schema

35 A simple XML document Rachel John Reminder Don't forget the concert!

36 HTML vs. XML (1) HTML is ONLY for display, typically in a Web browser HTML tags do not describe the content HTML cannot easily be extracted HTML: Papers of Peter Rowe XML: Papers of Peter Rowe HTML: 21 May 2004 XML: 21 May 2004

37 HTML vs. XML (2) XML tags are self-describing XML tags can be specified by anyone XML is user and machine readable

38 Why use XML? Because everyone else is! International standard, supported by the W3C XML is open, licence free and platform neutral XML is human and machine readable XML documents are text documents

39 More reasons to use XML Separation of content and presentation –With proprietary systems content is inextricably bound up with format XML does not determine the presentation of the data - You can use style sheets to present XML data

40 ..and even more reasons Hierarchical structure - XML documents are hierarchical in nature – with one top-level root element, and hence XML is an excellent choice for setting out hierarchical data in an easy-to-read fashion The ability to manipulate and customise - data can be shaped and additions made as the author wishes

41 and for data exchange XML is the main basis for defining data exchange languages Meaningful tags facilitate extraction – data can be manipulated as required Text based - highly portable

42 Summary XML is simple, flexible and great for data exchange XML must be well-formed and valid DTDs and Schemas provide tags, attributes and rules EAD is a DTD for archive descriptions

43 A brief detour into metadata: Two ways to designate content In MARC:245 04 $a The Big heat In XML: Big heat value

44 In XML the name-value pair comprises an element An element has these parts: –Start tag –Element content –End tag content Goldfinches

45 Element rules and features Elements can hold data Boston Elements can hold other elements ad infinitum A letter to Orestes A. Brownson Hildreth, Richard, 1807-1865. Elements must be “properly” nested

46 A quick look at other XML entities Attributes qualify elements Caption title. Document Type Definitions (DTDs) control the structure of XML documents XML Schemas give more control than DTDs Extensible Stylesheet Language Transformation (XSLT) stylesheets transform one XML document into another (or into HTML)

47 What does XML allow us to do? Structure data with a flexible and extensible set of rules Share data in a non-proprietary format, especially among “incompatible” systems Reuse data, e.g., in different presentation formats for different purposes

48 Namespaces A namespace identifies a specific set of elements Namespaces allow metadata terms to be unambiguously used across applications –Defines what ‘Date’ or ‘Title’ means in a specific usage, or namespace Each namespace has a unique identifier associated with it

49 Namespaces - Example Internet Ethics Duncan Langford Book ISBN 0333776267

50 Namespaces - Example <d:student xmlns:s='http://www.develop.com/student' ' xmlns:w='urn:schemas.develop.com:workshop'> 3235329 Jeff Smith Emerging Metadata Topics XNL

51 Purpose of Using Namespace in XML To group all the related elements and attributes from a single XML application together so that software can easily recognize them. To distinguish between elements and attributes from different vocabularies with different meanings and that happen to share the same name. xmlns:dc="http://purl.org/dc/elements/1.1/ “


Download ppt "XML. Markup Languages A markup language is a formal way of annotating a document or collection of digital data using embedded encoding tags to indicate."

Similar presentations


Ads by Google