Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Tip: Using XML and XPointer

Linking to a specific part of a document

Return to article.


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>
  

Return to article.