Download presentation
Presentation is loading. Please wait.
Published byJulianna Fletcher Modified over 9 years ago
1
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 1 of 23 Objectives In this lesson, you will learn to: * Identify the types of links in XML documents * Identify the need for XPointer for referencing specific sections within an XML document
2
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 2 of 23 Use of Hyperlinks * A hyperlink or link is an association between a source document and a target document, or between a piece of text and an object, such as an image. * When clicked, hyperlinks enable you to move from one page to another or from one location to another location on the same page.
3
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 3 of 23 Use of Hyperlinks (Contd.) * Hyperlinks in HTML have the following limitations: 3 Using hyperlinks in HTML, you can point at only a single document. 3 Links are one way. The linking document knows to what it is linking, but the target document does not know how it is linked. * To overcome these limitations of hyperlinks in HTML, W3C recommends the use of two new types of linking mechanisms in XML. These are called XLink and XPointer.
4
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 4 of 23 Introduction to XLink * XLink stands for XML Linking Language. It is a specification for enhanced and improved linking capabilities that are designed for use with XML documents. * XLink allows XML documents to establish a linking relationship between more than one document and create linking documents that reside in a separate location from the linked documents. * In XML, any element can become a source of a link. An element that contains a link is called a linking element.
5
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 5 of 23 Introduction to Xlink (Contd.) * XLinks are of two types: 3 Simple links 3 Extended links
6
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 6 of 23 Simple Links * A simple link is similar to the link created in HTML using the ANCHOR element. It connects an element in a source document to a target document. * Simple links are inline links. An inline link is a part of the element and can connect in one direction. * A simple link can have only one resource identifier or locator that contains data about the link. * Simple links have attributes that suggest how a browser or a processor should display and traverse the link. For example, the xlink:show attribute describes how a browser should display the remote resource.
7
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 7 of 23 Simple Links (Contd.) * Simple links allow you to specify whether the remote resource should be displayed in the same browser window, a new window, or within the current document.
8
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 8 of 23 Extended Links * An extended link can point to several resources at a time. It can be used to create links to other documents from your documents, even though you have no write privileges in the other documents. * Extended links associate an XML element to multiple links.
9
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 9 of 23 Extended Links (Contd.) * Extended links are of two types: 3 Out-of-line links ä A link that is described by a resource but which is not one of the links in the resource is called an out ‑ of ‑ line link. ä An example is a catalog document that describes all the links in a Web site without actually participating in any of the links.
10
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 10 of 23 Extended Links (Contd.) 3 Multi-directional links ä An extended link may also be a multi-directional link that joins several documents in a single link, which can be traversed from any one of its resources. Extended links enable you to specify multiple links from one source. ä For example, you might want to provide multiple links to various topics, such as information about Michelangelo and Leonardo da Vinci from a single category named Artists.
11
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 11 of 23 Behaviour of XLink * XLink uses the following attributes for creating simple or extended links: 3 href 3 role 3 title 3 show 3 actuate 3 type
12
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 12 of 23 Behaviour of Xlink (Contd.) * The href attribute * A linking element must have a resource locator, that is, the resource targeted by the link. * The href attribute of XLink is used to specify the target of the link. * The role attribute * The role attribute is a means of providing applications with additional information about a link. * Applications that use XLink can get the information about the role of a link by referring to the value of the role attribute.
13
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 13 of 23 Behaviour of Xlink (Contd.) * The title attribute 3 The title attribute allows you to specify a label to provide information to the user. 3 While the role attribute is meant for the system and the application, the title attribute is meant for providing supplementary information to the user.
14
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 14 of 23 Behaviour of Xlink (Contd.) * The show attribute 3 The show attribute can take any one of the three values, namely, embed, replace, or new. 3 The behaviors represented by these values are described in the table below: ValueBehavior embedIf this value is specified, the contents of the linked object will appear embedded within the document from which this link was activated. replaceIf this value is specified, the content of the linked object will replace the document from which the link was activated. This is the default behavior of HTML links. newIf this value is specified, the content of the linked object will appear separate from the document from which the link was activated, such as in a new browser window.
15
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 15 of 23 Behaviour of Xlink (Contd.) * The actuate attribute 3 The actuate attribute allows you to specify the timing of the link. 3 The actuate attribute can take one of the following predefined values: ValueBehavior OnRequest This specifies that the link should be traversed only when the user requests it by clicking on the linking element. OnLoad The link is traversed once the link is loaded. For example, you may set the actuate attribute to OnLoad for an image that is to be embedded in the linking document. The link will be traversed after the image is loaded.
16
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 16 of 23 Behaviour of Xlink (Contd.) * The type attribute 3 The type attribute is used to specify the type of the link that is to be created for an element. 3 The value of this attribute can be set to simple, extended, resource, locator, or arc. 3 simple ä A simple link is similar to an HTML hyperlink. It connects an element in a source document to a target document. ä This means that the link can only be used in one direction, from the source document to the target document.
17
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 17 of 23 Behaviour of Xlink (Contd.) 3 extended ä When you set the value of the type attribute to extended, it allows you to create multi-directional links between many documents. 3 resource ä XML allows you to create multi-directional links in which you can have an element that can be both the source as well as the target of a link. ä The source and the target have been given the generic name resource. ä A resource can be either local or remote. A local resource is contained inside the extended link element.
18
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 18 of 23 Behaviour of Xlink (Contd.) 3 locator ä This link type is used to represent remote resources. ä A remote resource exists outside the extended link element. 3 arc ä An arc describes a traversal path between two links.
19
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 19 of 23 Introduction to Xpointer * XPointer, the XML Pointer Language, defines an addressing scheme for the individual parts of an XML document. * It can be used by any application that needs to identify a part or a location of an XML document. * XPointer is a new specification designed to link to portions of a document without having to link to the entire document. * XPointer is a proposal at the W3C that concerns addressing links to specific points within documents.
20
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 20 of 23 Just a Minute… * Which of the following elements cannot be displayed as a link? 3 Buttons 3 Text 3 Menu Items 3 List Items
21
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 21 of 23 Just a Minute… * Which of the following is a type of extended link? 3 In-line link 3 Straight-line link 3 Out-of-line link 3 One-line link
22
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 22 of 23 Summary In this lesson, you learned that: * XLink stands for XML Linking Language. It is a specification for enhanced linking capabilities designed for use with XML documents. * XLinks are of two types. These are: 3 Simple links 3 Extended links
23
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 23 of 23 Summary (Contd.) * The following attributes can be used to specify the behavior of simple or extended links: 3 href 3 role 3 title 3 show 3 actuate 3 type * XPointer, the XML Pointer Language, defines an addressing scheme for accessing individual parts of an XML document.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.