Dear Friends,

 i need to implement xpath in my parser class. I have implemented a new
parser which parses xml document. I have used token types to parse xml
like,

  while parser.next

         if parser.token_type == tag_start
            parser.tag
         end

         if parser.token_type == tag_end
            parser.tag_end
         end
    end

 so a token_type method returns token types like tag_start, tag_end,
comment, pi etc and tag method returns the tag start and tag_end method
returns the tag end of an xml document.

now i need to implement xpath in my parser class. I need to navigate the
xml document using xpath like,

   while parser.next!

  parser.path( 'book/book-name' ) do

  end

    end

could anyone help me with some solution to implement xpath in my parser
class.I don't want to use REXML or HPRICOT. i want to create my own
methods which does the above.

Thanks in advance

Regards,
Martin
-- 
Posted via http://www.ruby-forum.com/.