Class: XForms::FormParser

Inherits:
Object show all
Defined in:
lib/xforms/form_parser.rb

Constant Summary collapse

XFORMS_NS =
'http://www.w3.org/2002/xforms'

Instance Method Summary collapse

Constructor Details

#initialize(input) ⇒ FormParser

Returns a new instance of FormParser.



7
8
9
10
11
# File 'lib/xforms/form_parser.rb', line 7

def initialize(input)
  @reader = Nokogiri::XML::Reader(input)
  @form = Form.new
  @bindings = {}
end

Instance Method Details

#parseObject



13
14
15
16
17
18
19
20
21
# File 'lib/xforms/form_parser.rb', line 13

def parse
  while read
    if is_xforms_element?
      parse_xforms_element
    end
  end
  @form.recalculate
  @form
end