1 Linking in XML A way of creating hyperlinks in XML documents, Internal-Link and External-Link.

Slides:



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

LIS650lecture 1 XHTML 1.0 strict Thomas Krichel
Applications of XSLT. generating Word documents WordML provides formatting and content elements Word 2003 can read WordML files XSLT can be used to transform.
4. Internet Programming ENG224 INFORMATION TECHNOLOGY – Part I
What is XML? a meta language that allows you to create and format your own document markups a method for putting structured data into a text file; these.
II. Basic Web Concepts.
1 XSLT – eXtensible Stylesheet Language Transformations Modified Slides from Dr. Sagiv.
XP 1 Developing a Basic Web Site Tutorial 2: Web Site Structures & Links.
1 XML DTD & XML Schema Monica Farrow G30
XLink & XPointer ShengWu. Contents Covered XLink –XLink Versus HTML links –Linking Elements –Simple Links –Link Behavior –Extended Links.
Internet Technologies1 XLink The Wonderful World of Oz example and its DTD are from “XML in a Nutshell” by Elliotte Rusty Harold.
Introduction to XLink Transparency No. 1 XML Information Set W3C Recommendation 24 October 2001 (1stEdition) 4 February 2004 (2ndEdition) Cheng-Chia Chen.
XLink Van Lepthien CSCI 7818 Fall Overview What is XLink? W3C Stuff XLink Elements Linkbases Traversals Implementations Comments References.
1 COS 425: Database and Information Management Systems XML and information exchange.
XLINK A mechanism to link xml documents. Fujitsu’s free xlink processor xwand/activity/xbrltools/xlip/index.htmlhttp://software.fujitsu.com/en/interstage-
1 XML Linking Language (XLink) W3C Working Draft - 3/3/1998.
Create a Web Site with Frames
Introduction to XML This material is based heavily on the tutorial by the same name at
Chapter 2 Introduction to HTML5 Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Introducing HTML & XHTML:. Goals  Understand hyperlinking  Understand how tags are formed and used.  Understand HTML as a markup language  Understand.
ECA 228 Internet/Intranet Design I Intro to XML. ECA 228 Internet/Intranet Design I HTML markup language very loose standards browsers adjust for non-standard.
XP New Perspectives on XML Tutorial 4 1 XML Schema Tutorial – Carey ISBN Working with Namespaces and Schemas.
XP New Perspectives on XML Tutorial 3 1 DTD Tutorial – Carey ISBN
Sheet 1XML Technology in E-Commerce 2001Lecture 6 XML Technology in E-Commerce Lecture 6 XPointer, XSLT.
Chapter 16 The World Wide Web Chapter Goals ( ) Compare and contrast the Internet and the World Wide Web Describe general Web processing.
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
Chapter 16 The World Wide Web. 2 The Web An infrastructure of information combined and the network software used to access it Web page A document that.
16-1 The World Wide Web The Web An infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that information.
XML CPSC 315 – Programming Studio Fall 2008 Project 3, Lecture 1.
Xpath Xlink Xpointer Xquery Sources:
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
Chapter 1 Understanding the Web Design Environment Principles of Web Design, 4 th Edition.
Introduction to XML. XML - Connectivity is Key Need for customized page layout – e.g. filter to display only recent data Downloadable product comparisons.
Bare bones notes. Suggested organization for main folder. REQUIRED organization for the 115 folder.
Chapter 1 XHTML: Part I The Web Warrior Guide to Web Design Technologies.
XHTML. Introduction to XHTML What Is XHTML? – XHTML stands for EXtensible HyperText Markup Language – XHTML is almost identical to HTML 4.01 – XHTML is.
XP Dreamweaver 8.0 Tutorial 3 1 Adding Text and Formatting Text with CSS Styles.
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
XP 1 DECLARING A DTD A DTD can be used to: –Ensure all required elements are present in the document –Prevent undefined elements from being used –Enforce.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
1 Tutorial 13 Validating Documents with DTDs Working with Document Type Definitions.
Chapter 8 Introduction to HTML and Applets Fundamentals of Java.
Unit 2, cont. September 12 More HTML. Attributes Some tags are modifiable with attributes This changes the way a tag behaves Modifying a tag requires.
XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.
E0262 – MIS – Multimedia Storage Techniques XML (Extensible Markup Language  XML is a markup language for creating documents containing structured information.
Unit 3 Day 6 FOCS – Web Design. Journal Unit #3 Entry #4 Write the source code that would make the following display on a rendered page: Shopping List.
Copyrighted material John Tullis 10/17/2015 page 1 04/15/00 XML Part 3 John Tullis DePaul Instructor
Processing of structured documents. XML Linking Language (XLink) zCreate and describe links between resources zboth basic unidirectional links and more.
Tutorial 8 Designing a Web Site with Frames. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore the uses of frames.
XLinks Praveen Polishetty. Contents : XLink Capabilities XLink Concepts XLink Core Properties XLink Semantic Properties XLink Behavior Properties XLink.
XML – Part III. The Element … This type of element either has the element content or the mixed content (child element and data) The attributes of the.
HTML BTEC National in Computing Section5. Create Information “HTML: defining HTML, discussing HTML uses and demonstrating HTML basics, HTML structure…..
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2.
Tutorial 3 Adding and Formatting Text with CSS Styles.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
SNU OOPSLA Lab. Hypertext links(XLL) © copyright 2001 SNU OOPSLA Lab.
2.1 XHTML. Motto High thoughts must have high language. –Aristophanes.
Introducing XLink and XPointer ©NIITeXtensible Markup Language/Lesson 10/Slide 1 of 23 Objectives In this lesson, you will learn to: * Identify the types.
XML CSC1310 Fall HTML (TIM BERNERS-LEE) HyperText Markup Language  HTML (HyperText Markup Language): December  Markup  Markup is a symbol.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Linking XML Documents Ellen Pearlman Eileen Mullin Programming the Web.
Processing of structured documents Part 7. XML Linking Language (XLink) zCreate and describe links between resources zboth basic unidirectional links.
CHAPTER TWO HTML TAGS. 1.Basic HTML Tags 1.1 HTML: Hypertext Markup Language  HTML stands for Hypertext Markup Language.  It is the markup language.
 XML derives its strength from a variety of supporting technologies.  Structure and data types: When using XML to exchange data among clients, partners,
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 14 This presentation © 2004, MacAvon Media Productions XML.
XML Schema – XSLT Week 8 Web site:
Rendering XML Documents ©NIITeXtensible Markup Language/Lesson 5/Slide 1 of 46 Objectives In this session, you will learn to: * Define rendering * Identify.
XLink February 20, 2006 Billy Timmins. Learning objectives Learn different techniques of implementing XLink's in XML create a custom XLink learn the functionality.
 2002 Prentice Hall, Inc. All rights reserved. 1 XLink and XPointer Outline 1Introduction 2XML Linking Language (XLink) 2.1 Simple Links 2.2 Extended.
Chapter 16 The World Wide Web.
Presentation transcript:

1 Linking in XML A way of creating hyperlinks in XML documents, Internal-Link and External-Link

2 Introduction XLink vs. HTML Links XML Linking Language (XLink) –XLink Element –XLink Attributes –Simple Links –Extended Links XML Pointer Language (XPointer)

3 Introduction Linking in XML is divided into two parts: XLink and XPointer External-Link: XLink defines a standard way of creating hyperlinks in XML documents –It defines how one document links to another document Internal-Link: XPointer allows the hyperlinks to point to more specific parts (fragments) in the XML document –It defines how individual parts of a document are addressed

4 XLink vs. HTML Links HTML: –The Web conquered gopher for one reason: HTML made it possible to embed hypertext links in documents –These links could insert images or let the user to jump from inside one document to another document –Or to jump to another part of the same document –Limitations: Single URL only: URLs are limited to pointing at a single document A pre-set named anchor is required before the link to any part of a document can be set Links are purely one-way communication: from reader to targeted documents

5 XLink vs. HTML Links XML Linking –Combining XLink and XPointer to embed internal- and external- links as in HTML. –Use XSLT for rendering the XML documents into HTML for viewing –XLink is a proposal for more powerful links between documents designed especially for use with XML documents –Supports multidirectional links where the links run in more than one direction.

6 XLink vs. HTML Links XML Linking –Any element can become a link, not just the element. –Links do not even have to be stored in the same file as the documents they connect. –These features make XLinks more suitable not only for new uses, but for things that can be done only with considerable effort in HTML, Such as cross-references, footnotes, end notes, interlinked data, and more.

7 XLink vs. HTML Links Application Support –Currently, there are no general-purpose applications that support arbitrary XLinks –That's because XLinks have a much broader base of applicability than HTML links. –Specific linking processors can be found: i.e., xlip from Fujitsu, used to demonstrate the traverse of linking, for the detail information regarding the tools, visit: –XLinks are not just used for hypertext connections and embedding images in documents –They can be used by any custom application that needs to establish connections between documents and parts of documents, for any reason.

8 XLink Element XLink Syntax –It is impossible for browsers to predict what hyperlink elements will be called in XML documents –The solution for creating links in XML documents was to put a marker on elements that should act as hyperlinks –In XML, any element can be a link or part of a link. <homepage xlink:type="simple" xlink:href=" Visit W3Schools <homepage xlink:type="simple“ xlink:href=" Visit W3C To get access to the XLink attributes and features we must declare the XLink namespace at the top of the document

9 XLink Element (cont.) XLink elements are identified by an xlink:type attribute with one of the seven values (next slide) An example: <COMPOSER xmlns:xlink=" xlink:type="simple" xlink:href=" Beth Anderson The xlink prefix must be bound to the namespace URI Linking information of these elements are included in the attributes, not the element names Attributes define the linking behavior

10 XLink and DTDs DTDs used with documents that use XLink –Validation –Reduce the number of XLink attributes in XML document –Provide default values in DTD, and rewrite as:

11 XLink Element (cont.) To make the linking as the default values of an element, then add it to the DTD file of an XML document The previous example, defined the element in a DTD file: <!ATTLIST COMPOSER xmlns:xlink CDATA #FIXED xlink:type CDATA #FIXED "simple" xlink:href CDATA #REQUIRED> Rewrite the example element: <COMPOSER xlink:href=" Beth Anderson

12 XLink --Semantic Attributes Descriptions of the Remote Resource A linking element may have optional xlink:role and xlink:title attributes that describe the remote resource –The document or other resource to which the link points. –The title contains plain text that describes the resource. –The role contains a URI pointing to a document that more fully describes the resource. –For example, the title might describe what a page does and the role might point to a help page for the page <SEARCH xlink:href=" xlink:title="Search with Google" xlink:role=" Search the Web with Google

13 XLink – Behaviour Attributes Link Behavior Attributes (show and actuate) –The show attribute suggests how the content should be displayed when the link is activated xlink: show = “new” indicates that the resource should be displayed in a new windows, –The actuate attribute suggests whether the link should be traversed automatically or whether a specific user request is required Xlink:actuate=“onRequest” indicates that the resource should not be retrieved until the users requests it (e.g. by clicking on the link) These are application dependent, however, applications are free to ignore the suggestions. –All these are based on the XLink-aware application

14 xlink:show The show attribute is used to communicate the desired presentation of the ending resource on traversal from the starting resource Constraint: show Value –The xlink:show attribute has five legal values: replace new embed other none

15 xlink:actuate The actuate attribute is used to communicate the desired timing of traversal from the starting resource to the ending resource Constraint: actuate Value –If a value is supplied for an actuate attribute, it must be one of the values onLoad onRequest Other none

16 XLink -- Links XLink offers two kinds of links: –Simple links Shorthand syntax for a common kind of link, an outbound link with exactly two participating resources (into which category HTML-style A and IMG links fall). Because simple links offer less functionality than extended links, they have no special internal structure. –Extended links Extended links offer full XLink functionality, such as inbound and third-party arcs, as well as links that have arbitrary numbers of participating resources. As a result, their structure can be fairly complex, including –Elements for pointing to remote resources, –Elements for containing local resources, –Elements for specifying arc traversal rules, –Elements for specifying human-readable resource and arc titles.

17 Simple Links A simple link is a link that associates exactly two resources, one local and one remote, with an arc going from the former to the latter. –Thus, a simple link is always an outbound link Links one resource to another (similarly to HTML link) Linking elements –Specify linking information <COMPOSER xlink:type = "simple" xlink:href = " –Linking element (COMPOSER) is local resource – is remote resource

18 Fig Illustrating a simple link from document 1 to document 2.

19 Extended Links Definition: An extended link is a link that associates an arbitrary number of resources –The participating resources may be any combination of remote and local –Link multiple combinations of local and remote resources Remember the “back” button in homepage to traverse back to previous document? It is also a browser function. Multidirectional links –Traverse between resources (Fig. 14.6) –Can link any number of resources (Fig. 14.7) –Unidirectional links (Fig. 14.5) may not offer return to local resource

20 Fig Two unidirectional links.

21 Fig Multidirectional link.

22 Fig Multidirectional linking between four resources.

23 Extended Links (cont.) Syntax –Extended links generally point to more than one target and from more than one source. –Both sources and targets are called by the more generic word “resource”. –“Resources” are divided into remote resources and local resources. –A local resource It is actually contained inside the extended link elements It is the content of an element of arbitrary type that has an xlink:type attribute with the value resource. Cafe au Lait ……..

24 Extended Links (cont.) Syntax –A remote resource : It exists outside the extended link element, very possibly in another document. The extended link element contains locator child elements that point to the remote resource. These are elements with any name that have an xlink:type attribute with the value “locator”. Each locator element has an xlink:href attribute whose value is a URI locating the remote resource …………….

25 Extended Links (cont.) For example, suppose you're writing a page of links to Java sites. One of the sites you want to link to is Cafe au Lait at However, there are also three mirrors of that site in three other countries. Some people coming to your site will want to access the home site while others will want to go to one of the mirror sites. Do it in HTML? You have to write four different links Cafe au Lait

26 Extended Links (cont.) Shows the WEBSITE extended link element and five resources. The WEBSITE element contains one local resource and refers to the other four remote resources by URLs. However, this just describes these resources. No connections are implied between them

27 An Extended Link with Arcs Arc –Simple link: The xlink:show and xlink:actuate attributes define how and when a link is traversed. –Extended links are a little more complicated because they provide many different possible traversal paths –For example, the Multidirectional linking between resources, –Each of the possible paths between resources can have different rules for when the link is traversed and what happens when it's traversed.

28 An Extended Link with Arcs (cont.) Arc –These potential traversals are called arcs, They're represented in XML by elements that have an xlink:type attribute with the value “arc” Traversal rules are specified by attaching xlink:actuate and xlink:show attributes to arc elements. These attributes have the same values and meanings as they do for simple links. Applications can use arc elements to determine which traversals are and are not allowed and when a link is traversed.

29 An Extended Link with Arcs (cont.) An arc element also has –The xlink:from attribute says which resource or resources the arc comes from. –The xlink:to attribute says which resource or resources the arc goes to. –They do this by matching the value of the xlink:label attributes on the various resources in the extended link. –For instance, if the xlink:from attribute has the value “A”, and the xlink:to attribute has the value “B”, then the arc goes from the resource whose xlink:label has the value “A” to the resource whose xlink:label has the value “B”

30 <WEBSITE xmlns:xlink=" xlink:type="extended" xlink:title="Cafe au Lait"> Cafe au Lait <HOMESITE xlink:type="locator“ xlink:href=" xlink:label="us"/> <MIRROR xlink:type="locator" xlink:title="Cafe au Lait Swedish Mirror" xlink:label="se“ xlink:href=" <MIRROR xlink:type="locator" xlink:title="Cafe au Lait German Mirror" xlink:label="sk“ xlink:href=" <MIRROR xlink:type="locator" xlink:title="Cafe au Lait Swiss Mirror“ xlink:label="ch" xlink:href=" <CONNECTION xlink:type="arc" xlink:from="source" xlink:to="ch" xlink:show="replace" xlink:actuate="onRequest"/> <CONNECTION xlink:type="arc" xlink:from="source" xlink:to="us" xlink:show="replace" xlink:actuate="onRequest"/> <CONNECTION xlink:type="arc" xlink:from="source" xlink:to="se" xlink:show="replace" xlink:actuate="onRequest"/> <CONNECTION xlink:type="arc" xlink:from="source" xlink:to="sk" xlink:show="replace" xlink:actuate="onRequest"/> An Extended Link with Arcs (cont.)

31 An Extended Link with Arcs (cont.) An extended link with one local and four remote resources and arcs going from the local resource to each of the remote resources In this case, each arc element defines exactly one connection because the target and source labels aren't shared by multiple resources

32 Xlip – from Fujitsu Corp. 1.An application requests the XML processor and the XLink processor that generates DOM to perform processing, and it accesses the generated information space. 2.The information space is referred to as an XLink data model. 3.An XLink data model consists of an XLink data set and at least one related DOM. 4.An XLink data set contains the results of analyzing XLink descriptions in XML documents.

33 Fig XLink tree browser rendering of booklinks.xml ©Fujitsu Laboratories Ltd.

34 Fig Traversing an outbound link. ©Fujitsu Laboratories Ltd.

35 Fig Traversing an outbound link. ©Fujitsu Laboratories Ltd.

36 Fig Ending resource shown in a new window. ©Fujitsu Laboratories Ltd.

37 XML Pointer Language (XPointer) Defines an addressing scheme for individual parts of an XML document These addresses can be used by any application that needs to identify parts of or locations in an XML document. –For instance, an XML editor could use an XPointer to identify the current position of the insertion point or the range of the selection References fragments of XML document via URI –Link to specific part of resource, i nstead of linking to entire resource –Link to specific locations (i.e., XPath tree nodes) –Link to ranges of locations Uses XPath to reference XML document nodes Also used for searching XML documents via string matching

38 XPointer Example Traditional way to reference part of document XPointer Examples –You can then link to this position in the file by adding a # and the name of the anchor to the URL. –The piece of the URL after the # is called the fragment identifier. –For example, in this link the fragment identifier is xtocid20.2 XPointer Examples Problems: –This solution is kludge. It's not always possible to modify the target document –Named anchors violate the principle of separating markup from content

39 XPointer Example (cont.) XPointers allow much more sophisticated connections between parts of documents. An XPointer can refer to any element of a document –To the first, second, or seventeenth element, and so on XPointers provide very precisely targeted addresses of particular parts of documents. They do not require the targeted document to contain additional markup just so its individual pieces can be linked to. Furthermore, unlike HTML anchors, XPointers don't point to just a single point in a document. –They can point to entire elements, to possibly discontinuous sets of elements, or to the range of text between two points. 1.Thus, you can use an XPointer to select a particular part of a document, 2.Perhaps so it can be copied or loaded into a program.

40 XPointer Example (cont.) Here are a few examples of XPointers: Each of these seven XPointers selects a particular element in a document 1. xpointer(id("ebnf")) 2. xpointer(descendant::language[position()=2]) 3. element(/1/14/2) 4. xpointer(id("ebnf"))xpointer(id("EBNF")) Finds the element with the ID “ebnf” Finds the second “language” element in the document Finds the second child element of the fourteenth child element of the root element Points to the element with the ID “ebnf”. However, if no such element is present, it then finds the element with the ID “EBNF” <SPECIFICATION xmlns:xlink=" xlink:type="simple" xlink:href=" xlink:actuate="onRequest" xlink:show="replace"> Extensible Markup Language (XML) 1.0

Outline 41 Fig Example contact list. Lines Deitel, Harvey 7 Deitel, Paul 8 Nieto, Tem 9 Mark up contact list that contains ids for three authors

42 XML Pointer Language (cont.) Figure –Assume contact list has relative URI /contacts.xml XLink references entire contact list with URI xlink:href = "/contacts.xml" XPointer references specific part: –Element contact with id of author02 xlink:href = "/contacts/xml#xpointer( = ‘author02]’)"

43 That’s it for today (5/20)!

44 XLink Attribute Reference AttributeValueDescription xlink:actuateonLoad onRequest other none Defines when the linked resource is read and shown xlink:hrefURLThe URL to link to xlink:showembed new replace other none Where to open the link. Replace is default xlink:typesimple extended locator arc resource title none The type of link