XPointer supports addressing into the internal structures of XML documents.

  • xpointer() scheme

    Locates an element(s) by specifying an (extended) XPath expression.

    xpointer( //test[2])

    Extension methods to specify string ranges and points.

  • Bare Names

    Locates an element by specifying the id() attribute value.

    test <==> xpointer( id("test"))
  • Child Sequences

    Locates an element by stepwise navigation using a sequence of integers separated by slashes (/).

    /1/2/3 ==> xpointer( /*[1]/*[2]/*[3])
    test/1/2/3 ==> xpointer( id("test")/*[1]/*[2]/*[3])
  • xmlns() scheme

    Establishes a namespace prefix mapping, used by xpointer scheme.

    xmlns(pre=http://www.test.com/)xpointer( //pre:test)
  • Specify as URI fragment.

    http://www.test.com/test.xml#xpointer( id("test"))
    http://www.test.com/test.xml#xpointer( /*[1]/*[2]/*[3])
    http://www.test.com/test.xml#xpointer( id("test")/*[1]/*[2]/*[3])
    http://www.test.com/test.xml#xmlns(pre=http://www.test.com/)xpointer( //pre:test)
  • Limited tool support (currently only partly supported as part of XInclude implementation for Xerces and XOM).

  • XML Pointer Language (XPointer) Version 1.0