function FeedsXPathParserQueryParser::handle_word in Feeds XPath Parser 6
Same name and namespace in other branches
- 7 FeedsXPathParserQueryParser.inc \FeedsXPathParserQueryParser::handle_word()
3 calls to FeedsXPathParserQueryParser::handle_word()
File
- ./
FeedsXPathParserQueryParser.inc, line 88 - Pseudo-parser of XPath queries. When an XML document has a default namespace this gets called so that adding the __default__ namepace where appropriate. Aren't we nice?
Class
- FeedsXPathParserQueryParser
- @file Pseudo-parser of XPath queries. When an XML document has a default namespace this gets called so that adding the __default__ namepace where appropriate. Aren't we nice?
Code
function handle_word($c = '') {
if ($this->word == '') {
return;
}
if ($c == ':' && drupal_substr($this->query, $this->i + 1, 1) == ':') {
$this->axis = $this->word;
}
if ($c == ':' && drupal_substr($this->query, $this->i - 1, 1) != ':' && drupal_substr($this->query, $this->i + 1, 1) != ':') {
$this->output .= $this->word;
$this->skip_next_word = TRUE;
return;
}
if ($this->skip_next_word) {
$this->skip_next_word = FALSE;
$this->output .= $this->word;
return;
}
if (is_numeric($this->word) || $this->axis == 'attribute' || strpos($this->word, '@') === 0 || $c == '(' || $c == ':') {
$this->output .= $this->word;
return;
}
$this->output .= '__default__:' . $this->word;
}