FORM_TAGS | = | [ :form, :input, :select, :textarea ] | ||
SELF_CLOSING_TAGS | = | [ :base, :meta, :link, :hr, :br, :param, :img, :area, :input, :col ] | ||
AttrCore | = | [:id, :class, :style, :title] | Common sets of attributes. | |
AttrI18n | = | [:lang, 'xml:lang'.intern, :dir] | ||
AttrEvents | = | [:onclick, :ondblclick, :onmousedown, :onmouseup, :onmouseover, :onmousemove, :onmouseout, :onkeypress, :onkeydown, :onkeyup] | ||
AttrFocus | = | [:accesskey, :tabindex, :onfocus, :onblur] | ||
AttrHAlign | = | [:align, :char, :charoff] | ||
AttrVAlign | = | [:valign] | ||
Attrs | = | AttrCore + AttrI18n + AttrEvents |
Hpricot::XML parses input, disregarding all the HTML rules and returning a document tree.
# File lib/hpricot/parse.rb, line 20 def Hpricot.XML(input = nil, opts = {}, &blk) opts.merge! :xml => true make(input, opts, &blk) end
# File lib/hpricot/builder.rb, line 14 def self.build(ele = Doc.new, assigns = {}, &blk) ele.extend Builder assigns.each do |k, v| ele.instance_variable_set("@#{k}", v) end ele.instance_eval(&blk) ele end
Hpricot.parse parses input and return a document tree. represented by Hpricot::Doc.
# File lib/hpricot/parse.rb, line 14 def Hpricot.parse(input = nil, opts = {}, &blk) make(input, opts, &blk) end