HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Let's study an example to learn some basic XPointer syntax.
In this example, we'll show you how to use XPointer and XLink to point to some other combination of specific parts of a document.
We will begin by studying the target XML document (that is, we want to link to that document).
Target XML document named "dogbreeds.xml", which lists a number of different types of dogs:
See your browser "dogbreeds.xml" file .
Note that the above XML document uses id attributes on each element we need links!
Can be linked to more than the entire document (when using XLink), XPointer allows you to link to a specific part of the document. To link to a specific part of the page, in xlink: href attribute in the URL after adding a pound sign (#) and an XPointer expression.
Expression: #xpointer (id ( "Rottweiler" )) can refer to the target document id value of "Rottweiler" elements.
Therefore, xlink: href attribute like this: xlink: href = "https://w3resource.net/(id('Rottweiler ' ))"
However, when using the id to link to an element, XPointer allows a shorthand form. You can use the direct value of the id, like this: xlink: href = "http://dog.com/dogbreeds.xml#Rottweiler" .
The following XML document can be referenced each dog breed information are referenced by the XLink and XPointer: