Listing 4. Using XPointer for relative links
<?xml version="1.0"?>
<guitars xmlns="http://www.newInstance.com/about/guitars"
xmlns:xlink="http://www.w3.org/1999/xlink">
<guitar luthier="Bourgeois"
xlink:type="simple"
xlink:href="http://bg.com/guitars.xml#OM">
<descripton xlink:type="simple"
xlink:href=
"http://bg.com/guitars.xml#xpointer(id('OM'))/descendant::picture[@url]"
xlink:actuate="onLoad" xlink:show="embed">
This is a real beauty in a small body. Although this is an OM, I
use it for flatpicking bluegrass as well as for producing some
beautiful fingerstyle sounds.
</description>
</guitar>
<guitar luthier="Bourgeois"
xlink:type="simple"
xlink:href="http://bg.com/guitars.xml#D">
<descripton xlink:type="simple"
xlink:href=
"http://bg.com/guitars.xml#xpointer(id('D'))/descendant::picture[@url]"
xlink:actuate="onLoad" xlink:show="embed">
Here's the holy grail in process. Dana Bourgeois is building this
Brazilian rosewood and adirondack bluegrass monster right now.
You'll know it's finished when you hear a run and your windows
shatter!
</description>
</guitar>
</guitars>
|