Fragment identifier
As a fragment identifier ( English fragment identifier ) is used in the information technology refers to a character string with which a subunit of a resource may be addressed.
Examples
Fragment identifiers are usually added to a URI (including a URL ) in order to address parts of a document. The fragment identifier is in this case with the double cross ( #
in) in the URI. It is optionally at the end of a URI.
The interpretation of the fragment identifier depends on the type of resource and the parser . Examples:
- In HTML, refers to the HTML element in document.html that contains the anchor (or ) attribute .
http://example.com/document.html#anker1
name="anker1"
id="anker1"
- In XML, it should be possible to use an XPointer that delivers all XML elements with the name "Camel" from the document.xml file as a result.
http://example.com/document.xml#xpointer(//Kamel)
- For PDF documents, see page 123 in document.pdf .
http://example.com/document.pdf#page=123
- A point in time, section or chapter can be specified for web videos and other audiovisual media. There are different pairings of keyword
=
value , where the keyword could be for exampletrack
ort
or alsoid
. The required keyword as well as the interpretation of the assigned value depends on the type of medium. So should jump to the 40th second of the video .http://example.com/video.mp4#t=40
video.mp4
The Scalable Vector Graphics (SVG) specification allows access to different elements within the same vector graphic using fragment identifiers. This makes it possible, for example, to keep different icons of a graphical user interface in a common SVG file and, if necessary, to reference only the desired icon. In this case too, the fragment identifier is separated from the name of the resource by a hash sign, but does not have to be part of a URI.
use
Traditionally, browsers do not transmit a fragment identifier with the query to the server , but request the entire document and download it. You display it in full and then jump to the desired location.
syntax
The double cross itself does not belong to the fragment identifier, only the part after it.
According to RFC 2396 Section 4.1 in conjunction with Section 2, fragment identifiers are subject to the same restrictions as URIs, i.e. they must not contain spaces , percent signs, another "#" or other characters that are not permitted in URIs.
The identifiers must be clearly assigned within a document. You have to identify unequivocally which element is meant and cannot appear repeatedly with the same identifier.
Web links
- RFC 2396 - Uniform Resource Identifier (1998; obsolete, replaced by RFC 3986 since January 2005 )
- RFC 3986 - Uniform Resource Identifier (URI) - Section 3.5. fragment
- RFC 5147 - URI Fragment Identifiers for the text / plain media type
- HTML 4.01 Specification - Links in HTML documents (English) , German translation at edition-W3C.de
- PDF Open Parameters (PDF; 154 kB) for Adobe Acrobat
- annodex.net/~silvia Examples for setting a jump label in a video.
Individual evidence
- ↑ w3.org
- ↑ How SVG Fragment Identifiers Work. November 3, 2014, accessed January 16, 2019 .