module GEPUB::XMLUtil

Constants

DC_NS
OPF_NS

Public Instance Methods

attr_to_hash(nokogiri_attrs) click to toggle source
# File lib/gepub/xml_util.rb, line 14
def attr_to_hash(nokogiri_attrs)
  attributes = {}
  nokogiri_attrs.each {
    |k,v|
    attributes[k] = v.to_s
  }
  if attributes['lang']
    attributes['xml:lang'] = attributes['lang'];
    attributes.delete('lang')
  end
  attributes
end
ns_prefix(ns) click to toggle source
# File lib/gepub/xml_util.rb, line 5
def ns_prefix(ns)
  prefix = raw_prefix(ns)
  prefix.nil? ? nil : prefix.sub(/^xmlns:/,'')
end
raw_prefix(ns) click to toggle source
# File lib/gepub/xml_util.rb, line 10
def raw_prefix(ns)
  @namespaces.key(ns)      
end