Module: Nokogiri
- Defined in:
- lib/nokogiri.rb,
lib/nokogiri/xml.rb,
lib/nokogiri/html.rb,
lib/nokogiri/xslt.rb,
lib/nokogiri/hpricot.rb,
lib/nokogiri/version.rb,
lib/nokogiri/xml/sax.rb,
lib/nokogiri/css/node.rb,
lib/nokogiri/xml/node.rb,
lib/nokogiri/xml/text.rb,
lib/nokogiri/xml/xpath.rb,
lib/nokogiri/css/parser.rb,
lib/nokogiri/xml/reader.rb,
lib/nokogiri/xml/builder.rb,
lib/nokogiri/html/builder.rb,
lib/nokogiri/xml/document.rb,
lib/nokogiri/xml/node_set.rb,
lib/nokogiri/css/tokenizer.rb,
lib/nokogiri/html/document.rb,
lib/nokogiri/xml/sax/parser.rb,
lib/nokogiri/html/sax/parser.rb,
lib/nokogiri/xslt/stylesheet.rb,
lib/nokogiri/xml/sax/document.rb,
lib/nokogiri/css/xpath_visitor.rb,
lib/nokogiri/xml/after_handler.rb,
lib/nokogiri/xml/before_handler.rb,
lib/nokogiri/decorators/hpricot/node.rb,
lib/nokogiri/decorators/hpricot/node_set.rb,
lib/nokogiri/decorators/hpricot/xpath_visitor.rb,
ext/nokogiri/xml_cdata.c,
ext/nokogiri/xml_xpath.c,
ext/nokogiri/xml_reader.c,
ext/nokogiri/xml_xpath_context.c
Defined Under Namespace
Modules: CSS, Decorators, HTML, Hpricot, XML, XSLT
Constant Summary
collapse
- VERSION =
'0.0.0'
Class Method Summary
collapse
Class Method Details
.Hpricot(*args, &block) ⇒ Object
.make(input = nil, opts = {}, &blk) ⇒ Object
28
29
30
31
32
33
34
|
# File 'lib/nokogiri.rb', line 28
def make(input = nil, opts = {}, &blk)
if input
Nokogiri::XML::Node.new_from_str(input)
else
Nokogiri(&blk)
end
end
|
.parse(string, url = nil, encoding = nil, options = 32) {|doc| ... } ⇒ Object
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/nokogiri.rb', line 13
def parse(string, url = nil, encoding = nil, options = 32)
doc =
if string =~ /^\s*<[^Hh>]*html/i Nokogiri::HTML.parse(string, url, encoding, options)
else
Nokogiri::XML.parse(string, url, encoding, options)
end
yield doc if block_given?
doc
end
|