Method: IsoDoc::PresentationXMLConvert#embedable_semantic_xml_attributes

Defined in:
lib/isodoc/presentation_xml_convert.rb

#embedable_semantic_xml_attributes(xml) ⇒ Object



144
145
146
147
148
149
150
151
152
153
# File 'lib/isodoc/presentation_xml_convert.rb', line 144

def embedable_semantic_xml_attributes(xml)
  Metanorma::Utils::anchor_attributes.each do |(tag_name, attr_name)|
    tag_name == "*" or tag_name = "semantic__#{tag_name}"
    xml.xpath("//#{tag_name}[@#{attr_name}]").each do |elem|
      elem.attributes[attr_name].value =
        "semantic__#{elem.attributes[attr_name].value}"
    end
  end
  xml
end