SunQuest
 
       XML
  Home arrow XML arrow Page 2 - XPointer Basics
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
XML

XPointer Basics
By: icarus, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 2
    2001-12-12

    Table of Contents:
  • XPointer Basics
  • The Need For XPointer
  • Revolving Around An Axis
  • Proof Of The Pudding
  • A Fragmented View
  • A Range Of Options
  • Asymmetrically Yours
  • Linking Up

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    XPointer Basics - The Need For XPointer


    (Page 2 of 8 )

    XPointer evolved as part of the work of the W3C's XML Linking Working Group, which is also responsible for XLink. While developing XLink, the Working Group realized the necessity of a language to address specific nodes - elements or character data - or sets of nodes within an XML document.

    This wasn't the only requirement, however - the XML Linking Working Group also identified the following requirements of such a language:

    1. XPointers should be based on "descriptive links" - links which identify locations by their context.

    2. XPointers should be easy to read and understand; they should also be simple to interpret for browsers and Web servers.

    3. It should be possible to create an XPointer for any specific point in a document. Similarly, it should also be possible to create an XPointer that identifies a specific range of data within an XML document.

    4. XPointers should include the capability to restrict node selections on the basis of user-imposed constraints, in much the same way as XPath uses predicates.

    5. Minor changes to an XML document - changes in whitespace, line breaks and formatting - should not "break" an XPointer.

    XPath already existed to meet some of these requirements; however, it is primarily intended for use with XSLT rather than XML links, and therefore does not address some of the more specialized items in the list above.{mospagebreak title=First Steps} Let's look at XPath quickly, and then proceed to XPointer proper.

    XPath makes it possible to locate a node, or set of nodes, at any level of an XML document tree, using a thingamajig known as a "location path."

    A location path may be either an absolute path, which expresses a location with reference to the root node, or a relative path, which expresses a location with reference to the current node (since this location is always in context to something else, it is also referred to as the "context node"). Location paths are made up of a series of "location steps", each identifying one level in the XPath tree and separated from each other by a forward slash (/).

    A location step can be further broken down into three components: there's an "axis", which defines the relationship to use when selecting nodes; a "node test", which specifies the types of nodes to select; and optional "predicates" to filter out unwanted nodes from the resulting collection (I'll explain each of these in detail further down so that they become a little less frightening.)

    The syntax of a location step is as follows

    axis::node-test[predicates]

    More XML Articles
    More By icarus, (c) Melonfire


     

       

    XML ARTICLES

    - How to Set Up Podcasting and Vodcasting
    - Creating an RSS Reader Application
    - Building an RSS File
    - An Introduction to XUL Part 6
    - An Introduction to XUL Part 5
    - An Introduction to XUL Part 4
    - An Introduction to XUL Part 3
    - An Introduction to XUL Part 2
    - An Introduction to XUL Part 1
    - XML Matters: Practical XML Data Design and M...
    - Practical XML Data Design and Manipulation f...
    - SimpleXML
    - XForms Basics, Part 3
    - XForms Basics, Part 2
    - XForms Basics





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway