Documente Academic
Documente Profesional
Documente Cultură
2010.1 1 2010.1 2
2010.1 3 2010.1 4
1
Simple Links XLink Attributes
Attributes:
Simple link
– type: specifies the type of linking. The value must be
– Links one resource to another (similarly to HTML link)
one of "simple", "extended", "locator", "arc",
– Linking elements "resource", "title", or "none".
• Specify linking information
<book xlink:type = "simple"
– href: defines the remote resource’s URI
xlink:href = "/textbooks/xmlHowToProgram.xml"> – role: references a resource that describes the link (a
XML Book </book> machine readable description of the link)
• Linking element (book) is local resource
– title: a descriptive title for the link (human readable)
• xmlHowToProgram.xml is remote resource
– show: specifies how to display a resource when it is
loaded
– actuate: specifies when the resource should be
d oc ume nt 1 do c ument 2 retrieved
2010.1 5 2010.1 6
2010.1 7 2010.1 8
2
Extended Links Unidirectional vs Multidirectional links
Extended links
– Link multiple combinations of local and remote
resources
– Can create multidirectional links for traversing d oc ument 1 do c ument 2
between resources.
– Not limited to just two resources, can link any number
of resources.
• Unidirectional links may not offer return to local resource
• Multidirectional links
– Traverse between resources d oc ument 1 do c ument 2
2010.1 9 2010.1 10
2010.1 11 2010.1 12
3
1 <?xml version = "1.0"?>
2
3 <!-- Fig. 14.8 : booklinks.xml -->
4 <!-- XML document containing extended links -->
5
6 <books xmlns:xlink = "http://www.w3.org/1999/xlink"
7 xlink:type = "extended"
– Arc 8
9
xlink:title = "Book Inventory">
• Markup that specifies how to traverse between resources, 10 <author xlink:label = "authorDeitel" Mark up link to book’s authors
11 xlink:type = "locator"
including the direction of traversal. 12 xlink:href = "#authors"
13 xlink:role = "http://deitel.com/xlink/author"
14 xlink:title = "Deitel & Associates, Inc.">
15 <persons id = "authors">
16 <person>Deitel, Harvey</person>
17 <person>Deitel, Paul</person>
18 </persons>
19 </author>
20
21 <publisher xlink:label = "publisherPrenticeHall" Mark up link to publisher
22 xlink:type = "locator"
23 xlink:href = "/publisher/prenticehall.xml"
24 xlink:role = "http://deitel.com/xlink/publisher"
25 xlink:title = "Prentice Hall"/>
26
27 <warehouse xlink:label = "warehouseXYZ" Mark up link to warehouse
28 xlink:type = "locator"
29 xlink:href = "/warehouse/xyz.xml"
30 xlink:role = "http://deitel.com/xlink/warehouse"
31 xlink:title = "X.Y.Z. Books"/>
2010.1 13 2010.1 14
4
1 <?xml version = "1.0"?>
2 <!-- Fig. 14.14 : contacts.xml -->
XML Pointer Language (XPointer) 3 <!-- contact list document -->
4
5 <contacts>
6 <contact id = "author01">Deitel, Harvey</contact>
Mark up contact list that
XPointer 7 <contact id = "author02">Deitel, Paul</contact>
contains ids for three authors
8 <contact id = "author03">Nieto, Tem</contact>
– References fragments of XML document via URI 9 </contacts>
2010.1 17 2010.1 18
2010.1 19 2010.1 20
5
XML Base (XBase) More Information
2010.1 21 2010.1 22
Reference:
Deitel, H., P.Deitel, T. Nieto, T.Lin and P. Sadlu.
(2001). XML: How to Program 1e. Upper Saddle
River: Pearson Education
W3C – www.w3.org
2010.1 23