Using if block_given? method

Hi everybody,

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,

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

dare ruby wrote:

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,
[snip]

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.

On 12.12.2007 04:44, dare ruby wrote:

displaying it properly like my output is
when multiple atrribute names and values are given.
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

sorry robert and gavin…

sorry…

lets continue our discussion

Actually robert i was not supposed to use REXML or any other inbuilt
classes in my task.

Robert K. wrote:

2007/12/13, dare ruby [email protected]:

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

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.

Sorry Gavin.

2007/12/13, dare ruby [email protected]:

sorry robert and gavin…

sorry…

lets continue our discussion

Actually robert i was not supposed to use REXML or any other inbuilt
classes in my task.

Then you should show some code you have issues with. With the bits
you provided nobody can really come up with an answer.

robert

2007/12/13, dare ruby [email protected]:

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs