From: William James Date: 2006-02-21T01:18:31+09:00 Subject: Re: How can I search value from xml Artit Satanakulpanich wrote: > How can i search value from xml file such as I want to find from *pubdate *and > return* **biblioentry > *Please give me some source code for further study* > ** > > "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> > > > > Godfrey > Vesey > > Personal Identity: A Philosophical Analysis > > Cornell University Press > > 1977 > > > > Geoffrey > Madell > > The Identity of the Self > > Edinburgh University Press > > 1981 > > > > Sydney > Shoemaker > > > Richard > Swinburne > > Personal Identity > > Basil Blackwell > > 1984 > > > > Jonathan > Glover > > The Philosophy and Psychology of Personal Identity > > Penguin > > 1988 > class String def xtag(s) scan( %r! ( < #{s} [^>]* > ) ( .*? ) !mx ) end end gets(nil).xtag("biblioentry").each { |tag,data| if data.xtag("pubdate")[0][1] > "1984" print tag, data, "\n" end }