Presentation is loading. Please wait.

Presentation is loading. Please wait.

SNU OOPSLA Lab. A Tour of XML © copyright 2001 SNU OOPSLA Lab.

Similar presentations


Presentation on theme: "SNU OOPSLA Lab. A Tour of XML © copyright 2001 SNU OOPSLA Lab."— Presentation transcript:

1 SNU OOPSLA Lab. A Tour of XML © copyright 2001 SNU OOPSLA Lab.

2 SNU OOPSLA Lab. Table of Contents What is XML ? The Origin of XML Elements and Attributes What is the DTD? Hypertext Links Document Formatting

3 SNU OOPSLA Lab. What is XML ? - 1 An acronym for ‘eXtensible Markup Language’ A meta-language that describes other languages A data format for storing structured and semi- structured text for dissemination and ultimate publication, perhaps on a variety of media

4 SNU OOPSLA Lab. What is XML ? - 2 Properties –tags enclose identifiable parts of the document –self-describing –physical/logical structure physical structure : allows components of the document, called entities logical structure : allows a document to be divided into named units and sub- units, called elements

5 SNU OOPSLA Lab. Sub-unit Unit Document elements Logical Structure entities (internal) (separate) Physical Structure

6 SNU OOPSLA Lab. This substance if hazardous to health See procedure 12A. 7 for information on protective clothing required. XML markup

7 SNU OOPSLA Lab. What is XML ? - 3 –DTD(Document Type Definition) define the elements allowed in a particular type of document a parser uses it to check the validity of documents –style sheet used to specify an output format for each element

8 SNU OOPSLA Lab. The Origin of XML GMInternet WWW SGML HTML XML 1960 1986 1992 1997 GM = Generalized Markup

9 SNU OOPSLA Lab. Applications Data exchange applications –identified domain : XML-EDI –general meta-data part : MCF, XML-Data, RDF Document publishing applications

10 SNU OOPSLA Lab. ASCII / ISO 10646 / UnicodeTCP/IP HTTPXMLCSSSPDL XLLXSL Complex document layout Simple document layout Web publishing Interactive publishing Page layout

11 SNU OOPSLA Lab. Elements - 1 An element consists of a start tag, an end tag, and data –e.g.) Are you going to Scarborough failr ? Element names are case-sensitive Some hierarchical structures may be recursive

12 SNU OOPSLA Lab. Elements - 2 Content types –element content an element that does not directly contain text, but contains other elements –mixed content an element that contains a mixture of elements and text –data content an element that happens to contain only text –empty element an element that may not be allowed to contain data

13 SNU OOPSLA Lab. … This paragraph contains an emphasized phrases in the middle. This paragraph contains a figure here. … element content mixed content data content empty element

14 SNU OOPSLA Lab. Attributes Provides refined information about an element Embedded in the element start-tag Consists of an attribute name and an attribute value –value is enclosed by quotes –name and value are case-sensitive

15 SNU OOPSLA Lab. Reserved Attributes - 1 Languages –‘xml:lang’ is reserved for storage of both language and country details e.g.) … –sub-code specify a country code e.g.) …

16 SNU OOPSLA Lab. Reserved Attributes - 2 Significant spaces –‘xml:space’ is reserved for distinguish space characters in elements that contain other elements from spaces in elements that contain text possible values : ‘default’, ‘preserve’

17 SNU OOPSLA Lab. Declarations Contain instructions to the XML processor Delimited by ‘ ’ Types of declarations –document type declaration e.g.) –comments e.g.> –character data sections >> button.]]> –XML declaration

18 SNU OOPSLA Lab. Concepts of DTD(1) DTD(Document Type Definition) –An optional but powerful feature of XML –Comprises a set of declarations that define a document structure tree –Some XML processors read the DTD and use it to build the document model in memory –Establishes formal document structure rules It define the elements and dictates where they may be applied in relation to each other

19 SNU OOPSLA Lab. Concepts of DTD(2) Declare Vs. Define –Declare  “This document is a concert poster” –Define  “A concert poster must have the following features” DTD define –Element type + Attribute + Entities Valid Vs. Invalid –Valid  conforms to DTD –Invalid  fail to conform to DTD Well formed XML Document Valid XML Document

20 SNU OOPSLA Lab. Hypertext Links(XLL) - 1 Terminology –resource target object –linking element source –traversal the act of moving from the liking element to the resource

21 SNU OOPSLA Lab. Hypertext Links(XLL) - 2 Simple link & Extended link –simple link the primitive one-directional linking scheme, but make it possible to traverse links between documents –Extended link resources can be cross-related an extended link contains a number of locator elements, each one points to a resource

22 SNU OOPSLA Lab. Hypertext Links(XLL) - 3 Attributes in the linking element can influence –the means by which a link can be activated a link could be activated by the person(‘user’ link) directly by the application(‘auto’ link) –the presentation technique required once it has been activated application may jump to the specified resource(‘replace’) display the resource in another window(‘new’) insert the resource into the original text(‘embed’)


Download ppt "SNU OOPSLA Lab. A Tour of XML © copyright 2001 SNU OOPSLA Lab."

Similar presentations


Ads by Google