You are here

protected function FeedsExQueryPathXml::validateExpression in Feeds extensible parsers 7

Same name and namespace in other branches
  1. 7.2 src/FeedsExQueryPathXml.inc \FeedsExQueryPathXml::validateExpression()

Validates an expression.

Parameters

string &$expression: The expression to validate.

Return value

string|null Return the error string, or null if validation was passed.

Overrides FeedsExXml::validateExpression

File

src/FeedsExQueryPathXml.inc, line 103
Contains FeedsExXml.

Class

FeedsExQueryPathXml
Parses XML documents with QueryPath.

Code

protected function validateExpression(&$expression) {
  $expression = trim($expression);
  if (!$expression) {
    return;
  }
  try {
    $parser = new QueryPath(NULL, $expression);
  } catch (CSSParseException $e) {
    return check_plain($e
      ->getMessage());
  }
}