Method: IsoDoc::PresentationXMLConvert#empty_xml?

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

#empty_xml?(str) ⇒ Boolean

detect whether string which may contain XML markup is empty

Returns:

  • (Boolean)


121
122
123
124
125
# File 'lib/isodoc/presentation_function/autonum.rb', line 121

def empty_xml?(str)
  str.blank? and return true
  x = Nokogiri::XML::DocumentFragment.parse(str)
  x.to_str.strip.empty?
end