Just try the dev version, but I've got error :
Importing
An error has occurred.
Please continue to the error page
An error occurred. /batch?id=137&op=do <br /> <b>Fatal error</b>: Call to a member function getSourceElement() on a non-object in <b>/public_html/sites/all/modules/feeds_xpathparser/FeedsXPathParser.inc</b> on line <b>57</b><br />
I took same parameter then the prod version, and add the XPath query for the context...
In addition, I see the option "RegExp" but I don't know how to use the xPath with RegExp... Is it possible to use Xpatch function : http://www.w3schools.com/XPath/xpath_functions.asp ??
Can you add to links to exemple to new user (as me) ? Can you also be more specify on form description : "The query string to run." maybe "the Xquery string to run" or the "Xpath expression to run" ... for me, it's ambiguous.
My current purpose is to import events feed from XML, but the feed contains around 70% of past events. So, I'm looking for also a solution (via Xquery or others) to filter this feed before integration.
Thanks for all your efforts !!
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | 844654-16-error_handling.patch | 4.85 KB | twistor |
Comments
Comment #1
twistor commentedThis should be fixed in the new dev version. Starting a new issue for documentation as that needs to get done.
Comment #2
twistor commentedComment #3
steven jones commentedAs far as I can see, this is not fixed in dev.
Issue is, if you have an XML file with more that 50 items in it, feeds will batch up the parsing of the data, which means when
FeedsXPathParser->getSourceElementgets called the orginal$this->parseris not around because it doesn't get set up each time (i.e.FeedsXPathParser->parseisn't called.)I have 'fixed' this by parsing the entire XML file in the parse method in the 'sub parsers', and then just removing the custom getSourceElement implementation.
So I have:
So after the initial call to ->parse the parser has returned an array of items, this is how all the other Feeds parsers seem to do it.
Comment #4
twistor commentedYour fix is pretty close to how I'll do it. The problem is that we can optimize a bit if we don't go to a string and then create new SimpleXMLElement objects. I need to find out if that's going to make the namespace issues worse. I'll have this fixed soon.
Comment #5
twistor commentedI've committed the first fix for this to HEAD, but it needs more testing. Feedback welcome. Should be available in the dev release soon.
Comment #6
Robin Millette commentedsubscribe!
Comment #7
avantwaves commentedSame problem here. I will try the Steve Jones #3 fix... and and will test the dev version as soon you release it. I have a very big feed.... :)
Comment #8
avantwaves commentedExactly in which file you have to change the code? In the FeedsXPathParserHTML.inc inside the feeds_xpathparser module?
Comment #9
twistor commentedComment #11
tomimikola commentedI keep getting this error when importing appr. 1000 items. Works fine when testing with ten items.
Version: 7.x-dev (FeedsXPathParser.inc,v 1.1.2.23.2.17)
Comment #12
maksis commentedexactly the same problem here, just trying to import one item
Comment #13
sachbearbeiter commentedsame problem with 20 items
Comment #14
twistor commented@TomiMikola, maksis, sachbearbeiter, I will need more information to be able to reproduce your errors exactly as I am not getting them.
@TomiMikola, There's a good chance that you're running out of memory, from trying to import so many items.
Comment #15
Ooxo commentedDrupal: 7.4
Feeds: 7.x-2.0-alpha4 + (Patch applied for taxonomy and language awareness)
Feeds XPath Parser: 7.x-1.x-dev (23/07)
Strangely enough I import my articles from node "Feeds" (with drush cron and Feeds XPath Parser) but when I try to import my xml file from a standalone form I get
Fatal error: Call to a member function getNamespaces() on a non-object in ../sites/all/modules/feeds_xpathparser/FeedsXPathParserDOMXPath.inc on line 12I imported 10000 items just fine, I don't remember changing anything and then going for 10000 more items and got the error screen
the xml file sample (the full xml file as been checked on http://validator.w3.org/check and recieved a valid stamp)
I can't figure why the standalone form won't work anymore !?!
Any help/advice would be greatly appreciated ;)
Comment #16
twistor commented@OoxO,
I have a patch that I'd like you to try out. It provides more robust error handling, which hopefully will tell you what the error is.
I'm going to commit it anyway, but I'll post it for people without git.
Comment #17
Ooxo commented@twistor
Many thanks for this patch, works like a charm :
Checking the line, there's a little special character :( ...Very very helpful, thanks again
Comment #18
twistor commentedInstalling tidy for php might help. Once it's installed, you can enable it in the XPath config.
Comment #19
caktux commentedGreat error handling patch, thanks!
Comment #20
twistor commentedForgot to commit this.
http://drupalcode.org/project/feeds_xpathparser.git/commit/d3dbc61
Comment #21
twistor commented6.x
http://drupalcode.org/project/feeds_xpathparser.git/commit/d2976da