4Suite API Documentation: Ft.Xml.XPointer

4Suite™ API Documentation

# ► Module Ft.Xml.XPointer

Module for XPointer processing

    Copyright 2005 Fourthought, Inc. (USA).
    Detailed license and copyright information: http://4suite.org/COPYRIGHT
    Project home, documentation, distributions: http://4suite.org/

Classes: XPtrException |  |  |  | Functions: Compile, SelectNode, SelectUri

## Modules

MessageSource | XPointer error codes and messages
ParsedNodeTest | A Parsed Token that represents a node test. WWW: http://4suite.org/XPATH e-mail: support@4suite.org
ParsedXPointer | A Parsed Token that represents a list of XPointers WWW: http://4suite.org/XPointer e-mail: support@4suite.org
XPointer | A Parsed Token that represents a list of XPointers WWW: http://4suite.org/XPointer e-mail: support@4suite.org
XPointerParserc |
XPtrContext |
XPtrExprParserc |
XPtrFunctions |

## Classes

class XPtrException(Ft.FtException)

  ### Methods

  __init__(self, errorCode, *args)
    Overrides: __init__ from class FtException

  ### Methods inherited from class Ft.FtException

  __getattr__, __repr__, __str__

  ### Methods inherited from class Exception

  __getitem__

  ### Members

  INTERNAL_ERROR = 1
  RESOURCE_ERROR = 3
  SUB_RESOURCE_ERROR = 4
  SYNTAX_ERROR = 2

## Functions

Compile(expr)
  Given an XPointer expression as a string, returns an object that allows an evaluation engine to operate on the expression efficiently.
SelectNode(doc, xpointer, nss=None, contextNode=None)
  Given a valid DOM node, evaluates an XPointer against it.

      contextNode, if given, is the original XPointer context node
      (e.g., from the referring document, if any; accessible in the
      XPointer via the 'here' function).

      nss is a set of explicit namespace mappings for use when evaluating
      the XPointer (e.g., when the xmlns scheme isn't being used).

SelectUri(uri, contextNode=None, nss=None)
  Parses the document with the given URI, and returns the node corresponding to the XPointer given in the fragment of the URI.

      uri must be an absolute URI reference. If it doesn't have a
      fragment, returns the root node.

      contextNode, if given, is the original XPointer context node
      (e.g., from the referring document, if any; accessible in the
      XPointer via the 'here' function).

      nss is a set of explicit namespace mappings for use when evaluating
      the XPointer (e.g., when the xmlns scheme isn't being used).