Class: Slaw::Grammars::ZA::Act::BlockElements

Inherits:
Treetop::Runtime::SyntaxNode
  • Object
show all
Defined in:
lib/slaw/grammars/za/act_nodes.rb

Instance Method Summary collapse

Instance Method Details

#to_xml(b, idprefix = '', i = 0) ⇒ Object



285
286
287
288
289
290
291
292
293
294
295
# File 'lib/slaw/grammars/za/act_nodes.rb', line 285

def to_xml(b, idprefix='', i=0)
  cnt = Slaw::Grammars::Counters.counters[idprefix]['paragraph'] += 1
  id = "#{idprefix}paragraph#{cnt}"
  idprefix = "#{id}."

  b.paragraph(id: id) { |b|
    b.content { |b|
      elements.each_with_index { |e, i| e.to_xml(b, idprefix, i) }
    }
  }
end