rubysl-rss 1.0.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,10 +11,7 @@ module RSS
11
11
  plural_name ||= "#{name}s"
12
12
  full_name = "#{RSS::DC_PREFIX}_#{name}"
13
13
  full_plural_name = "#{RSS::DC_PREFIX}_#{plural_name}"
14
- klass_name = Utils.to_class_name(name)
15
14
  plural_klass_name = "DublinCore#{Utils.to_class_name(plural_name)}"
16
- full_plural_klass_name = "self.class::#{plural_klass_name}"
17
- full_klass_name = "#{full_plural_klass_name}::#{klass_name}"
18
15
  klass.def_classed_elements(full_name, "value", plural_klass_name,
19
16
  full_plural_name, name)
20
17
  klass.module_eval(<<-EOC, __FILE__, __LINE__ + 1)
@@ -90,7 +87,7 @@ EOC
90
87
  class ChannelBase
91
88
  include DublinCoreModel
92
89
  end
93
-
90
+
94
91
  class ImageBase; include DublinCoreModel; end
95
92
  class ItemsBase
96
93
  class ItemBase
@@ -99,7 +99,7 @@ module RSS
99
99
  end
100
100
  end
101
101
 
102
- def _set_default_values(&block)
102
+ def _set_default_values
103
103
  keep = {
104
104
  :authors => authors.to_a.dup,
105
105
  :contributors => contributors.to_a.dup,
@@ -126,7 +126,7 @@ module RSS
126
126
  @maker.channel.title {|t| @title = t}
127
127
  end
128
128
  self.updated ||= @maker.channel.updated
129
- super(&block)
129
+ super
130
130
  ensure
131
131
  authors.replace(keep[:authors])
132
132
  contributors.replace(keep[:contributors])
@@ -135,7 +135,7 @@ module RSS
135
135
  self.id = keep[:id]
136
136
  @rights = keep[:rights]
137
137
  @title = keep[:title]
138
- self.updated = keep[:prev_updated]
138
+ self.updated = keep[:updated]
139
139
  end
140
140
 
141
141
  Guid = Feed::Items::Item::Guid
@@ -22,6 +22,8 @@ module RSS
22
22
  end
23
23
 
24
24
  class Channel < ChannelBase
25
+ include SetupDefaultLanguage
26
+
25
27
  def to_feed(feed)
26
28
  set_default_values do
27
29
  setup_values(feed)
@@ -71,14 +73,11 @@ module RSS
71
73
  def _set_default_values(&block)
72
74
  keep = {
73
75
  :id => id,
74
- :updated => updated,
75
76
  }
76
77
  self.id ||= about
77
- self.updated ||= dc_date
78
78
  super(&block)
79
79
  ensure
80
80
  self.id = keep[:id]
81
- self.updated = keep[:updated]
82
81
  end
83
82
 
84
83
  class SkipDays < SkipDaysBase
@@ -182,6 +181,7 @@ module RSS
182
181
  set_default_values do
183
182
  entry = feed.class::Entry.new
184
183
  set = setup_values(entry)
184
+ entry.dc_dates.clear
185
185
  setup_other_elements(feed, entry)
186
186
  if set
187
187
  feed.entries << entry
@@ -216,14 +216,11 @@ module RSS
216
216
  def _set_default_values(&block)
217
217
  keep = {
218
218
  :id => id,
219
- :updated => updated,
220
219
  }
221
220
  self.id ||= link
222
- self.updated ||= dc_date
223
221
  super(&block)
224
222
  ensure
225
223
  self.id = keep[:id]
226
- self.updated = keep[:updated]
227
224
  end
228
225
 
229
226
  class Guid < GuidBase
@@ -13,7 +13,7 @@ module RSS
13
13
  end
14
14
 
15
15
  def self.install_image_item(klass)
16
- klass.module_eval(<<-EOC, __FILE__, __LINE__ + 1)
16
+ klass.module_eval(<<-EOC, __FILE__, __LINE__ + 1)
17
17
  class ImageItem < ImageItemBase
18
18
  DublinCoreModel.install_dublin_core(self)
19
19
  end
@@ -57,7 +57,7 @@ EOC
57
57
  end
58
58
 
59
59
  def self.install_image_favicon(klass)
60
- klass.module_eval(<<-EOC, __FILE__, __LINE__ + 1)
60
+ klass.module_eval(<<-EOC, __FILE__, __LINE__ + 1)
61
61
  class ImageFavicon < ImageFaviconBase
62
62
  DublinCoreModel.install_dublin_core(self)
63
63
  end
@@ -89,7 +89,7 @@ EOC
89
89
  end
90
90
 
91
91
  class ChannelBase; include Maker::ImageFaviconModel; end
92
-
92
+
93
93
  class ItemsBase
94
94
  class ItemBase; include Maker::ImageItemModel; end
95
95
  end
@@ -176,7 +176,7 @@ module RSS
176
176
 
177
177
  %w(hour minute second).each do |name|
178
178
  attr_reader(name)
179
- add_need_initialize_variable(name, '0')
179
+ add_need_initialize_variable(name, 0)
180
180
  end
181
181
 
182
182
  def content=(content)
@@ -72,12 +72,12 @@ EOC
72
72
  class TaxonomyTopicBase < Base
73
73
  include DublinCoreModel
74
74
  include TaxonomyTopicsModel
75
-
75
+
76
76
  attr_accessor :value
77
77
  add_need_initialize_variable("value")
78
78
  alias_method(:taxo_link, :value)
79
79
  alias_method(:taxo_link=, :value=)
80
-
80
+
81
81
  def have_required_values?
82
82
  @value
83
83
  end
@@ -88,11 +88,11 @@ EOC
88
88
  class RSSBase
89
89
  include TaxonomyTopicModel
90
90
  end
91
-
91
+
92
92
  class ChannelBase
93
93
  include TaxonomyTopicsModel
94
94
  end
95
-
95
+
96
96
  class ItemsBase
97
97
  class ItemBase
98
98
  include TaxonomyTopicsModel
@@ -19,7 +19,7 @@ module RSS
19
19
  class TrackBackAboutBase < Base
20
20
  attr_accessor :value
21
21
  add_need_initialize_variable("value")
22
-
22
+
23
23
  alias_method(:resource, :value)
24
24
  alias_method(:resource=, :value=)
25
25
  alias_method(:content, :value)
@@ -34,8 +34,8 @@ module RSS
34
34
  class NotValidXMLParser < Error
35
35
  def initialize(parser)
36
36
  super("#{parser} is not an available XML parser. " <<
37
- "Available XML parser"<<
38
- (AVAILABLE_PARSERS.size > 1 ? "s are ": " is ") <<
37
+ "Available XML parser" <<
38
+ (AVAILABLE_PARSERS.size > 1 ? "s are " : " is ") <<
39
39
  "#{AVAILABLE_PARSERS.inspect}.")
40
40
  end
41
41
  end
@@ -98,7 +98,7 @@ module RSS
98
98
  return rss if maybe_xml?(rss)
99
99
 
100
100
  uri = to_uri(rss)
101
-
101
+
102
102
  if uri.respond_to?(:read)
103
103
  uri.read
104
104
  elsif !rss.tainted? and File.readable?(rss)
@@ -113,7 +113,7 @@ module RSS
113
113
  source.is_a?(String) and /</ =~ source
114
114
  end
115
115
 
116
- # Attempt to convert rss to a URI, but just return it if
116
+ # Attempt to convert rss to a URI, but just return it if
117
117
  # there's a ::URI::Error
118
118
  def to_uri(rss)
119
119
  return rss if rss.is_a?(::URI::Generic)
@@ -133,7 +133,7 @@ module RSS
133
133
  listener.raise_for_undefined_entity?
134
134
  end
135
135
  end
136
-
136
+
137
137
  def initialize(rss)
138
138
  @listener = self.class.listener.new
139
139
  @rss = rss
@@ -196,13 +196,13 @@ module RSS
196
196
  def available_tags(uri)
197
197
  (@@accessor_bases[uri] || {}).keys
198
198
  end
199
-
199
+
200
200
  # register uri against this name.
201
201
  def register_uri(uri, name)
202
202
  @@registered_uris[name] ||= {}
203
203
  @@registered_uris[name][uri] = nil
204
204
  end
205
-
205
+
206
206
  # test if this uri is registered against this name
207
207
  def uri_registered?(uri, name)
208
208
  @@registered_uris[name].has_key?(uri)
@@ -220,9 +220,7 @@ module RSS
220
220
  name = (@@class_names[uri] || {})[tag_name]
221
221
  return name if name
222
222
 
223
- tag_name = tag_name.gsub(/[_\-]([a-z]?)/) do
224
- $1.upcase
225
- end
223
+ tag_name = tag_name.gsub(/[_\-]([a-z]?)/) {$1.upcase}
226
224
  tag_name[0, 1].upcase + tag_name[1..-1]
227
225
  end
228
226
 
@@ -230,11 +228,11 @@ module RSS
230
228
  install_accessor_base(uri, name, accessor_base)
231
229
  def_get_text_element(uri, name, *get_file_and_line_from_caller(1))
232
230
  end
233
-
231
+
234
232
  def raise_for_undefined_entity?
235
233
  true
236
234
  end
237
-
235
+
238
236
  private
239
237
  # set the accessor for the uri, tag_name pair
240
238
  def install_accessor_base(uri, tag_name, accessor_base)
@@ -281,7 +279,7 @@ module RSS
281
279
  @xml_element = nil
282
280
  @last_xml_element = nil
283
281
  end
284
-
282
+
285
283
  # set instance vars for version, encoding, standalone
286
284
  def xmldecl(version, encoding, standalone)
287
285
  @version, @encoding, @standalone = version, encoding, standalone
@@ -303,7 +301,7 @@ module RSS
303
301
  attrs = {}
304
302
  attributes.each do |n, v|
305
303
  if /\Axmlns(?:\z|:)/ =~ n
306
- ns[$'] = v
304
+ ns[$POSTMATCH] = v
307
305
  else
308
306
  attrs[n] = v
309
307
  end
@@ -389,14 +387,12 @@ module RSS
389
387
  def start_else_element(local, prefix, attrs, ns)
390
388
  class_name = self.class.class_name(_ns(ns, prefix), local)
391
389
  current_class = @last_element.class
392
- if class_name and
393
- (current_class.const_defined?(class_name) or
394
- current_class.constants.include?(class_name))
390
+ if known_class?(current_class, class_name)
395
391
  next_class = current_class.const_get(class_name)
396
392
  start_have_something_element(local, prefix, attrs, ns, next_class)
397
393
  else
398
394
  if !@do_validate or @ignore_unknown_element
399
- @proc_stack.push(nil)
395
+ @proc_stack.push(setup_next_element_in_unknown_element)
400
396
  else
401
397
  parent = "ROOT ELEMENT???"
402
398
  if current_class.tag_name
@@ -407,19 +403,42 @@ module RSS
407
403
  end
408
404
  end
409
405
 
410
- NAMESPLIT = /^(?:([\w:][-\w\d.]*):)?([\w:][-\w\d.]*)/
406
+ if Module.method(:const_defined?).arity == -1
407
+ def known_class?(target_class, class_name)
408
+ class_name and
409
+ (target_class.const_defined?(class_name, false) or
410
+ target_class.constants.include?(class_name.to_sym))
411
+ end
412
+ else
413
+ def known_class?(target_class, class_name)
414
+ class_name and
415
+ (target_class.const_defined?(class_name) or
416
+ target_class.constants.include?(class_name))
417
+ end
418
+ end
419
+
420
+ NAMESPLIT = /^(?:([\w:][-\w.]*):)?([\w:][-\w.]*)/
411
421
  def split_name(name)
412
422
  name =~ NAMESPLIT
413
423
  [$1 || '', $2]
414
424
  end
415
425
 
416
- def check_ns(tag_name, prefix, ns, require_uri)
417
- unless _ns(ns, prefix) == require_uri
418
- if @do_validate
426
+ def check_ns(tag_name, prefix, ns, require_uri, ignore_unknown_element=nil)
427
+ if _ns(ns, prefix) == require_uri
428
+ true
429
+ else
430
+ if ignore_unknown_element.nil?
431
+ ignore_unknown_element = @ignore_unknown_element
432
+ end
433
+
434
+ if ignore_unknown_element
435
+ false
436
+ elsif @do_validate
419
437
  raise NSError.new(tag_name, prefix, require_uri)
420
438
  else
421
439
  # Force bind required URI with prefix
422
440
  @ns_stack.last[prefix] = require_uri
441
+ true
423
442
  end
424
443
  end
425
444
  end
@@ -427,7 +446,7 @@ module RSS
427
446
  def start_get_text_element(tag_name, prefix, ns, required_uri)
428
447
  pr = Proc.new do |text, tags|
429
448
  setter = self.class.setter(required_uri, tag_name)
430
- if @last_element.respond_to?(setter)
449
+ if setter and @last_element.respond_to?(setter)
431
450
  if @do_validate
432
451
  getter = self.class.getter(required_uri, tag_name)
433
452
  if @last_element.__send__(getter)
@@ -446,9 +465,12 @@ module RSS
446
465
  end
447
466
 
448
467
  def start_have_something_element(tag_name, prefix, attrs, ns, klass)
449
- check_ns(tag_name, prefix, ns, klass.required_uri)
450
- attributes = collect_attributes(tag_name, prefix, attrs, ns, klass)
451
- @proc_stack.push(setup_next_element(tag_name, klass, attributes))
468
+ if check_ns(tag_name, prefix, ns, klass.required_uri)
469
+ attributes = collect_attributes(tag_name, prefix, attrs, ns, klass)
470
+ @proc_stack.push(setup_next_element(tag_name, klass, attributes))
471
+ else
472
+ @proc_stack.push(setup_next_element_in_unknown_element)
473
+ end
452
474
  end
453
475
 
454
476
  def collect_attributes(tag_name, prefix, attrs, ns, klass)
@@ -504,7 +526,7 @@ module RSS
504
526
  else
505
527
  if klass.have_content?
506
528
  if @last_element.need_base64_encode?
507
- text = Base64.decode64(text.lstrip)
529
+ text = text.lstrip.unpack("m").first
508
530
  end
509
531
  @last_element.content = text
510
532
  end
@@ -515,6 +537,11 @@ module RSS
515
537
  @last_element = previous
516
538
  end
517
539
  end
540
+
541
+ def setup_next_element_in_unknown_element
542
+ current_element, @last_element = @last_element, nil
543
+ Proc.new {@last_element = current_element}
544
+ end
518
545
  end
519
546
 
520
547
  unless const_defined? :AVAILABLE_PARSER_LIBRARIES
@@ -7,7 +7,7 @@ if ([$1.to_i, $2.to_i] <=> [2, 5]) < 0
7
7
  end
8
8
 
9
9
  module RSS
10
-
10
+
11
11
  class REXMLParser < BaseParser
12
12
 
13
13
  class << self
@@ -15,7 +15,7 @@ module RSS
15
15
  REXMLListener
16
16
  end
17
17
  end
18
-
18
+
19
19
  private
20
20
  def _parse
21
21
  begin
@@ -28,9 +28,9 @@ module RSS
28
28
  raise NotWellFormedError.new(line){e.message}
29
29
  end
30
30
  end
31
-
31
+
32
32
  end
33
-
33
+
34
34
  class REXMLListener < BaseListener
35
35
 
36
36
  include REXML::StreamListener
@@ -41,7 +41,7 @@ module RSS
41
41
  false
42
42
  end
43
43
  end
44
-
44
+
45
45
  def xmldecl(version, encoding, standalone)
46
46
  super(version, encoding, standalone == "yes")
47
47
  # Encoding is converted to UTF-8 when REXML parse XML.
@@ -45,6 +45,7 @@ class Time
45
45
  end
46
46
  end
47
47
 
48
+
48
49
  require "English"
49
50
  require "rss/utils"
50
51
  require "rss/converter"
@@ -52,7 +53,7 @@ require "rss/xml-stylesheet"
52
53
 
53
54
  module RSS
54
55
 
55
- VERSION = "0.2.4"
56
+ VERSION = "0.2.7"
56
57
 
57
58
  URI = "http://purl.org/rss/1.0/"
58
59
 
@@ -69,6 +70,9 @@ module RSS
69
70
 
70
71
  class InvalidRSSError < Error; end
71
72
 
73
+ ##
74
+ # Raised if no matching tag is found.
75
+
72
76
  class MissingTagError < InvalidRSSError
73
77
  attr_reader :tag, :parent
74
78
  def initialize(tag, parent)
@@ -77,6 +81,9 @@ module RSS
77
81
  end
78
82
  end
79
83
 
84
+ ##
85
+ # Raised if there are more occurrences of the tag than expected.
86
+
80
87
  class TooMuchTagError < InvalidRSSError
81
88
  attr_reader :tag, :parent
82
89
  def initialize(tag, parent)
@@ -85,6 +92,9 @@ module RSS
85
92
  end
86
93
  end
87
94
 
95
+ ##
96
+ # Raised if a required attribute is missing.
97
+
88
98
  class MissingAttributeError < InvalidRSSError
89
99
  attr_reader :tag, :attribute
90
100
  def initialize(tag, attribute)
@@ -93,6 +103,9 @@ module RSS
93
103
  end
94
104
  end
95
105
 
106
+ ##
107
+ # Raised when an unknown tag is found.
108
+
96
109
  class UnknownTagError < InvalidRSSError
97
110
  attr_reader :tag, :uri
98
111
  def initialize(tag, uri)
@@ -101,6 +114,9 @@ module RSS
101
114
  end
102
115
  end
103
116
 
117
+ ##
118
+ # Raised when an unexpected tag is encountered.
119
+
104
120
  class NotExpectedTagError < InvalidRSSError
105
121
  attr_reader :tag, :uri, :parent
106
122
  def initialize(tag, uri, parent)
@@ -111,6 +127,9 @@ module RSS
111
127
  # For backward compatibility :X
112
128
  NotExceptedTagError = NotExpectedTagError
113
129
 
130
+ ##
131
+ # Raised when an incorrect value is used.
132
+
114
133
  class NotAvailableValueError < InvalidRSSError
115
134
  attr_reader :tag, :value, :attribute
116
135
  def initialize(tag, value, attribute=nil)
@@ -122,6 +141,9 @@ module RSS
122
141
  end
123
142
  end
124
143
 
144
+ ##
145
+ # Raised when an unknown conversion error occurs.
146
+
125
147
  class UnknownConversionMethodError < Error
126
148
  attr_reader :to, :from
127
149
  def initialize(to, from)
@@ -133,6 +155,9 @@ module RSS
133
155
  # for backward compatibility
134
156
  UnknownConvertMethod = UnknownConversionMethodError
135
157
 
158
+ ##
159
+ # Raised when a conversion failure occurs.
160
+
136
161
  class ConversionError < Error
137
162
  attr_reader :string, :to, :from
138
163
  def initialize(string, to, from)
@@ -143,6 +168,9 @@ module RSS
143
168
  end
144
169
  end
145
170
 
171
+ ##
172
+ # Raised when a required variable is not set.
173
+
146
174
  class NotSetError < Error
147
175
  attr_reader :name, :variables
148
176
  def initialize(name, variables)
@@ -152,6 +180,9 @@ module RSS
152
180
  end
153
181
  end
154
182
 
183
+ ##
184
+ # Raised when a RSS::Maker attempts to use an unknown maker.
185
+
155
186
  class UnsupportedMakerVersionError < Error
156
187
  attr_reader :version
157
188
  def initialize(version)
@@ -228,7 +259,7 @@ EOC
228
259
  else
229
260
  rv << value
230
261
  end
231
- rv << "</#{elem_name}>"
262
+ rv << "</#{elem_name}>"
232
263
  rv
233
264
  else
234
265
  ''
@@ -248,7 +279,7 @@ EOC
248
279
  # accessor
249
280
  convert_attr_reader name
250
281
  date_writer(name, type, disp_name)
251
-
282
+
252
283
  install_element(name) do |n, elem_name|
253
284
  <<-EOC
254
285
  if @#{n}
@@ -259,7 +290,7 @@ EOC
259
290
  else
260
291
  rv << value
261
292
  end
262
- rv << "</#{elem_name}>"
293
+ rv << "</#{elem_name}>"
263
294
  rv
264
295
  else
265
296
  ''
@@ -633,7 +664,7 @@ EOC
633
664
  include SetupMaker
634
665
 
635
666
  INDENT = " "
636
-
667
+
637
668
  MUST_CALL_VALIDATORS = {}
638
669
  MODELS = []
639
670
  GET_ATTRIBUTES = []
@@ -670,18 +701,18 @@ EOC
670
701
  end
671
702
 
672
703
  def inherited(klass)
673
- klass.const_set("MUST_CALL_VALIDATORS", {})
674
- klass.const_set("MODELS", [])
675
- klass.const_set("GET_ATTRIBUTES", [])
676
- klass.const_set("HAVE_CHILDREN_ELEMENTS", [])
677
- klass.const_set("TO_ELEMENT_METHODS", [])
678
- klass.const_set("NEED_INITIALIZE_VARIABLES", [])
679
- klass.const_set("PLURAL_FORMS", {})
704
+ klass.const_set(:MUST_CALL_VALIDATORS, {})
705
+ klass.const_set(:MODELS, [])
706
+ klass.const_set(:GET_ATTRIBUTES, [])
707
+ klass.const_set(:HAVE_CHILDREN_ELEMENTS, [])
708
+ klass.const_set(:TO_ELEMENT_METHODS, [])
709
+ klass.const_set(:NEED_INITIALIZE_VARIABLES, [])
710
+ klass.const_set(:PLURAL_FORMS, {})
680
711
 
681
712
  tag_name = klass.name.split(/::/).last
682
713
  tag_name[0, 1] = tag_name[0, 1].downcase
683
- klass.instance_variable_set("@tag_name", tag_name)
684
- klass.instance_variable_set("@have_content", false)
714
+ klass.instance_variable_set(:@tag_name, tag_name)
715
+ klass.instance_variable_set(:@have_content, false)
685
716
  end
686
717
 
687
718
  def install_must_call_validator(prefix, uri)
@@ -706,7 +737,7 @@ EOC
706
737
  def_corresponded_attr_writer name, writer_type, disp_name
707
738
  def_corresponded_attr_reader name, reader_type
708
739
  if type == :boolean and /^is/ =~ name
709
- alias_method "#{$'}?", name
740
+ alias_method "#{$POSTMATCH}?", name
710
741
  end
711
742
  self::GET_ATTRIBUTES << [name, uri, required, element_name]
712
743
  add_need_initialize_variable(disp_name)
@@ -829,7 +860,7 @@ EOC
829
860
  def full_name
830
861
  tag_name
831
862
  end
832
-
863
+
833
864
  def converter=(converter)
834
865
  @converter = converter
835
866
  targets = children.dup
@@ -864,7 +895,7 @@ EOC
864
895
  ensure
865
896
  @do_validate = do_validate
866
897
  end
867
-
898
+
868
899
  def validate_for_stream(tags, ignore_unknown_element=true)
869
900
  validate_attribute
870
901
  __validate(ignore_unknown_element, tags, false)
@@ -984,7 +1015,7 @@ EOC
984
1015
  end_tag = "\n#{indent}</#{full_name}>"
985
1016
  end
986
1017
  end
987
-
1018
+
988
1019
  start_tag + content.join("\n") + end_tag
989
1020
  end
990
1021
 
@@ -1009,7 +1040,7 @@ EOC
1009
1040
  end
1010
1041
  attrs
1011
1042
  end
1012
-
1043
+
1013
1044
  def tag_name_with_prefix(prefix)
1014
1045
  "#{prefix}:#{tag_name}"
1015
1046
  end
@@ -1092,9 +1123,8 @@ EOC
1092
1123
  tags = tags.sort_by {|x| element_names.index(x) || tags_size}
1093
1124
  end
1094
1125
 
1095
- _tags = tags.dup if tags
1096
1126
  models.each_with_index do |model, i|
1097
- name, model_uri, occurs, getter = model
1127
+ name, _, occurs, = model
1098
1128
 
1099
1129
  if DEBUG
1100
1130
  p "before"
@@ -1200,7 +1230,7 @@ EOC
1200
1230
  __send__(self.class.xml_getter).to_s
1201
1231
  else
1202
1232
  _content = content
1203
- _content = Base64.encode64(_content) if need_base64_encode?
1233
+ _content = [_content].pack("m").delete("\n") if need_base64_encode?
1204
1234
  h(_content)
1205
1235
  end
1206
1236
  end
@@ -1209,7 +1239,7 @@ EOC
1209
1239
  module RootElementMixin
1210
1240
 
1211
1241
  include XMLStyleSheetMixin
1212
-
1242
+
1213
1243
  attr_reader :output_encoding
1214
1244
  attr_reader :feed_type, :feed_subtype, :feed_version
1215
1245
  attr_accessor :version, :encoding, :standalone
@@ -1295,7 +1325,7 @@ EOC
1295
1325
  rv << "?>\n"
1296
1326
  rv
1297
1327
  end
1298
-
1328
+
1299
1329
  def ns_declarations
1300
1330
  decls = {}
1301
1331
  self.class::NSPOOL.collect do |prefix, uri|