Method: IsoDoc::Function::XrefGen#hierarchical_figure_names

Defined in:
lib/isodoc/function/xref_gen.rb

#hierarchical_figure_names(clause, num) ⇒ Object



250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# File 'lib/isodoc/function/xref_gen.rb', line 250

def hierarchical_figure_names(clause, num)
  c = Counter.new
  j = 0
  clause.xpath(ns(".//figure")).each do |t|
    if t.parent.name == "figure" then j += 1
    else
      j = 0
      c.increment(t)
    end
    label = "#{num}#{hiersep}#{c.print}" +
      (j.zero? ? "" : "#{hierfigsep}#{j}")
    next if t["id"].nil? || t["id"].empty?
    @anchors[t["id"]] = anchor_struct(label, nil, @figure_lbl, "figure",
                                      t["unnumbered"])
  end
end