Permalink
Browse files

SyndicatedPostXPathQuery / rewrite this so that there's some real par…

…sing going on with the path; allow square-bracket notation; currently only works with numbers, but should be expandable.
  • Loading branch information...
Rad Geek
Rad Geek committed Apr 20, 2016
1 parent bc16971 commit 456ad816053b2e7cfb6eb9c43671c8cb00397cc4
Showing with 281 additions and 68 deletions.
  1. +12 −4 syndicatedpost.class.php
  2. +269 −64 syndicatedpostxpathquery.class.php
View
@@ -293,14 +293,22 @@ function substitution_function ($name) {
function query ($path) {
$xq = new SyndicatedPostXPathQuery(array("path" => $path));
- /*DBG*/ //echo "DATA: ".MyPHP::val($this->entry->data);
+ $feedChannel = array_merge(
+ $this->get_feed_root_element(),
+ $this->get_feed_channel_elements()
+ );
$matches = $xq->match(array(
"type" => $this->link->simplepie->get_type(),
"xmlns" => $this->xmlns,
- "entry" => $this->entry->data,
- "feed" => $this->get_feed_root_element(),
- "channel" => $this->get_feed_channel_elements(),
+ "map" => array(
+ "/" => array($this->entry->data),
+ "item" => array($this->entry->data),
+ "feed" => $feedChannel,
+ "channel" => $feedChannel
+ ),
+ "context" => $this->entry->data,
+ "parent" => $feedChannel,
));
return $matches;
Oops, something went wrong.

0 comments on commit 456ad81

Please sign in to comment.