I have created a simple parser. i have used @tag method to store tag
start and tag end. my requirement is how to read attributes and its
values when it has more than one attributes like,
This is the input string,
<aaa size="100" name="xxx"></aaa>
I need output like
tag start : aaa
attribute name: size
attribute value : 100
attribute name : name
attribute value : size
tag end : aaa
i have read character by character and i have executed tag start and tag
end.
i have read attribute naes and values also but my program actually not
displaying it properly like my output is
tag start : aaa
attribute name : name
attribute value : size
tag end : aaa
my program is actually rewritting the old ones. i have used @tag to
store tag start and tag end and i have called thosed using if
block_given? method. i have used parse_attribute, parse_attribute_value
method to read attribute names and values. How tyo make it work properly
when multiple atrribute names and values are given.
Thanks in advance
--
Posted via http://www.ruby-forum.com/.
I am not really sure what you are asking here but in case you are
parsing XML: did you consider using an XML parser, for example REXML in
stream mode?
robert
Answer here:
http://groups.google.com/group/comp.lang.ruby/browse_frm/thread/87b5fb008b22b453/22fe3736ee69efbf
I suggest you stop using ruby-forum until it is fixed, and instead use
another source that lets you see the answers people are providing.
Sorry Gavin.
Did you actually *read* and *understand* Gavin's message? His was an
attempt at helping you getting better feedback.
robert
--
use.inject do |as, often| as.you_can - without end
sorry......
lets continue our discussion
Actually robert i was not supposed to use REXML or any other inbuilt
classes in my task.
Robert Klemme wrote:
> 2007/12/13, dare ruby <mar...@angleritech.com>:
>> sorry Gavin, please if you are not intrested in topic please dont reply.
>> iam new to ruby so i should do what ever i can do to complete my task.so
>> iam looking for all the sources to perform well.
>
> Did you actually *read* and *understand* Gavin's message? His was an
> attempt at helping you getting better feedback.
>
> robert
--
Posted via http://www.ruby-forum.com/.
Then you should show some code you have issues with. With the bits
you provided nobody can really come up with an answer.