# frozen_string_literal: false
module XMLStyleSheetMixin
attr_accessor :xml_stylesheets
xsss = @xml_stylesheets.collect do |xss|
pi = nil if /\A\s*\z/ =~ pi
xsss.push("") unless xsss.empty?
ATTRIBUTES = %w(href type title media charset alternate)
attr_accessor(*ATTRIBUTES)
attr_accessor(:do_validate)
(attrs.first.is_a?(Hash) or attrs.first.is_a?(Array))
ATTRIBUTES.each do |attr|
__send__("#{attr}=", nil)
vars.unshift(:do_validate)
attrs.each do |name, value|
if vars.include?(name.to_s)
__send__("#{name}=", value)
rv << %Q[<?xml-stylesheet]
ATTRIBUTES.each do |name|
rv << %Q[ #{name}="#{h __send__(name)}"]
@type = guess_type(@href)
remove_method(:alternate=)
if value.nil? or /\A(?:yes|no)\z/ =~ value
args = ["?xml-stylesheet?", %Q[alternate="#{value}"]]
raise NotAvailableValueError.new(*args)
xss = maker.xml_stylesheets.new_xml_stylesheet
ATTRIBUTES.each do |attr|
xss.__send__("#{attr}=", __send__(attr))