require 'rails_connector/fop_on_rails/document/dom_tree' require 'rails_connector/fop_on_rails/document/images' require 'rails_connector/fop_on_rails/document/tables' module RailsConnector module FopOnRails module Document def self.repair(path, xml_uri = nil) xml = DomTree.repair(File.read(path)) if xml_uri Images.absolutize_src_attrs(xml, xml_uri) else Images.dump_images(xml) end Tables.repair(xml) File.open(path, 'w') do |f| f.write(xml.to_s) end end end end end