1 / 15

XLink

XLink. The Wonderful World of Oz example and its DTD are from the excellent book “XML in a Nutshell” by Elliotte Rusty Harold (course text). XLink. XLink is a syntax that allows us to represent directed graphs. The vertices of the graph are documents (or other resources)

mikko
Download Presentation

XLink

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XLink The Wonderful World of Oz example and its DTD are from the excellent book “XML in a Nutshell” by Elliotte Rusty Harold (course text) Internet Technologies

  2. XLink XLink is a syntax that allows us to represent directed graphs. The vertices of the graph are documents (or other resources) and the edges are links between them. The vertices can be local or remote. Different applications may interpret the XLinks in a document differently. The programmer determines the meaning of the connection. For example, a web spider will probably treat the link much differently than a web browser or a publishing program. Internet Technologies

  3. XLink • Simple Links • Define a one-way connection between two resources • One resource is an xml element and the other is remote • This is the only link that looks like the html anchor element • Extended Links • Define a collection of resources and links between them • These may be used to define a directed, labeled graph Internet Technologies

  4. Simple Links <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <novel xmlns:xlink= "http://www.w3.org/1999/xlink" xlink:type = "simple" xlink:href = "ftp://archive.org/pub/etext/my.txt"> <title>The Wonderful Wizard of Oz</title> <author>L. Frank Baum </author> <year>1900</year> </novel> Map some prefix to the xlink URI The xlink prefix is customary but not required. Internet Technologies

  5. Simple Links <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <novel xmlns:xlink= "http://www.w3.org/1999/xlink" xlink:type = "simple" xlink:href = "ftp://archive.org/pub/etext/my.txt"> <title>The Wonderful Wizard of Oz</title> <author>L. Frank Baum </author> <year>1900</year> </novel> The type attribute is required. It has six possible values. The simple type is like HTML’s anchor element. Internet Technologies

  6. Simple Links <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <novel xmlns:xlink= "http://www.w3.org/1999/xlink" xlink:type = "simple" xlink:href = "ftp://archive.org/pub/etext/my.txt"> <title>The Wonderful Wizard of Oz</title> <author>L. Frank Baum </author> <year>1900</year> </novel> The href attribute may be relative or absolute and points to the target resource. Internet Technologies

  7. Simple Links <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <novel xmlns:xlink= "http://www.w3.org/1999/xlink" xlink:type = "simple" xlink:href = "ftp://archive.org/pub/etext/my.txt" xlink:actuate=“onRequest” xlink:show=“replace”> <title>The Wonderful Wizard of Oz</title> <author>L. Frank Baum </author> <year>1900</year> </novel> Many options exist. These are suggestions to the application. Internet Technologies

  8. Simple Xlinks and DTD’s <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE novel SYSTEM "novel.dtd"> <novel xlink:href = "ftp://archive.org/pub/etext/my.txt"> <title>The Wonderful Wizard of Oz</title> <author>L. Frank Baum </author> <year>1900</year> </novel> Some of the syntax can be placed in a DTD. We must define the attributes, the namespace and the type of link. Internet Technologies

  9. Simple Xlinks (DTD) <?xml version="1.0" encoding="UTF-8"?> <!ELEMENT novel (title, author, year) > <!ATTLIST novel xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink" xlink:type (simple) #FIXED 'simple' xlink:href CDATA #REQUIRED> <!ELEMENT title (#PCDATA) > <!ELEMENT author (#PCDATA) > <!ELEMENT year (#PCDATA) > Internet Technologies

  10. Extended Links • Not like the HTML links of old. • More general. • Application dependent. Internet Technologies

  11. Extended Links • Extended links will normally contain the following: • Local resources involved in the connections. • These have type=“resource” • Remote resources involved in the connections. • These have type=“locator” • Descriptions of the connections. • These have type=“arc” Internet Technologies

  12. Extended Links • Extended links will normally contain the following: • Local resources involved in the connections. • These have type=“resource”. • Give a name to a local element. • Remote resources involved in the connections. • These have type=“locator”. • Give a name to a remote place. • Descriptions of the connections. • These have type=“arc”. • State that a directed edge exists between two of the above. Internet Technologies

  13. Extended Links <program xlink:type=“extended”> </program> <course xlink:type=“resource” xlink:label = “LA100”> Linear Algebra <course> <course xlink:type=“resource” xlink:label = “LA200”> Linear Algebra II <course> <prerequisite xlink:type=“arc” xlink:from=“LA100” xlink:to=“LA200” /> Linking resources that are part of the document. Internet Technologies

  14. Extended Links <program xlink:type=“extended”> </program> <course xlink:type=“locator” xlink:label = “LA100” xlink:href=“http://someplace.else”> Linear Algebra <course> <course xlink:type=“locator” xlink:label = “LA200” xlink:href=“http://anotherplace”> Linear Algebra II <course> <prerequisite xlink:type=“arc” xlink:from=“LA100” xlink:to=“LA200” /> Linking remote resources. Internet Technologies

  15. Third Party Links We can now define links between documents that we don’t control. Using Xlink, we can describe vertices and edges across the internet. If the vertices are XML documents, we can use XPointer (which builds on XPath) to establish links from particular places in remote documents to particular places in other documents, neither of which we control. Makes you think! Internet Technologies

More Related