Over a million developers have joined DZone.

Fetching A REXML Element Attribute

·
Source: Modifying a REXML attribute [dzone.com]


require 'rexml/document'
include REXML

doc = Document.new("")
breakfast = doc.root.elements['breakfast']
breakfast_type = breakfast.attribute('type')
puts breakfast_type.value
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}