0

Using XPath in Rename module

I am attempting to use XPath in my pipe: http://pipes.yahoo.com/pipes/pipe.edit?_id=010a4ddc7afe4758c31ac9b464869bbd#a975c9ed063eb859b079adfb53955d6f

It almost works except that for each item it copies the current items matching nodes and any previous item matching nodes.

by
5 Replies
  • Hello,

    I've looked at your pipe, but over the 8 results displayed in the debugger I didn't find any item with several results from the XPath step, simply the 4 span mark ups of the specified p mark up. can you copy and paste here an article's link which produces your result?

    0
  • I have updated the pipe to reflect a little more closely what I am attempting to do. Ultimately I am attempting to capture the miles on the given item(vehicle). It is most obvious on the last item on the list. Depending on how many of the previous listing supplied miles in their listing corresponds to the number of odometer values on a given item.

    I feel like I am missing something in my XPath query. // searches the whole document so maybe that is where I am going wrong. It seems like any XPath query that I try with / doesn't work and it is not obvious to me what node the query is starting from.

    0
  • hello,

    I certainly wasn't aware we could use the rename that way, and even less that it would work! Now I see what you're doing (and I'm impressed ;) ).

    Sadly, I've tried on my own, and I don't see how to refer to the current element only. How about a proper XPath fetch page query for odometer field instead? Yes, you would make 2 queries per items, but at least it would work :)

    0
  • I wasn't able to figure out exactly how to make it work the way I would have liked but I found a work around. By renaming the attributes property at the end of the rename module the results turned out to be correct. I updated my example pipe so others can benefit from it: http://pipes.yahoo.com/pipes/pipe.edit?_id=a975c9ed063eb859b079adfb53955d6f

    1
  • that's clever, well done! and thanks for finding out that whole new way of pipe processing, it opens up a new perspective for me.

    0

Recent Posts

in Pipes