~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to lib/rexml/xpath.rb

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2011-09-24 19:16:17 UTC
  • mfrom: (1.1.8 upstream) (13.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110924191617-o1qz4rcmqjot8zuy
Tags: 1.9.3~rc1-1
* New upstream release: 1.9.3 RC1.
  + Includes load.c fixes. Closes: #639959.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
  # Wrapper class.  Use this class to access the XPath functions.
6
6
  class XPath
7
7
    include Functions
 
8
    # A base Hash object, supposing to be used when initializing a
 
9
    # default empty namespaces set, but is currently unused.
 
10
    # TODO: either set the namespaces=EMPTY_HASH, or deprecate this.
8
11
    EMPTY_HASH = {}
9
12
 
10
13
    # Finds and returns the first node that matches the supplied xpath.
11
14
    # element::
12
 
    #   The context element
 
15
    #   The context element
13
16
    # path::
14
 
    #   The xpath to search for.  If not supplied or nil, returns the first
15
 
    #   node matching '*'.
 
17
    #   The xpath to search for.  If not supplied or nil, returns the first
 
18
    #   node matching '*'.
16
19
    # namespaces::
17
 
    #   If supplied, a Hash which defines a namespace mapping.
 
20
    #   If supplied, a Hash which defines a namespace mapping.
18
21
    # variables::
19
22
    #   If supplied, a Hash which maps $variables in the query
20
23
    #   to values. This can be used to avoid XPath injection attacks
42
45
    # path::
43
46
    #   The xpath to search for.  If not supplied or nil, defaults to '*'
44
47
    # namespaces::
45
 
    #   If supplied, a Hash which defines a namespace mapping
 
48
    #   If supplied, a Hash which defines a namespace mapping
46
49
    # variables::
47
50
    #   If supplied, a Hash which maps $variables in the query
48
51
    #   to values. This can be used to avoid XPath injection attacks