diff --git a/dev/CSSContentParser.php b/dev/CSSContentParser.php index 718b5c59d..78ff67f0a 100644 --- a/dev/CSSContentParser.php +++ b/dev/CSSContentParser.php @@ -53,16 +53,33 @@ class CSSContentParser extends Object { /** * Returns a number of SimpleXML elements that match the given CSS selector. - * Currently the selector engine only supports querying by tag, id, and classs + * Currently the selector engine only supports querying by tag, id, and class. + * See {@link getByXpath()} for a more direct selector syntax. + * + * @param String $selector + * @return SimpleXMLElement */ function getBySelector($selector) { $xpath = $this->selector2xpath($selector); - return $this->simpleXML->xpath($xpath); + return $this->getByXpath($xpath); } + /** + * Allows querying the content through XPATH selectors. + * + * @param String $xpath SimpleXML compatible XPATH statement + * @return SimpleXMLElement|false + */ + function getByXpath($xpath) { + return $this->simpleXML->xpath($xpath); + } + /** * Converts a CSS selector into an equivalent xpath expression. - * Currently the selector engine only supports querying by tag, id, and classs + * Currently the selector engine only supports querying by tag, id, and class. + * + * @param String $selector See {@link getBySelector()} + * @return String XPath expression */ function selector2xpath($selector) { $parts = preg_split('/\\s+/', $selector); @@ -85,4 +102,5 @@ class CSSContentParser extends Object { return $xpath; } + } \ No newline at end of file