Count the no of elements in an XML node
require 'rexml/document' include REXML file = File.new('test.xml') doc = Document.new(file) puts doc.root.elements.to_a.length
DZone Snippets > jrobertson > count
11380 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
James Robertson http://www.r0bertson.co.uk
require 'rexml/document' include REXML file = File.new('test.xml') doc = Document.new(file) puts doc.root.elements.to_a.length