forked from SketchUpCMS/SketchUpCMS
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathxmlRepeat.rb
More file actions
executable file
·39 lines (30 loc) · 904 Bytes
/
Copy pathxmlRepeat.rb
File metadata and controls
executable file
·39 lines (30 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env ruby
# Tai Sakuma <sakuma@fnal.gov>
require "rexml/document"
require "rexml/streamlistener"
##____________________________________________________________________________||
class DDLCallbacks
include REXML::StreamListener
attr_accessor :listenersDispatcher
def tag_start(name, attributes)
print "tag_start\n"
print ' name = "', name, "\"\n"
print ' attributes = ', attributes.inspect, "\n"
end
def text(text)
print "text\n"
print ' text = "', text, "\"\n"
end
def tag_end(name)
print "tag_end\n"
print ' name = "', name, "\"\n"
end
end
##____________________________________________________________________________||
def main
file = 'GeometryTOB.xml'
callBacks = DDLCallbacks.new
REXML::Document.parse_stream(File.new(file), callBacks)
end
##____________________________________________________________________________||
main