Sha256: 63fc5baf51d5542a3a87ef602ba96335ad2e74074b5cbafce737ed508eed238b
Contents?: true
Size: 749 Bytes
Versions: 23
Compression:
Stored size: 749 Bytes
Contents
module Htmltoooxml class Document include XSLTHelper class << self end def initialize() @replaceable_files = {} end def transform_doc_xml(source, extras = false) transformed_source = xslt(stylesheet_name: 'cleanup').transform(source) transformed_source = xslt(stylesheet_name: 'inline_elements').transform(transformed_source) transform_and_replace(transformed_source, document_xslt(extras), extras) end private def transform_and_replace(source, stylesheet_path, remove_ns = false) stylesheet = xslt(stylesheet_path: stylesheet_path) content = stylesheet.apply_to(source) content.gsub!(/\s*xmlns:(\w+)="(.*?)\s*"/, '') if remove_ns content end end end
Version data entries
23 entries across 23 versions & 1 rubygems