I am trying to add a queryPath expression to a feed importer, but can't for the life of me find where you specify those expressions! All I get is "querypathparser:2" "querypathparser:3" added to my feed list, and I am seemingly unable to add selectors.

Am I just thick-headed or am I missing something somewhere?

Help?

CommentFileSizeAuthor
Screen shot 2010-10-22 at 6.35.30 PM.jpg44.07 KBacb

Comments

twistor’s picture

Component: User interface » Documentation
Assigned: Unassigned » mitchell
Priority: Major » Normal

You add the expressions when you go to create a feed. Either on the node add/edit page, or at /import/[feed_id]

acb’s picture

I am sorry, but I am not quite clear on what you mean. Could you please explain a little clearer? Sorry to be any trouble.

Please explain where I have gone astray:

1) I create a content type "feed-item" with some CCK fields I wish to map to incoming xml (see no place to add expressions here).

2) I create a feed (see no place to add expressions here).

3) I create a feed-importer, set to attach to my "feed" type, fetcher http, parser, querypath parser, node processor (settings: map to "feed-item" type

4) Mapping: see the drop-down, select "QueryPath Expression" and map it to my feed-item's CCK field.

In the resulting list I see "querypathparser:0"

Now, where do I define querypathparser:0? It is not on my node/edit page for either the feed or the feed-item. Nor is it on the mapping page as it appears in this image from a tutorial : http://drupal.org/files/issues/feeds_xpathparser-docs-mapping_rules.png (I see no box in which I can add an expression).

Sorry to be so thick, but what piece of the puzzle am I missing? Am I missing a glaringly obvious box somewhere?

thank you for the help!

P.s. I do see on my feed node/create page, "FeedsQueryPathParser: No mappings were defined." which seems to be telling me that I have missed some crucial part of this....

lancerkind’s picture

I see your getting no help on this so let me offer you some bad help as I too am struggling to get either the Xpath Parser or Query Path Parser to do what I want. Go to create-content and creat one of your XML Feeds nodes which you defined. You'll see an area labeled feeds. Within is probably where you define those querypath mappings.

Here's a helpfull video on Node Parser that may help. http://developmentseed.org/blog/2009/dec/15/importing-and-aggregating-st...

panigrc’s picture

You define the field at the Edit importer: Feed section (admin/build/feeds/edit/feed) and then you can define the querypath expression at node/add/feed.

Hope it helped.

jacksonkirka’s picture

Hey youngster:

It is simple. Machine readable name is xpath0 ....2....3. Now, you must add an Xpath querry in the settings above the mapping in Drupal 6.

You should read the entire standard for XPath Syntax WC3 or other trusted authority. Print it all out. This is professional scripting. It is not amateur scripting. You need the equivalent of a thousand pages of material before you can comprehend XPath or XQuery. I have an IQ of 139 and I am an Acalanes High School Don!

Read Hard. Real Hard. Buy a three ring binder and take notes. Be absolutely systematic and logical.

Chow

Toxid’s picture

@abc, I recently figured this out, the workflow is different than with other feeds parsers. Once you've assigned querypathparser to a number of fields so that you get that list with "querypathparser:0" "querypathparser:1" etc, only then can you go back to QueryPath parser settings and assign selectors there. You can also asign the selectors when you create a node if you've assigned the importer. In short, you first assign the fields, then go back and add selectors.

yareckon’s picture

Component: Documentation » User interface

Yes, this is a usability issue with Feeds generally, where the node processor fields must be defined first, but they are way down on the form in a separate vertical tab. That section should be above the Xpath or QueryPath parser settings because you need to define what content you want to end up with before you say where to get each bit.

The logic would then be the same as the visual order

1) What type of content (nodes, users, etc) do you want to get....
2) where (which fields) should it end up in ,
3) where (which Xpath/Querypath expr) should each field be pulled from.

Right now you still need to do 1,2,3, but the tabs are in 1,3,2 order.

Changing to userinterface.. although it's also a docs problem.

kappaluppa’s picture

@jacksonkirka totally useless response...

gillarf’s picture

I found the settings under /import

Choose your importer, and the settings are there, as long as you have added some fields in the mapping.

Note, this is for Drupal 6 - I haven;t tried this for Drupal 7 version.