== XPointers and XLink === XLink === See [http://www.w3.org/TR/xlink/ XML Linking Language (XLink) Version 1.0]. XLink could be used in all elements. Example: *

The best german punk band is

Slime
.

=== XPointer === See [http://www.w3.org/TR/xptr-framework/ XML Pointer Language (XPointer)]. XPointer could be used in all URI's especially those provided by XLink. Examples: *

This is discussed in

the first paragraph of the example document
.

*

This is discussed in

the first division of the example document
.

*

This is discussed in

the second element of the first element
.

*

Einstein said in his diary that he doesn't like a further delay of his shipping tour to south america (see page 53, sentence 2).

==== XPoints ==== [[Image(xpoint.png)]] * Examples * point(1.0) is just inside the beginning of the p element. * point(1.2) is between the end of the em element and the following text node (which contains "world."). * point(.0) immediately precedes the root node. * point(1/2/1.1) immediately following the "b" in the middle text node. ==== Range ==== * xpointer(id("chap1")/range-to(id("chap2"))) (the range from the start point of the element with ID "chap1" to the end point of the element with ID "chap2") * string-range(//title,"Thomas Pynchon")[17] (the 17th of those "Thomas Pynchon" strings appearing in a title element) *

See the text passage on page 53, sentence 2, character 3 to 10).

=== Support of XLink === XLink will be supported in all elements of the Echo and TEI Lite schema (in the near future). === Support of XPointer === The MPDL project sets a special focus on the presentation of document pages. An important requirement for MPDL-XPointers is the support of pointers relative to document pages. Another special requirement is to point not only to elements on a page but also to text portions in elements (point or range). XPointer could be used in all URI's especially those provided by XLink. The MPDL project supports the following subset of XPointer (in the near future): * XPointer to a page in an XML document. Example: *

... (see Dick Porter: Ramones ā€“ The Complete Twisted History, London: Plexus, 2004. Page 6. ISBN 0859653269) * if the document contains no pages (no elements) then the page number doesnt't have to be specified (all elements are on the first page internally) * XPointer to an element on a page in an XML document. Example: *

Joey Ramone said: "When we started up in March of ā€™74, it was because the bands we loved, the rock ā€™nā€™ roll that we knew, had disappeared. We were playing music for ourselves." (see page 6, sentence 2).

* XPointer to a text portion of an element on a page in an XML document. Example: *

The Ramones started up in March 1974 (see page 6, sentence 1, character 22 to 32).

External user annotations of documents are stored relative to document pages by mapping XPointer page points/ranges to an internal identifier as a combination of document identifier, page number, element xpath expression, and a point/range expression. Example: * before the first sentence on page 6: /music/ramones/ramones_2004.xml, page6, /tei[1]/text[1]/body[1]/chap[1]/p[1]/s[1], point(.0) * after the first sentence on page 6: /music/ramones/ramones_2004.xml, page6, /tei[1]/text[1]/body[1]/chap[1]/p[1]/s[1], point(.1) * from character 22 to 34 in the first sentence of page 6: /music/ramones/ramones_2004.xml, page6, /tei[1]/text[1]/body[1]/chap[1]/p[1]/s[1], range(1.22, 1.34) ==== Discussion ==== * document identifier: a persistent identifier of a document * http://mpdl.mpiwg-berlin.mpg.de/music/ramones/ramones_2004.xml * Advantages * intuitive * easy to retrieve * compatible to XLink * REST like * Disadvantages * could be used once more (no id any more) * http://mpdl.mpiwg-berlin.mpg.de/permanent/library/471122KK * Advantages * persistent id (could be used exactly one time) * already used in Echo-System and library * Disadvantages * counterintuitive * not easy to retrieve * page number * http://mpdl.mpiwg-berlin.mpg.de/music/ramones/ramones_2004.xml#xpointer((id('page6')) * Advantages * compatible to XLink/XPointer * could be interpreted also without in the document (through getFragment implementation) * REST like * Disadvantages * if in XML document elements are inserted or deleted afterwards many old XPointer links are broken * http://mpdl.mpiwg-berlin.mpg.de/music/ramones/ramones_2004.xml?page=6 * Advantages * well-nigh compatible to XLink/XPointer * could be interpreted also without in the document (through getFragment implementation) * REST like * Disadvantages * if in XML document elements are inserted or deleted afterwards many old XPointer links are broken * two parameters necessary (page, xpointer) * element identifier * xpath expression: /tei[1]/text[1]/body[1]/chap[3]/p[1]/s[2] * Advantages * could be generated dynamically for the XML page * intuitive * full compatible to XLink/XPointer * easy to retrieve * implementation is easy and consistent (through saxon:path) * Disadvantages * if in XML document elements are inserted, updated or deleted afterwards many old XPointer links are broken * relative long string * node id: 1.1.1.3.1.2 * Advantages * could be generated dynamically for the XML page * intuitive * compatible to XLink/XPointer * easy to retrieve * Disadvantages * if in XML document elements are inserted, updated or deleted afterwards many old XPointer links are broken * id attribute in XML document: ... * Advantages * if in XML document elements are inserted, updated or deleted afterwards only old XPointer links with deleted elements are broken * compatible to XLink/XPointer * Disadvantages * through upload process the document has to be modified: for each element in XML document an id attribute has to be generated, also implementation is more complex * if a user uses an id attribute already in his document but not consistent these id attributes have to be replaced by a new consistent id (not easy to implement) * the document size is bigger with all these id attribute values * the id is not intuitive * special id attribute in XML document: ... * Advantages * user could use his own id attribute in document as he like * if in XML document elements are inserted, updated or deleted afterwards only old XPointer links with deleted elements are broken * compatible to XLink/XPointer * Disadvantages * through upload process the document has to be modified: for each element in XML document an xmlNodeId attribute has to be generated, also implementation is more complex * the document size is bigger with all these id attribute values * the id is not intuitive * point/range expression * point(.0) or range(1.22, 1.34) * Advantages * pointers could point to a text portion, is partly already implemented * Disadvantages ==== Selection / Solution ==== * document identifier * http://mpdl.mpiwg-berlin.mpg.de/music/ramones/ramones_2004.xml * Reasons * could be mapped to the persistent identifier, intuitive, user friendly, REST like, compatible with XPointer * page number * http://mpdl.mpiwg-berlin.mpg.de/music/ramones/ramones_2004.xml#xpointer((id('page6')) * Reasons * compatible with XPointer * element identifier (choice between these 2 best possible solution) * xpath expression: /tei[1]/text[1]/body[1]/chap[3]/p[1]/s[2] * Reasons * no modification of the original document is done, intuitive, compatible with XPointer, dynamically generation, implementation is already mostly done * an automatic repair mechanism for broken links to inside elements after document updates: no one would expect such a difficult solution for that and is also not needed normally * the broken link is sent to the older version of the document if a versioning system is running or an error message is given that the document has changed * point/range expression * point(.0) or range(1.22, 1.34) * Reasons * compatible with XPointer, only this alternative