I'm not a dev on the project, but I think you should be opening enhancement tickets so these suggestions don't get lost on the mailing list. -- Kevin
On Tue, Jun 9, 2009 at 2:11 PM, Trans <transf...@gmail.com> wrote: > I'd like to suggest two new methods for LibXML::XML::XPath::Object. > > The first is simply a #to_s method that returns a concat string of all > nodes. Eg. > > xml = XML::Document.string("<r><b>1</b><b>2</b></r>") > bes = xml.find('b') > bes.to_s #=> "<b>1</b><b>2</b>" > > Currently #to_s is the same as #inspect, which isn't useful. > > The second is to add #find, so that we can do sub-searches on the > nodes. Eg. > > xml = XML::Document.string(%{<r><b>1</b><b id="q">2</b></r>}) > bes = xml.find('b') > bes.to_s #=> "<b>1</b><b id=\"q\">2</b>" > qbs = bes.find("[...@id='q']") > qbs.to_s #=> "<b id=\"q\">2</b>" > > Thanks, > Tom > > _______________________________________________ > libxml-devel mailing list > libxml-devel@rubyforge.org > http://rubyforge.org/mailman/listinfo/libxml-devel >
_______________________________________________ libxml-devel mailing list libxml-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/libxml-devel