Sha256: e9f1805aad652c73270d33fec9e175f06e54fdb07c930038bcaa64533cc0aca9

Contents?: true

Size: 424 Bytes

Versions: 2

Compression:

Stored size: 424 Bytes

Contents

#!/usr/bin/env ruby --profile.flat

$: << 'lib'
require 'vtd/xml'

xml = VTD::Xml.open('spec/fixtures/books.xml')

# Make use of the entire attribute list
node = xml.find('//book').max_by { |node| node.attributes['sold'].to_i }
puts "Max sold was #{node.attributes['sold'].inspect}"

# Make use of the attribute cache
node = xml.find('//book').max_by { |node| node['sold'].to_i }
puts "Max sold was #{node['sold'].inspect}"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vtd-xml-0.0.2-java examples/enumerable.rb
vtd-xml-0.0.1-java examples/enumerable.rb