Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
require 'rexml/document' include REXML file = DATA.read doc = Document.new(file) aTime = Array.new aDuration = Array.new aComments = Array.new doc.elements.each("PremiereData/Marker/Time") { |node| aTime << node } doc.elements.each("PremiereData/Marker/Comments") { |node| aDuration << node } doc.elements.each("PremiereData/Marker/Duration") { |node| aComments << node } aTime.each { |e| puts e.get_text } aDuration.each { |e| puts e.get_text } aComments.each { |e| puts e.get_text } __END__ <PremiereData> <Marker ObjectID="58" ClassID="...." Version="2"> <Name>some node</Name> <Node Version="1"> </Node> <Time>3810240000000</Time> <Comments>1st Point</Comments> <Duration>10160640000</Duration> </Marker> </PremiereData>
This paste will be private.
From the Design Piracy series on my blog: