Beruflich Dokumente
Kultur Dokumente
2 Examples
Basics
In all XML document types including XHTML fragments corresponding to an xml:id or similar id attributes follow the Name-syntax and begin with a
letter, underscore, or colon. Notably they cannot begin with a digit or hyphen.[3]
xml:id is one of the few generic XML attributes, e.g., xml:lang, which can be used
without explicitly declaring a namespace.[4]
In XHTML id has to be used, because
XHTML was specied before xml:id existed.
In XML applications, fragment identiers in a certain syntax can be XPointers; for example, the fragment identier in the URI http://www.example.org/
foo.xml#xpointer(//Rube) refers to all XML elements named Rube in the document identied
by the URI http://www.example.org/foo.xml. An
XPointer processor, given that URI, would obtain a
representation of the document (such as by requesting it from the Internet) and would return a representation of the documents Rube elements.
3
skos/core#broader identies the concept broader
in SKOS Core vocabulary, but it does not refer to
a specic part of the resource identied by http:
//www.w3.org/2004/02/skos/core, a complete RDF
le in which semantics of this specic concept is declared, along with other concepts in the same vocabulary.
In URIs for MIME text/plain documents RFC 5147
species a fragment identier for the character and
line positions and ranges within the document using the keywords char and line. Some popular
browsers do not yet support RFC 5147.[5] The following example identies lines 11 through 20 of a
text document:
http://example.com/document.txt#line=10,
20
In URIs for MIME audio/*, image/*, video/* documents, very few have dened fragments or fragment
semantics.[6] The Media Fragments URI 1.0 (basic)
syntax supports addressing a media resource along
two dimensions (temporal and spatial) using the keywords t and xywh. Therefore, one can use the following media fragments URI in the src attribute of
the audio or video HTML5 element:
http://example.com/foo.mp4#t=10,20
http://example.com/bar.webm#t=40,80&
xywh=160,120,320,240
Other websites use the fragment part to
pass some extra information to scripts running on them for example, Google Video
understands permalinks in the format of
#01h25m30s to start playing at the specied
position,[7] and YouTube uses similar code
such as #t=3m25s.[8]
In JavaScript, the fragment identier of the current
HTML or XHTML page can be accessed in the
hash property location.hash note that Javascript
can be also used with other document types. With
the rise of AJAX, some websites use fragment
identiers to emulate the back button behavior of
browsers for page changes that do not require a
reload, or to emulate subpages.
For example, Gmail uses a single URL for
almost every interface mail boxes, individual mails, search results, settings the fragment is used to make these interfaces directly
linkable.[9]
Adobe Flash websites can use the fragment
part to inform the user about the state of the
website or web application, and to facilitate
deep linking, commonly with the help of the
SWFAddress JavaScript library.
PROPOSALS
3 Proposals
Several proposals have been made for fragment identiers
for use with plain text documents (which cannot store
anchor metadata), or to refer to locations within HTML
documents in which the author has not used anchor tags:
As of September 2012 the Media Fragments URI
1.0 (basic) is a W3C Recommendation.[13]
The Python Package Index appends the MD5 hash
of a le to the URL as a fragment identier.[14] If
MD5 were unbroken (it is a broken hash function), it
could be used to ensure the integrity of the package.
https://pypi.python.org ...
zodbbrowser0.3.1.tar.gz#md5=38dc89f294b24691d3f0d893ed3c119c
A hash-bang [15] fragment is a fragment starting
with an exclamation mark !. An exclamation mark
is illegal in HTML, XHTML, and XML identiers,
ensuring separation from that functionality.
Google Webmaster Central has proposed[16]
and stated a standard[17] using an initial exclamation mark in fragment identiers for stateful
AJAX pages:
http://example.com/page?query#!state
Hash-bang URIs have been considered problematic by a number of writers including Jeni
Tennison at the W3C because they make
pages inaccessible to those who do not have
JavaScript activated in their browser. They
also break HTTP referer headers as browsers
are not allowed to send the fragment identier
in the Referer header.[15]
Mozilla Foundation employee Gervase
Markham has proposed a fragment identier
for searching, of the form #!s!search terms.
The exclamation point is illegal in anchor
3
tags, ensuring separation from that functionality. Adding a number after the s (#!s10!)
indicates that the browser should search for
the nth occurrence of the search term. A
negative number (#!s-3!) starts searching
backwards from the end of the document. A
Greasemonkey script is available to add this
functionality to compatible browsers.[18]
http://example.com/index.html#!s3!
search terms
Erik Wilde and Marcel Baschnagel of the ETH
Zurich extend this to also identify fragments in plain
text documents using regular expressions, with the
keyword match.[19] They also describe a prototype implementation as an extension for the Firefox
browser. For example, the following would nd the
case-insensitive text RFC anywhere in the document:
http://example.com/document.txt#match=
{[}rR{]}{[}fF{]}{[}cC]
K. Yee of the Foresight Institute proposes extended
fragment identiers delimited with colons and a
keyword to dierentiate them from anchor identiers. A text search fragment identier with fragment specication scheme id words is the rst
proposal in this scheme.[20] The following example
would search a document for the rst occurrence of
the string some context for a search term and then
highlight the words search term":
http://example.com/index.html#:words:
some-context-for-a-(search-term)
The LiveURLs project proposed a fragment identier format for referring to a region of text within a
page, of the form #FWS+C, where F is the length
of the rst word (up to ve characters), W is the rst
word itself, S is the length of the selected text and C
is a 32-bit CRC of the selected text.[21] They implemented a variant of this scheme as an extension for
the Firefox browser,[22] using the form #LFWS+C,
where L is the length of the fragment itself, in two
hex digits. Linking to the word Fragment using
the implemented variant would yield:
http://example.com/index.html#115Fragm8+
$-$52f89c4c
Up until Firefox 5, Firefox supported XPath
links such as #xpath:/html/body/div{[}3] which
could be used in conjunction with a bookmarklet such as http://antimatter15.com/wp/2009/
11/xpath-bookmark-bookmarklet/ to link within
HTML documents that lacked proper IDs. This feature was removed as part of a code cleanup in https:
//bugzilla.mozilla.org/show_bug.cgi?id=457102
4 See also
URL normalization
Uniform Resource Locator
5 References
[1] RFC 3986 Uniform Resource Identier (URI): Generic
Syntax. Internet Engineering Task Force. January 2005.
Retrieved March 6, 2012.
[2] Representation types and fragment identier semantics.
Architecture of the World Wide Web, Volume One. W3C.
2004. Retrieved July 13, 2011.
[3] Validity constraint: ID. XML 1.0 (Fifth Edition). W3C.
2008. Retrieved July 13, 2011.
[4] xml:id Version 1.0. W3C. 2005. Retrieved July 13,
2011.
[5] Issue 77024. Chromium. 2011. Retrieved July 13,
2011.
[6] Media Type Review. W3C Media Fragments Working
Group. 2009. Retrieved April 29, 2009.
[7] New Feature: Link within a Video. Google. July 19,
2006. Retrieved July 13, 2011.
[8] Link To The Best Parts In Your Videos. YouTube. October 30, 2008. Retrieved July 13, 2011.
[9] Link to Specic Content in Gmail, Google Blogoscoped,
November 17, 2007
[10] PDF Open Parameters - Specifying PDF Open Parameters in a URL (PDF). Adobe. July 11, 2005. Retrieved
July 13, 2011.
[11] RFC 3778 - The application/pdf Media Type. The Internet Society. May 2004. Retrieved Aug 26, 2013.
[12] http://www.w3.org/TR/SVG11/linking.html#
SVGFragmentIdentifiers
[13] Media Fragments URI 1.0 (basic) W3C Recommendation. Retrieved September 25, 2012.
[14] Pypi md5 check support. Retrieved July 13, 2011. Pypi
has the habit to append an md5 fragment to its egg urls,
we'll use it to check the already present distribution les
in the cache
[15] Hash URIs. W3C Blog. May 12, 2011. Retrieved July
13, 2011.
[16] Proposal for making AJAX crawlable. Google. October 7, 2009. Retrieved July 13, 2011.
[17] "(Specications) Making AJAX Applications Crawlable.
Google. Retrieved March 4, 2013.
[18] Fragment Search, gerv.net
External links
W3C Media Fragments Working Group, establishing a URI syntax and semantics to address media
fragments in audiovisual material (such as a region
in an image or a sub-clip of a video)
MediaMixer Community Portal collects presentations, tutorials, use cases and demonstrators related
to use of Media Fragment technology
EXTERNAL LINKS
7.1
Text
Fragment identier Source: https://en.wikipedia.org/wiki/Fragment_identifier?oldid=672497946 Contributors: Mjb, Ehn, Universimmedia, Zantolak, Iwilcox, Xezbeth, Nickj, Tgr, Interiot, RHaworth, LOL, 790, Kbdank71, Kafue, Ysangkok, Zwobot, Echartre, Tom
Morris, Bluebot, Miquonranger03, JonHarder, Dreftymac, Chrisahn, Cydebot, JustSomeGuy, Teratornis, JamesAM, Headbomb, EagleFan,
Ryanli, MichaelHausenblas, Thegreatmichael, Niceguyedc, XLinkBot, Addbot, Bitcalc, Wonder, Aklakan, Music Sorter, Dmitry123456,
BG19bot, Chmarkine, BattyBot, Electricmun11, Rtroncy, Quenhitran and Anonymous: 30
7.2
Images
7.3
Content license