Methods

Files

XPath::Expression::NextSibling

Public Instance Methods

to_xpath(predicate=nil) click to toggle source
# File lib/xpath/expression.rb, line 66
def to_xpath(predicate=nil)
  if @expressions.length == 1
    "#{@left.to_xpath(predicate)}/following-sibling::*[1]/self::#{@expressions.first.to_xpath(predicate)}"
  elsif @expressions.length > 1
    "#{@left.to_xpath(predicate)}/following-sibling::*[1]/self::*[#{@expressions.map { |e| "self::#{e.to_xpath(predicate)}" }.join(" | ")}]"
  else
    "#{@left.to_xpath(predicate)}/following-sibling::*[1]/self::*"
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.