Class: XML::Reader

Inherits:
Object
  • Object
show all
Defined in:
lib/index.rb

Overview

Add custom parsing methods to XML::Reader

Instance Method Summary collapse

Instance Method Details

#next_entityObject

Get the next entity node



336
337
338
339
340
341
342
# File 'lib/index.rb', line 336

def next_entity
  # read until an entity node
  while (self.node_type != XML::Reader::TYPE_ENTITY and
    self.node_type != XML::Reader::TYPE_ENTITY_REFERENCE and
    self.read); end
  self.value
end

#next_textObject

Get the next text node



330
331
332
333
334
# File 'lib/index.rb', line 330

def next_text
  # read until a text node
  while (self.node_type != XML::Reader::TYPE_TEXT and self.read); end
  self.value
end