XPointer

     

  • Html anchor
    • You have to have an named anchor already in the document you point to
  • XPointer
    • Don't need an anchor
    • Only renders the pertinant part of the document
    • Example
      • http://www.mysite.com/catalog/catalog.xml#xpointer(book1)
      • this would point to the element with the ID: book1 in the catalog.xml document
        
              <Catalog> 
                  <Book color="red" ID="book1"> 
                        <Title>XML IE5 Programmer's Reference</Title> <Pages>480</Pages> 
                        <ISBN>1-861001-57-6</ISBN> 
                        <RecSubjCategories> 
                              <Category>Internet</Category> 
                              <Category>Web Publishing</Category> 
                              <Category>XML</Category> 
                        </RecSubjCategories> 
                        <Price>$29.99</Price>
                   </Book> 
               </Catalog> 
      • http://www.mysite.com/catalog/catalog.xml#xpointer(book1/4/2) would get: -- book1, go to the 4th element (RecSubjCategories) and get the 2nd element (Web Publishing)
    • Full XPointer specs:
      • catalog.xml#xpointer(id("book1"/range-to(id("book3"))
        • this would display the books from 1 to 3
      • catalog.xml#xpointer(string-range(/, "XML"))
        • this would display all instances of "XML" in the catalog.xml document