Download presentation
Presentation is loading. Please wait.
Published byIra Wood Modified over 9 years ago
1
SNU OOPSLA Lab. Hypertext links(XLL) © copyright 2001 SNU OOPSLA Lab.
2
SNU OOPSLA Lab. Contents Concepts XML syntax basic links XML linking specification URLs Link behavior Extended pointers Attribute name conflicts Link value strategies
3
SNU OOPSLA Lab. Basic Link Source –a phrase that directs the reader’s attention to other information Target –is located at the start of the required text
4
SNU OOPSLA Lab. Terminology Resource –target object Linking element –source Traversal –the act of moving from the liking element to the resource
5
SNU OOPSLA Lab. Terminology(Cont’d) Simple link –the primitive one-directional linking scheme, but make it possible to traverse links between documents
6
SNU OOPSLA Lab. URLs Objects are identified using the URL mechanism See Details … Details The details are …...
7
SNU OOPSLA Lab. Attributes in the Linking Element 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’)
8
SNU OOPSLA Lab. Extended Link Extended link –resources can be cross-related –an extended link contains a number of locator elements, each one points to a resource
9
SNU OOPSLA Lab. Out-of-line Link Out-of-line link –provides facility of separating the extended link from all the resources it defines –may physically appear in-line, in the sense that it is placed in the flow of text –a more obvious place to put out-of-line links is at the top of the document
10
SNU OOPSLA Lab. Extended Link Group Extended link group –a number of extended document pointers are used to identify all the inter-linked documents –they are contained in an extended group element => all the documents concerned are deemed to be pointers to each other
11
SNU OOPSLA Lab. XML syntax basic links This is Section 6 … Please refer to Section 6 for more details
12
SNU OOPSLA Lab. Identifying links Assumes –advanced linking features described here are not inherent in the XML syntax –so are not based on reserved attribute types –an XML parser is therefore unable to validate the links –there is another layer of software, an ‘XML link processor’ interrogates the parsed document instance, and possibly also the DTD to detect and activate linking feature
13
SNU OOPSLA Lab. Identifying links(Cont’d) If no DTD, the reserved attributes may be stored in the document the link When a DTD is used, this information is stored in the attribute declaration <!ATTLIST link xml-link CDATA #FIXED “simple” href CDATA #REQUIRED> the link
14
SNU OOPSLA Lab. Simple Links Simple link –contains only one resource locator –only the Href and xml-link attributes are required –any name can be chosen for the linking element See book 9 for details See Section 9 of the Procedures Manual
15
SNU OOPSLA Lab. Title and Role Title –it is useful for simple links to be labeled, so that the user can decide whether it would be profitable to follow the link <!ATTLIST link … title CDATA #IMPLIED> … are you going to Scarborough fair? Role –is used to create categories of link that can be accessed by specialized browsers <!ATTLIST link … role CDATA #IMPLIED> … are you going to Scarborough fair?
16
SNU OOPSLA Lab. Extended Links Extended links –refer to a number of resources by including embedded resource locators –each locator is stored in a locator element –all related locator elements are grouped within an extended element –the DTD author must ensure that the extended element can contain the locator element, as well as any DTD specific elements appropriate at this point
17
SNU OOPSLA Lab. Extended Links(Cont’d) Here are some extended links: Locator 1, Locator 2 Here are some extended links: Locator1, Locator2.
18
SNU OOPSLA Lab. Content Role and Content Title Content role and content title –locators in extended links are labeled with the title attribute –extended link itself, if it is an in-line link, should also have a title and role
19
SNU OOPSLA Lab. Content Role and Content Title(Cont’d) <!ATTLIST extend … content-role CDATA #IMPLIED content-title CDATA #IMPLIED> Are you going to Scarborough fair? …
20
SNU OOPSLA Lab. Out-of-link Links In-line links –a link that serves as one of its own resources –a link source that is embedded within the text Out-of-line links –a link that does not serve as one of its own resources –should be considered when a read-only document is involved different links are required for different groups of people, where seeing other’s links is confusing
21
SNU OOPSLA Lab. Out-of-link Links(Cont’d) The Inline attribute must be set to ‘false’ to identify an out-of-line link Locator 1 Locator 2
22
SNU OOPSLA Lab. Extended Link Groups Group element –other documents in a group of inter-linked documents can be identified with steps attribute contains a value stating how many steps to take –which contains document element with href attribute Document Hub
23
SNU OOPSLA Lab. URLs The method for locating entire documents See details Linking a specific element in the current file See details, part 3 –entire document is delivered Indicating that only referenced part of the document is required See details, part 3
24
SNU OOPSLA Lab. Link Behavior Actuate –user: the links only traversed when explicitly selected by the user –auto: the link is activated automatically as soon as the linking element is presented to the user Show –replace: the browser replaces the source text with the resource required –embed: the resource is brought to and embedded in the source text –new: the browser opens a new window to display the resource, leaving the original window on-screen
25
SNU OOPSLA Lab. Link Behavior(Cont’d) The show and actuate attributes also appearing in the extended links
26
SNU OOPSLA Lab. Extended Pointers XPointer – a mechanism for identifying a designated resource by its location Instructions(location terms) in an XPointer –refer to the element hierarchy tree –include references to siblings, children and ancestors –are read from left to right
27
SNU OOPSLA Lab. Extended Pointers(Cont’d) Examples http://MyServe.MyCorp.com/ xml/doc9#ROOT()CHILD(3,chap)STRING(7,”Napoleon”,0) http:// MyServe.MyCorp.com/ xml/doc9? XML-XPTR=ROOT()CHILD(3,chap)STRING(7,”Napoleon”,0)
28
SNU OOPSLA Lab. Absolute Locations HERE() –identifies the current element(the linking element itself) ID() –specifies an element containing an attribute of type ID ID(sec17) … ’ HTML() –specifies the name of an Anchor element in an HTML document HTML(para3) The third paragraph. …
29
SNU OOPSLA Lab. Absolute Locations(Cont’d) ROOT() –identifies the entire document as the container of the target resource DITTO() –specifies the result of the first search as the starting-point for this second search
30
SNU OOPSLA Lab. Relative Locations CHILD() –specifies a child of the current element CHILD(3,.) … <1 … <2 … <3 CHILD(3, *) 13 <1 High Str., <2 NewTown <3
31
SNU OOPSLA Lab. Relative Locations(Cont’d) CHILD(1, *CDATA) 13 High Str.,<1 NewTown CHILD(3, para) … <1 … … <2 … … <3
32
SNU OOPSLA Lab. Relative Locations(Cont’d) CHILD(3, para, status, secret) … <1 … <2 … … <3 CHILD(2, para, author, “D. Adams”) … … <1 … … <2
33
SNU OOPSLA Lab. Relative Locations(Cont’d) CHILD(3, para, status, *IMPLIED) … … <1 … <2 … … <3 CHILD(3, PARA, STATUS, *) … <1 … … <2 … <3 …
34
SNU OOPSLA Lab. Relative Locations(Cont’d) ANCESTOR() –specifies a search through enclosing elements FSIBLING() –identifies a following sibling –to select next element: … … <1 –to select the penultimate element: … … < -2 … < -1
35
SNU OOPSLA Lab. Relative Locations(Cont’d) PSIBLING() –identifies a previous sibling to the current element –to select the previous element … <1 … –to select the second element in the enclosing element … < -1 … < -2 …
36
SNU OOPSLA Lab. Relative Locations(Cont’d) DESCENDANT() –indicates an element anywhere within the location source FOLLOWING() –has a similar effect as DESCENDANT, except that it not bounded by the current element’s end-tag, but searches on to the end of the document PRECEDING() –initiates a search back through the document, ignoring document hierarchies
37
SNU OOPSLA Lab. Relative Locations(Cont’d) STRING() –locates a given letter, word, phrase or other string of text, such as ‘Napoleon the Emperor’ –the first parameter is an occurrence counter –the second parameter is the string to find STRING(1, ‘Napoleon the Emperor’, 0) Using the N element for name and Occ for occupation, “Napoleon the Emperor” is coded… <1
38
SNU OOPSLA Lab. Relative Locations(Cont’d) STRING() –tags are transparent to the search: STRING(1, ‘Napoleon the Emperor’, 0) Using the N element for name and Occ for occupation, “Napoleon the Emperor” is coded… <1 Napoleon the Emperor <2 –the third parameter is a value specifying an offset from the start of the search text STRING(1, ‘Napoleon the Emperor’, 7) Using the N element for name and Occ for occupation, “Napoleon the Emperor” is coded… <1 Napoleon the Emperor <2
39
SNU OOPSLA Lab. Attribute Name Conflicts xml-attribute attribute can be used to rename the others <!ATTLIST link xml-attributes CDATA“show xshow” xshow (embed|replace|new) “replace”> <!ATTLIST link xml-attributes CDATA“show xshow title xtitle” xshow (embed|replace|new) “replace” xtitle CDATA#IMPLIED> <!ATTLIST link xml-attributes “href target” target CDATA #REQUIRED> …
40
SNU OOPSLA Lab. Link Value Strategies Document authors are usually required to generate identifiers for new objects –simply assign the next available sequential value –assigning the title, or an abbreviation of the title, to a locator: –an abbreviated reference scheme may be considered see Chapter 7, Paragraph 12
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.