2

enter image description hereI can't seem to find a good module that does what my title says. Xpath XML Parser is limited to a single source isn't it?

I needed to be able to import xml feeds from different URLs towards the same target (e.g. mapped to a specific content type). Say, my website will publish contents from different client's websites using an xml specification defined by me. My website then will get all contents by importing all those xml sources towards the same content type so my site will list all contents from different 'sources' effectively. Say real estate listings coming from different real estate agencies/agents...

Has anyone done this before?

1 Answer 1

1

To me this seems like an exact use case for Feeds plus Feeds XPath Parser. It will be possible to map your custom XML spec to various fields and import content from as many sources as you want into nodes of the same content type. I posted an answer to another question which may give guidance on how to use it.

Feeds:

  • Import or aggregate data as nodes, users, taxonomy terms or simple database records.

  • One-off imports and periodic aggregation of content

  • Import or aggregate RSS/Atom feeds

  • Import or aggregate CSV files

  • Import or aggregate OPML files

  • PubSubHubbub support

  • Create nodes, users, taxonomy terms or simple database records from import

  • Extensible to import any other kind of content

  • Granular mapping of input elements to Drupal content elements

  • Exportable configurations

  • Batched import for large files

Feeds XPath Parser:

Feeds XPath Parser is a Feeds plugin for parsing XML and HTML documents. It enables site builders to leverage the power of Feeds to easily import data from complex, external data sources. Each element you wish to extract is setup using configurable mapping queries, saving time for developers who would otherwise have to code complex, specific-use modules. It also enables end-users to build web scrapers and other useful tools within Drupal.

6
  • I have one question though.. Why is the url path to import located within the add new content as shown on the image I attached? Isn't this set up redundant? I mean the reason why I need the importer is to auto-import the content and map the xml fields to, say, 'commercial for rent' content-type as above.. Every submission of the content of this type would trigger importing, as opposed to setting up a cron to 'independently' import xml without having to manually add the new content of this type...
    – jan
    Jul 30, 2011 at 18:26
  • I see what you are saying. An important concept of Feeds is that it will require two content types, one being the "feed", or the path to the data you are importing, and the other being the target, or the "Commercial for Rent" in your case. There is a good tutorial at yadadrop.com/drupal-video/…. Jul 30, 2011 at 21:40
  • sorry, but everything seems to be only using a single source. I have no clue as to how to make the xpath parser/feed to accept multiple url sources into one content type...
    – jan
    Jul 31, 2011 at 11:02
  • I think I found a way.. Thank you Chris! I will update this post once I found it to be a real solution to my problem. Thank you again.
    – jan
    Jul 31, 2011 at 12:02
  • @jan this is precisely what I was looking for, was about to post a separate question. Can you perhaps explain conceptually what your solution was? Thanks
    – Duncanmoo
    Jul 15, 2012 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.