Method: CML::Parser#each_cml_group_descendant
- Defined in:
- lib/cml/parser.rb
#each_cml_group_descendant ⇒ Object
Do something for each <cml::group> descendant “base” CML::Tag
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/cml/parser.rb', line 56 def each_cml_group_descendant return unless block_given? group_nodes = @doc.xpath(".#{GROUP_XPATH}", "xmlns:cml"=>"http://crowdflower.com") group_nodes.each do |group_node| group_descendant_nodes = group_node.xpath(BASE_TAGS_XPATH, "xmlns:cml"=>"http://crowdflower.com") group_descendant_nodes.each_with_index do |node, i| cml_tag = @cml_tag_map[node.object_id] yield group_node, cml_tag, i end end end |