B
beikel.meikel
Hi,
I'm using REXML::StreamListener to analyze a big xml file. My ruby
code looks like this:
--- code start here ---
require 'rexml/document'
require 'rexml/streamlistener'
class MyListener
include REXML::StreamListener
def tag_start(name, attrs)
# anything to do ...
end
def text(text)
# anything to do ...
end
end
REXML:
ocument.parse_stream( File.open( xmlfile), MyListener.new)
--- code ends here ---
At the "tag_start" method I need sometimes the information where I am
in the xml. What is my parent tag and so on. Is there is a method to
get this information at this time?
Regards
Michael
I'm using REXML::StreamListener to analyze a big xml file. My ruby
code looks like this:
--- code start here ---
require 'rexml/document'
require 'rexml/streamlistener'
class MyListener
include REXML::StreamListener
def tag_start(name, attrs)
# anything to do ...
end
def text(text)
# anything to do ...
end
end
REXML:
--- code ends here ---
At the "tag_start" method I need sometimes the information where I am
in the xml. What is my parent tag and so on. Is there is a method to
get this information at this time?
Regards
Michael