Method: IsoDoc::PresentationXMLConvert#embedable_semantic_xml_attributes

Defined in:
lib/isodoc/presentation_xml_convert.rb

#embedable_semantic_xml_attributes(xml) ⇒ Object



178
179
180
181
182
183
184
185
186
187
# File 'lib/isodoc/presentation_xml_convert.rb', line 178

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