module Htmltoword::XSLTHelper

Public Instance Methods

document_xslt(extras = false) click to toggle source
# File lib/htmltoword/helpers/xslt_helper.rb, line 3
def document_xslt(extras = false)
  file_name = extras ? 'htmltoword' : 'base'
  xslt_path(file_name)
end
xslt(stylesheet_name: nil, stylesheet_path: nil) click to toggle source
# File lib/htmltoword/helpers/xslt_helper.rb, line 12
def xslt(stylesheet_name: nil, stylesheet_path: nil)
  return Nokogiri::XSLT(File.open(stylesheet_path)) if stylesheet_path
  Nokogiri::XSLT(File.open(xslt_path(stylesheet_name)))
end
xslt_path(template_name) click to toggle source
# File lib/htmltoword/helpers/xslt_helper.rb, line 8
def xslt_path(template_name)
  File.join(Htmltoword.config.default_xslt_path, "#{template_name}.xslt")
end