in reply to Re^3: extracting data from HTML
in thread extracting data from HTML

Indeed - it was me who requested this feature, and supplied the patch. Mostly in order to support XML::LibXML::QuerySelector, which extends XML::LibXML to support CSS selectors...

my @important_paragraphs = $xmlnode->querySelectorAll('body p.important');

XML::LibXML::QuerySelector passes the selector on to Corion's module, which returns it an XPath. It then queries XML::LibXML for the XPath, then passes the list of the results through a "descendent of" function to make sure that all returned elements are children of the original $xmlnode.

TL;DR: XML::LibXML::QuerySelector implements W3C Selectors API Level 1 for XML::LibXML.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'