75
76
77
78
79
80
81
82
83
84
85
86
|
# File 'lib/xml/smart.rb', line 75
def xpath_fast(path)
return xpath(path,self.document.custom_namespace_prefixes.merge(self.document.user_custom_namespace_prefixes))
return NodeSet.new(document) unless document
@nsc ||= 0
if @nsc != self.document.ns_counter
@ctx = XPathContext.new(self)
@ctx.register_namespaces(self.document.custom_namespace_prefixes.merge(self.document.user_custom_namespace_prefixes))
@nsc = self.document.ns_counter
end
path = path.gsub(/xmlns:/, ' :') unless Nokogiri.uses_libxml?
@ctx.evaluate(path)
end
|