Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../opt/alt/ruby27/share/ruby/rss
File: parser.rb
# frozen_string_literal: false
[0] Fix | Delete
require "forwardable"
[1] Fix | Delete
require "open-uri"
[2] Fix | Delete
[3] Fix | Delete
require_relative "rss"
[4] Fix | Delete
require_relative "xml"
[5] Fix | Delete
[6] Fix | Delete
module RSS
[7] Fix | Delete
[8] Fix | Delete
class NotWellFormedError < Error
[9] Fix | Delete
attr_reader :line, :element
[10] Fix | Delete
[11] Fix | Delete
# Create a new NotWellFormedError for an error at +line+
[12] Fix | Delete
# in +element+. If a block is given the return value of
[13] Fix | Delete
# the block ends up in the error message.
[14] Fix | Delete
def initialize(line=nil, element=nil)
[15] Fix | Delete
message = "This is not well formed XML"
[16] Fix | Delete
if element or line
[17] Fix | Delete
message << "\nerror occurred"
[18] Fix | Delete
message << " in #{element}" if element
[19] Fix | Delete
message << " at about #{line} line" if line
[20] Fix | Delete
end
[21] Fix | Delete
message << "\n#{yield}" if block_given?
[22] Fix | Delete
super(message)
[23] Fix | Delete
end
[24] Fix | Delete
end
[25] Fix | Delete
[26] Fix | Delete
class XMLParserNotFound < Error
[27] Fix | Delete
def initialize
[28] Fix | Delete
super("available XML parser was not found in " <<
[29] Fix | Delete
"#{AVAILABLE_PARSER_LIBRARIES.inspect}.")
[30] Fix | Delete
end
[31] Fix | Delete
end
[32] Fix | Delete
[33] Fix | Delete
class NotValidXMLParser < Error
[34] Fix | Delete
def initialize(parser)
[35] Fix | Delete
super("#{parser} is not an available XML parser. " <<
[36] Fix | Delete
"Available XML parser" <<
[37] Fix | Delete
(AVAILABLE_PARSERS.size > 1 ? "s are " : " is ") <<
[38] Fix | Delete
"#{AVAILABLE_PARSERS.inspect}.")
[39] Fix | Delete
end
[40] Fix | Delete
end
[41] Fix | Delete
[42] Fix | Delete
class NSError < InvalidRSSError
[43] Fix | Delete
attr_reader :tag, :prefix, :uri
[44] Fix | Delete
def initialize(tag, prefix, require_uri)
[45] Fix | Delete
@tag, @prefix, @uri = tag, prefix, require_uri
[46] Fix | Delete
super("prefix <#{prefix}> doesn't associate uri " <<
[47] Fix | Delete
"<#{require_uri}> in tag <#{tag}>")
[48] Fix | Delete
end
[49] Fix | Delete
end
[50] Fix | Delete
[51] Fix | Delete
class Parser
[52] Fix | Delete
[53] Fix | Delete
extend Forwardable
[54] Fix | Delete
[55] Fix | Delete
class << self
[56] Fix | Delete
[57] Fix | Delete
@@default_parser = nil
[58] Fix | Delete
[59] Fix | Delete
def default_parser
[60] Fix | Delete
@@default_parser || AVAILABLE_PARSERS.first
[61] Fix | Delete
end
[62] Fix | Delete
[63] Fix | Delete
# Set @@default_parser to new_value if it is one of the
[64] Fix | Delete
# available parsers. Else raise NotValidXMLParser error.
[65] Fix | Delete
def default_parser=(new_value)
[66] Fix | Delete
if AVAILABLE_PARSERS.include?(new_value)
[67] Fix | Delete
@@default_parser = new_value
[68] Fix | Delete
else
[69] Fix | Delete
raise NotValidXMLParser.new(new_value)
[70] Fix | Delete
end
[71] Fix | Delete
end
[72] Fix | Delete
[73] Fix | Delete
def parse(rss, *args)
[74] Fix | Delete
if args.last.is_a?(Hash)
[75] Fix | Delete
options = args.pop
[76] Fix | Delete
else
[77] Fix | Delete
options = {}
[78] Fix | Delete
end
[79] Fix | Delete
do_validate = boolean_argument(args[0], options[:validate], true)
[80] Fix | Delete
ignore_unknown_element =
[81] Fix | Delete
boolean_argument(args[1], options[:ignore_unknown_element], true)
[82] Fix | Delete
parser_class = args[2] || options[:parser_class] || default_parser
[83] Fix | Delete
parser = new(rss, parser_class)
[84] Fix | Delete
parser.do_validate = do_validate
[85] Fix | Delete
parser.ignore_unknown_element = ignore_unknown_element
[86] Fix | Delete
parser.parse
[87] Fix | Delete
end
[88] Fix | Delete
[89] Fix | Delete
private
[90] Fix | Delete
def boolean_argument(positioned_value, option_value, default)
[91] Fix | Delete
value = positioned_value
[92] Fix | Delete
if value.nil? and not option_value.nil?
[93] Fix | Delete
value = option_value
[94] Fix | Delete
end
[95] Fix | Delete
value = default if value.nil?
[96] Fix | Delete
value
[97] Fix | Delete
end
[98] Fix | Delete
end
[99] Fix | Delete
[100] Fix | Delete
def_delegators(:@parser, :parse, :rss,
[101] Fix | Delete
:ignore_unknown_element,
[102] Fix | Delete
:ignore_unknown_element=, :do_validate,
[103] Fix | Delete
:do_validate=)
[104] Fix | Delete
[105] Fix | Delete
def initialize(rss, parser_class=self.class.default_parser)
[106] Fix | Delete
@parser = parser_class.new(normalize_rss(rss))
[107] Fix | Delete
end
[108] Fix | Delete
[109] Fix | Delete
private
[110] Fix | Delete
[111] Fix | Delete
# Try to get the XML associated with +rss+.
[112] Fix | Delete
# Return +rss+ if it already looks like XML, or treat it as a URI,
[113] Fix | Delete
# or a file to get the XML,
[114] Fix | Delete
def normalize_rss(rss)
[115] Fix | Delete
return rss if maybe_xml?(rss)
[116] Fix | Delete
[117] Fix | Delete
uri = to_uri(rss)
[118] Fix | Delete
[119] Fix | Delete
if uri.respond_to?(:read)
[120] Fix | Delete
uri.read
[121] Fix | Delete
elsif (RUBY_VERSION >= '2.7' || !rss.tainted?) and File.readable?(rss)
[122] Fix | Delete
File.open(rss) {|f| f.read}
[123] Fix | Delete
else
[124] Fix | Delete
rss
[125] Fix | Delete
end
[126] Fix | Delete
end
[127] Fix | Delete
[128] Fix | Delete
# maybe_xml? tests if source is a string that looks like XML.
[129] Fix | Delete
def maybe_xml?(source)
[130] Fix | Delete
source.is_a?(String) and /</ =~ source
[131] Fix | Delete
end
[132] Fix | Delete
[133] Fix | Delete
# Attempt to convert rss to a URI, but just return it if
[134] Fix | Delete
# there's a ::URI::Error
[135] Fix | Delete
def to_uri(rss)
[136] Fix | Delete
return rss if rss.is_a?(::URI::Generic)
[137] Fix | Delete
[138] Fix | Delete
begin
[139] Fix | Delete
::URI.parse(rss)
[140] Fix | Delete
rescue ::URI::Error
[141] Fix | Delete
rss
[142] Fix | Delete
end
[143] Fix | Delete
end
[144] Fix | Delete
end
[145] Fix | Delete
[146] Fix | Delete
class BaseParser
[147] Fix | Delete
[148] Fix | Delete
class << self
[149] Fix | Delete
def raise_for_undefined_entity?
[150] Fix | Delete
listener.raise_for_undefined_entity?
[151] Fix | Delete
end
[152] Fix | Delete
end
[153] Fix | Delete
[154] Fix | Delete
def initialize(rss)
[155] Fix | Delete
@listener = self.class.listener.new
[156] Fix | Delete
@rss = rss
[157] Fix | Delete
end
[158] Fix | Delete
[159] Fix | Delete
def rss
[160] Fix | Delete
@listener.rss
[161] Fix | Delete
end
[162] Fix | Delete
[163] Fix | Delete
def ignore_unknown_element
[164] Fix | Delete
@listener.ignore_unknown_element
[165] Fix | Delete
end
[166] Fix | Delete
[167] Fix | Delete
def ignore_unknown_element=(new_value)
[168] Fix | Delete
@listener.ignore_unknown_element = new_value
[169] Fix | Delete
end
[170] Fix | Delete
[171] Fix | Delete
def do_validate
[172] Fix | Delete
@listener.do_validate
[173] Fix | Delete
end
[174] Fix | Delete
[175] Fix | Delete
def do_validate=(new_value)
[176] Fix | Delete
@listener.do_validate = new_value
[177] Fix | Delete
end
[178] Fix | Delete
[179] Fix | Delete
def parse
[180] Fix | Delete
if @listener.rss.nil?
[181] Fix | Delete
_parse
[182] Fix | Delete
end
[183] Fix | Delete
@listener.rss
[184] Fix | Delete
end
[185] Fix | Delete
[186] Fix | Delete
end
[187] Fix | Delete
[188] Fix | Delete
class BaseListener
[189] Fix | Delete
[190] Fix | Delete
extend Utils
[191] Fix | Delete
[192] Fix | Delete
class << self
[193] Fix | Delete
[194] Fix | Delete
@@accessor_bases = {}
[195] Fix | Delete
@@registered_uris = {}
[196] Fix | Delete
@@class_names = {}
[197] Fix | Delete
[198] Fix | Delete
# return the setter for the uri, tag_name pair, or nil.
[199] Fix | Delete
def setter(uri, tag_name)
[200] Fix | Delete
_getter = getter(uri, tag_name)
[201] Fix | Delete
if _getter
[202] Fix | Delete
"#{_getter}="
[203] Fix | Delete
else
[204] Fix | Delete
nil
[205] Fix | Delete
end
[206] Fix | Delete
end
[207] Fix | Delete
[208] Fix | Delete
def getter(uri, tag_name)
[209] Fix | Delete
(@@accessor_bases[uri] || {})[tag_name]
[210] Fix | Delete
end
[211] Fix | Delete
[212] Fix | Delete
# return the tag_names for setters associated with uri
[213] Fix | Delete
def available_tags(uri)
[214] Fix | Delete
(@@accessor_bases[uri] || {}).keys
[215] Fix | Delete
end
[216] Fix | Delete
[217] Fix | Delete
# register uri against this name.
[218] Fix | Delete
def register_uri(uri, name)
[219] Fix | Delete
@@registered_uris[name] ||= {}
[220] Fix | Delete
@@registered_uris[name][uri] = nil
[221] Fix | Delete
end
[222] Fix | Delete
[223] Fix | Delete
# test if this uri is registered against this name
[224] Fix | Delete
def uri_registered?(uri, name)
[225] Fix | Delete
@@registered_uris[name].has_key?(uri)
[226] Fix | Delete
end
[227] Fix | Delete
[228] Fix | Delete
# record class_name for the supplied uri and tag_name
[229] Fix | Delete
def install_class_name(uri, tag_name, class_name)
[230] Fix | Delete
@@class_names[uri] ||= {}
[231] Fix | Delete
@@class_names[uri][tag_name] = class_name
[232] Fix | Delete
end
[233] Fix | Delete
[234] Fix | Delete
# retrieve class_name for the supplied uri and tag_name
[235] Fix | Delete
# If it doesn't exist, capitalize the tag_name
[236] Fix | Delete
def class_name(uri, tag_name)
[237] Fix | Delete
name = (@@class_names[uri] || {})[tag_name]
[238] Fix | Delete
return name if name
[239] Fix | Delete
[240] Fix | Delete
tag_name = tag_name.gsub(/[_\-]([a-z]?)/) {$1.upcase}
[241] Fix | Delete
tag_name[0, 1].upcase + tag_name[1..-1]
[242] Fix | Delete
end
[243] Fix | Delete
[244] Fix | Delete
def install_get_text_element(uri, name, accessor_base)
[245] Fix | Delete
install_accessor_base(uri, name, accessor_base)
[246] Fix | Delete
def_get_text_element(uri, name, *get_file_and_line_from_caller(1))
[247] Fix | Delete
end
[248] Fix | Delete
[249] Fix | Delete
def raise_for_undefined_entity?
[250] Fix | Delete
true
[251] Fix | Delete
end
[252] Fix | Delete
[253] Fix | Delete
private
[254] Fix | Delete
# set the accessor for the uri, tag_name pair
[255] Fix | Delete
def install_accessor_base(uri, tag_name, accessor_base)
[256] Fix | Delete
@@accessor_bases[uri] ||= {}
[257] Fix | Delete
@@accessor_bases[uri][tag_name] = accessor_base.chomp("=")
[258] Fix | Delete
end
[259] Fix | Delete
[260] Fix | Delete
def def_get_text_element(uri, element_name, file, line)
[261] Fix | Delete
register_uri(uri, element_name)
[262] Fix | Delete
method_name = "start_#{element_name}"
[263] Fix | Delete
unless private_method_defined?(method_name)
[264] Fix | Delete
define_method(method_name) do |name, prefix, attrs, ns|
[265] Fix | Delete
uri = _ns(ns, prefix)
[266] Fix | Delete
if self.class.uri_registered?(uri, element_name)
[267] Fix | Delete
start_get_text_element(name, prefix, ns, uri)
[268] Fix | Delete
else
[269] Fix | Delete
start_else_element(name, prefix, attrs, ns)
[270] Fix | Delete
end
[271] Fix | Delete
end
[272] Fix | Delete
private(method_name)
[273] Fix | Delete
end
[274] Fix | Delete
end
[275] Fix | Delete
end
[276] Fix | Delete
end
[277] Fix | Delete
[278] Fix | Delete
module ListenerMixin
[279] Fix | Delete
attr_reader :rss
[280] Fix | Delete
[281] Fix | Delete
attr_accessor :ignore_unknown_element
[282] Fix | Delete
attr_accessor :do_validate
[283] Fix | Delete
[284] Fix | Delete
def initialize
[285] Fix | Delete
@rss = nil
[286] Fix | Delete
@ignore_unknown_element = true
[287] Fix | Delete
@do_validate = true
[288] Fix | Delete
@ns_stack = [{"xml" => :xml}]
[289] Fix | Delete
@tag_stack = [[]]
[290] Fix | Delete
@text_stack = ['']
[291] Fix | Delete
@proc_stack = []
[292] Fix | Delete
@last_element = nil
[293] Fix | Delete
@version = @encoding = @standalone = nil
[294] Fix | Delete
@xml_stylesheets = []
[295] Fix | Delete
@xml_child_mode = false
[296] Fix | Delete
@xml_element = nil
[297] Fix | Delete
@last_xml_element = nil
[298] Fix | Delete
end
[299] Fix | Delete
[300] Fix | Delete
# set instance vars for version, encoding, standalone
[301] Fix | Delete
def xmldecl(version, encoding, standalone)
[302] Fix | Delete
@version, @encoding, @standalone = version, encoding, standalone
[303] Fix | Delete
end
[304] Fix | Delete
[305] Fix | Delete
def instruction(name, content)
[306] Fix | Delete
if name == "xml-stylesheet"
[307] Fix | Delete
params = parse_pi_content(content)
[308] Fix | Delete
if params.has_key?("href")
[309] Fix | Delete
@xml_stylesheets << XMLStyleSheet.new(params)
[310] Fix | Delete
end
[311] Fix | Delete
end
[312] Fix | Delete
end
[313] Fix | Delete
[314] Fix | Delete
def tag_start(name, attributes)
[315] Fix | Delete
@text_stack.push('')
[316] Fix | Delete
[317] Fix | Delete
ns = @ns_stack.last.dup
[318] Fix | Delete
attrs = {}
[319] Fix | Delete
attributes.each do |n, v|
[320] Fix | Delete
if /\Axmlns(?:\z|:)/ =~ n
[321] Fix | Delete
ns[$POSTMATCH] = v
[322] Fix | Delete
else
[323] Fix | Delete
attrs[n] = v
[324] Fix | Delete
end
[325] Fix | Delete
end
[326] Fix | Delete
@ns_stack.push(ns)
[327] Fix | Delete
[328] Fix | Delete
prefix, local = split_name(name)
[329] Fix | Delete
@tag_stack.last.push([_ns(ns, prefix), local])
[330] Fix | Delete
@tag_stack.push([])
[331] Fix | Delete
if @xml_child_mode
[332] Fix | Delete
previous = @last_xml_element
[333] Fix | Delete
element_attrs = attributes.dup
[334] Fix | Delete
unless previous
[335] Fix | Delete
ns.each do |ns_prefix, value|
[336] Fix | Delete
next if ns_prefix == "xml"
[337] Fix | Delete
key = ns_prefix.empty? ? "xmlns" : "xmlns:#{ns_prefix}"
[338] Fix | Delete
element_attrs[key] ||= value
[339] Fix | Delete
end
[340] Fix | Delete
end
[341] Fix | Delete
next_element = XML::Element.new(local,
[342] Fix | Delete
prefix.empty? ? nil : prefix,
[343] Fix | Delete
_ns(ns, prefix),
[344] Fix | Delete
element_attrs)
[345] Fix | Delete
previous << next_element if previous
[346] Fix | Delete
@last_xml_element = next_element
[347] Fix | Delete
pr = Proc.new do |text, tags|
[348] Fix | Delete
if previous
[349] Fix | Delete
@last_xml_element = previous
[350] Fix | Delete
else
[351] Fix | Delete
@xml_element = @last_xml_element
[352] Fix | Delete
@last_xml_element = nil
[353] Fix | Delete
end
[354] Fix | Delete
end
[355] Fix | Delete
@proc_stack.push(pr)
[356] Fix | Delete
else
[357] Fix | Delete
if @rss.nil? and respond_to?("initial_start_#{local}", true)
[358] Fix | Delete
__send__("initial_start_#{local}", local, prefix, attrs, ns.dup)
[359] Fix | Delete
elsif respond_to?("start_#{local}", true)
[360] Fix | Delete
__send__("start_#{local}", local, prefix, attrs, ns.dup)
[361] Fix | Delete
else
[362] Fix | Delete
start_else_element(local, prefix, attrs, ns.dup)
[363] Fix | Delete
end
[364] Fix | Delete
end
[365] Fix | Delete
end
[366] Fix | Delete
[367] Fix | Delete
def tag_end(name)
[368] Fix | Delete
if DEBUG
[369] Fix | Delete
p "end tag #{name}"
[370] Fix | Delete
p @tag_stack
[371] Fix | Delete
end
[372] Fix | Delete
text = @text_stack.pop
[373] Fix | Delete
tags = @tag_stack.pop
[374] Fix | Delete
pr = @proc_stack.pop
[375] Fix | Delete
pr.call(text, tags) unless pr.nil?
[376] Fix | Delete
@ns_stack.pop
[377] Fix | Delete
end
[378] Fix | Delete
[379] Fix | Delete
def text(data)
[380] Fix | Delete
if @xml_child_mode
[381] Fix | Delete
@last_xml_element << data if @last_xml_element
[382] Fix | Delete
else
[383] Fix | Delete
@text_stack.last << data
[384] Fix | Delete
end
[385] Fix | Delete
end
[386] Fix | Delete
[387] Fix | Delete
private
[388] Fix | Delete
def _ns(ns, prefix)
[389] Fix | Delete
ns.fetch(prefix, "")
[390] Fix | Delete
end
[391] Fix | Delete
[392] Fix | Delete
CONTENT_PATTERN = /\s*([^=]+)=(["'])([^\2]+?)\2/
[393] Fix | Delete
# Extract the first name="value" pair from content.
[394] Fix | Delete
# Works with single quotes according to the constant
[395] Fix | Delete
# CONTENT_PATTERN. Return a Hash.
[396] Fix | Delete
def parse_pi_content(content)
[397] Fix | Delete
params = {}
[398] Fix | Delete
content.scan(CONTENT_PATTERN) do |name, quote, value|
[399] Fix | Delete
params[name] = value
[400] Fix | Delete
end
[401] Fix | Delete
params
[402] Fix | Delete
end
[403] Fix | Delete
[404] Fix | Delete
def start_else_element(local, prefix, attrs, ns)
[405] Fix | Delete
class_name = self.class.class_name(_ns(ns, prefix), local)
[406] Fix | Delete
current_class = @last_element.class
[407] Fix | Delete
if known_class?(current_class, class_name)
[408] Fix | Delete
next_class = current_class.const_get(class_name)
[409] Fix | Delete
start_have_something_element(local, prefix, attrs, ns, next_class)
[410] Fix | Delete
else
[411] Fix | Delete
if !@do_validate or @ignore_unknown_element
[412] Fix | Delete
@proc_stack.push(setup_next_element_in_unknown_element)
[413] Fix | Delete
else
[414] Fix | Delete
parent = "ROOT ELEMENT???"
[415] Fix | Delete
if current_class.tag_name
[416] Fix | Delete
parent = current_class.tag_name
[417] Fix | Delete
end
[418] Fix | Delete
raise NotExpectedTagError.new(local, _ns(ns, prefix), parent)
[419] Fix | Delete
end
[420] Fix | Delete
end
[421] Fix | Delete
end
[422] Fix | Delete
[423] Fix | Delete
if Module.method(:const_defined?).arity == -1
[424] Fix | Delete
def known_class?(target_class, class_name)
[425] Fix | Delete
class_name and
[426] Fix | Delete
(target_class.const_defined?(class_name, false) or
[427] Fix | Delete
target_class.constants.include?(class_name.to_sym))
[428] Fix | Delete
end
[429] Fix | Delete
else
[430] Fix | Delete
def known_class?(target_class, class_name)
[431] Fix | Delete
class_name and
[432] Fix | Delete
(target_class.const_defined?(class_name) or
[433] Fix | Delete
target_class.constants.include?(class_name))
[434] Fix | Delete
end
[435] Fix | Delete
end
[436] Fix | Delete
[437] Fix | Delete
NAMESPLIT = /^(?:([\w:][-\w.]*):)?([\w:][-\w.]*)/
[438] Fix | Delete
def split_name(name)
[439] Fix | Delete
name =~ NAMESPLIT
[440] Fix | Delete
[$1 || '', $2]
[441] Fix | Delete
end
[442] Fix | Delete
[443] Fix | Delete
def check_ns(tag_name, prefix, ns, require_uri, ignore_unknown_element=nil)
[444] Fix | Delete
if _ns(ns, prefix) == require_uri
[445] Fix | Delete
true
[446] Fix | Delete
else
[447] Fix | Delete
if ignore_unknown_element.nil?
[448] Fix | Delete
ignore_unknown_element = @ignore_unknown_element
[449] Fix | Delete
end
[450] Fix | Delete
[451] Fix | Delete
if ignore_unknown_element
[452] Fix | Delete
false
[453] Fix | Delete
elsif @do_validate
[454] Fix | Delete
raise NSError.new(tag_name, prefix, require_uri)
[455] Fix | Delete
else
[456] Fix | Delete
# Force bind required URI with prefix
[457] Fix | Delete
@ns_stack.last[prefix] = require_uri
[458] Fix | Delete
true
[459] Fix | Delete
end
[460] Fix | Delete
end
[461] Fix | Delete
end
[462] Fix | Delete
[463] Fix | Delete
def start_get_text_element(tag_name, prefix, ns, required_uri)
[464] Fix | Delete
pr = Proc.new do |text, tags|
[465] Fix | Delete
setter = self.class.setter(required_uri, tag_name)
[466] Fix | Delete
if setter and @last_element.respond_to?(setter)
[467] Fix | Delete
if @do_validate
[468] Fix | Delete
getter = self.class.getter(required_uri, tag_name)
[469] Fix | Delete
if @last_element.__send__(getter)
[470] Fix | Delete
raise TooMuchTagError.new(tag_name, @last_element.tag_name)
[471] Fix | Delete
end
[472] Fix | Delete
end
[473] Fix | Delete
@last_element.__send__(setter, text.to_s)
[474] Fix | Delete
else
[475] Fix | Delete
if @do_validate and !@ignore_unknown_element
[476] Fix | Delete
raise NotExpectedTagError.new(tag_name, _ns(ns, prefix),
[477] Fix | Delete
@last_element.tag_name)
[478] Fix | Delete
end
[479] Fix | Delete
end
[480] Fix | Delete
end
[481] Fix | Delete
@proc_stack.push(pr)
[482] Fix | Delete
end
[483] Fix | Delete
[484] Fix | Delete
def start_have_something_element(tag_name, prefix, attrs, ns, klass)
[485] Fix | Delete
if check_ns(tag_name, prefix, ns, klass.required_uri)
[486] Fix | Delete
attributes = collect_attributes(tag_name, prefix, attrs, ns, klass)
[487] Fix | Delete
@proc_stack.push(setup_next_element(tag_name, klass, attributes))
[488] Fix | Delete
else
[489] Fix | Delete
@proc_stack.push(setup_next_element_in_unknown_element)
[490] Fix | Delete
end
[491] Fix | Delete
end
[492] Fix | Delete
[493] Fix | Delete
def collect_attributes(tag_name, prefix, attrs, ns, klass)
[494] Fix | Delete
attributes = {}
[495] Fix | Delete
klass.get_attributes.each do |a_name, a_uri, required, element_name|
[496] Fix | Delete
if a_uri.is_a?(String) or !a_uri.respond_to?(:include?)
[497] Fix | Delete
a_uri = [a_uri]
[498] Fix | Delete
end
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function