Method: IsoDoc::PresentationXMLConvert#index

Defined in:
lib/isodoc/presentation_function/index.rb

#index(xml) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/isodoc/presentation_function/index.rb', line 15

def index(xml)
  if enable_indexsect && xml.at(ns("//index"))
    i = xml.at(ns("//indexsect")) ||
      xml.root.add_child("<indexsect #{add_id}><title>#{@i18n.index}" \
                         "</title></indexsect>").first
    index = sort_indexterms(xml.xpath(ns("//index")),
                            xml.xpath(ns("//index-xref[@also = 'false']")),
                            xml.xpath(ns("//index-xref[@also = 'true']")))
    index1(xml, i, index)
  else strip_index(xml)
  end
end