# REXML::XPathParser (Class)

In: | rexml/xpath_parser.rb
Parent: | Object

You don’t want to use this class. Really. Use XPath, which is a wrapper for this class. Believe me. You don’t want to poke around in here. There is strange, dark magic at work in this code. Beware. Go back! Go back while you still can!

## Methods

[]= namespaces= new parse predicate variables=

## Constants

LITERAL | = | /^'([^']*)'|^"([^"]*)"/u

## Included Modules

XMLTokens

## Public Class methods

new( )

[Source]

    # File rexml/xpath_parser.rb, line 14
                    def initialize( )
                            @parser = REXML::Parsers::XPathParser.new
                            @namespaces = {}
                            @variables = {}
                    end

## Public Instance methods

namespaces=( namespaces={} )

[Source]

    # File rexml/xpath_parser.rb, line 20
                    def namespaces=( namespaces={} )
                            Functions::namespace_context = namespaces
                            @namespaces = namespaces
                    end

variables=( vars={} )

[Source]

    # File rexml/xpath_parser.rb, line 25
                    def variables=( vars={} )
                            Functions::variables = vars
                            @variables = vars
                    end

parse(path, nodeset)

[Source]

    # File rexml/xpath_parser.rb, line 30
                    def parse path, nodeset
                            path_stack = @parser.parse( path )
                            #puts "PARSE: #{path} => #{path_stack.inspect}"

                            match( path_stack, nodeset )
                    end

predicate(path, nodeset)

[Source]

    # File rexml/xpath_parser.rb, line 36
                    def predicate path, nodeset
                            path_stack = @parser.predicate( path )
                            return Predicate( path_stack, nodeset )
                    end

[]=( variable_name, value )

[Source]

    # File rexml/xpath_parser.rb, line 41
                    def []=( variable_name, value )
                            @variables[ variable_name ] = value
                    end

[Validate]