Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © 2003 Pearson Education, Inc. Slide 6-1 Created by Cheryl M. Hughes, Harvard University Extension School Cambridge, MA The Web Wizards Guide.

Similar presentations


Presentation on theme: "Copyright © 2003 Pearson Education, Inc. Slide 6-1 Created by Cheryl M. Hughes, Harvard University Extension School Cambridge, MA The Web Wizards Guide."— Presentation transcript:

1

2 Copyright © 2003 Pearson Education, Inc. Slide 6-1 Created by Cheryl M. Hughes, Harvard University Extension School Cambridge, MA The Web Wizards Guide to XML by Cheryl M. Hughes

3 Copyright © 2003 Pearson Education, Inc. Slide 6-2 CHAPTER 5 Links in XML

4 Copyright © 2003 Pearson Education, Inc. Slide 6-3 Overview of Hyperlinks A hyperlink in a web page is an object that a user can click on that will redirect the browser to another web page, file or position within the page Hyperlinks in HTML make the web interactive Links in XML are similar in syntax to links in the HTML language XML Linking Language (XLink) is the XML specification for linking The resource being linked to is called the target resource

5 Copyright © 2003 Pearson Education, Inc. Slide 6-4 Linking in HTML The anchor element Require the user to take an action – usually by clicking on the link, which can consist of images or text The target of the link can be an absolute or relative URL The element Does not require user intervention – resource loads automatically when page loads. Usually used for graphics in HTML

6 Copyright © 2003 Pearson Education, Inc. Slide 6-5 HTML Link Example: HTML file 1 2 3 Link Examples in HTML 4 5 6 Here are some examples of links in HTML: 7 8 This is an absolute link to a new page 9 10 11 This is a relative link to a new page 12 13 14 This 15 16 17 This is link that launches an email message 18 19 20

7 Copyright © 2003 Pearson Education, Inc. Slide 6-6 HTML Link Example: Browser

8 Copyright © 2003 Pearson Education, Inc. Slide 6-7 HTML Link Limitations Can only point to one target resource Links are unidirectional – once the link is followed, there is no path back to the original document Only certain HTML elements can be used for providing linking functionality

9 Copyright © 2003 Pearson Education, Inc. Slide 6-8 XLink Overview The XLink specification was released by the W3C in July 2001 Benefits over HTML links: Supports multi-directional links, which allows the target resource to link back to the originating document Can contain multiple destinations Any XML element can be a linking element XML link behavior can be programmed XLink specification defines two types of links Simple links Extended links

10 Copyright © 2003 Pearson Education, Inc. Slide 6-9 Simple XLink Links Syntax is similar to HTML links Simple links are: Unidirectional Can only link to one target resource Can be defined on any XML element Defined as a namespace: http://www.w3c.org/1999/xlink Required attributes: href and type

11 Copyright © 2003 Pearson Education, Inc. Slide 6-10 Simple Links: Attributes type : Determines the type of link – for simple, the value is always simple href : Defines the URL of the target resource show : Defines the behavior of the link after it is activated actuate : Defines when the link will be activated role : Describes the resource being linked to title : Used to describe the link arcrole : Describes the relationship between the source and target documents

12 Copyright © 2003 Pearson Education, Inc. Slide 6-11 Simple XLink Example 1 2 10Link to Map image 11

13 Copyright © 2003 Pearson Education, Inc. Slide 6-12 Simple XLink Example with DTD 1 2 8]> 9 Link to Map image Attributes that are defined as #FIXED in the DTD do not have to be included in the XLink element

14 Copyright © 2003 Pearson Education, Inc. Slide 6-13 XLink Extended Links Extended links provide much greater functionality than simple links Extended links: Can link to multiple target resources Are multi-direction Extended links can be any of the following types: extended, resource, locator, arc or title

15 Copyright © 2003 Pearson Education, Inc. Slide 6-14 Extended XLink Example 1 3 6 9 12Link to Course 13

16 Copyright © 2003 Pearson Education, Inc. Slide 6-15 Extended XLink Example with DTD 1 2 7 8 11]> 12 14 17 20 23


Download ppt "Copyright © 2003 Pearson Education, Inc. Slide 6-1 Created by Cheryl M. Hughes, Harvard University Extension School Cambridge, MA The Web Wizards Guide."

Similar presentations


Ads by Google