Hi Folks,

Having real issue here trying to import some nodes. Note this is the first time using Xpath and Feeds, so it may be config. All of the Xpath expression used have been tested in Xmplify (external xpath editor) and work as expected.

If I use a XPath to specific singular node, everything works for one node (/N[1]/N[1]/N[1]/N[4]/N[1]).

If I use a context, and a separate Xpath I get a 'No New Nodes' error. Debug shows the context correctly. (note: I have tried fields other than nid)
context: //N[@K='tItemDb']
nid: /N/N/@F

If I use a document root as context, and supply a complete Xpath - it finds the correct data nodes, and then throws an SQL error.
context: //
nid: /N[@K='tItemDb']/N/@F

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' '35979', '30406', '36491', '30662', '30790', '30918', '31046', '31174', '31302'' at line 1

I have detailed all of this, provided the XML source and an export of my Feeds Importer, alongside debugs of both sets of output in this Gist.

https://gist.github.com/Mizpah/e9ff7eb258260d375dda

Any help at all hugely appreciated - have spent a day on this now and am very behind!

Cheers,

Maritn

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Mizpah’s picture

This is still a live issue, and I am out of time to get it fixed! Anything I can do to contribute to moving this forward?

Mizpah’s picture

Updating this again, to make sure that the information is up to date.

After refining things a few times I am now in the situation where I am using AM using a precise context, have Xpath expressions that return data (debug shows all of the data now, no more 'No New Nodes', but still get the SQL error.

Wildstar Item Import 4 has been created.
context :

xpathparser:0 :
V="Mutagen Shoulder Plates"
V="Schematic: Thirsty Creek Hand Spikes"
V="The Desipient Collection"
V="Flaming Smoothie"
V="Granok Portrait (Draped)"
V="Banana"
V="Serviceable Platinum Shredder"
V="Galactium Isomodular Psystar"
V="Geometric Combat Assist Module"
V="Stormcrush Bladed Psybomb"
xpathparser:1 :
F="37671"
F="35979"
F="30406"
F="36491"
F="30662"
F="30790"
F="30918"
F="31046"
F="31174"
F="31302"
×Error message SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 'Schematic: Thirsty Creek Hand Spikes', 'The Desipient Collection', 'Flaming Sm' at line 1

Everything is detailed in this updated GIST, https://gist.github.com/Mizpah/029b40e0ea6e00ad3c69

I am really not sure what else I can adjust now, please help!

Mizpah’s picture

Mizpah’s picture

Still having issues.

Have now confirmed that it is setting title to unique that triggers the issue with SQL.
If I DO NOT set title to unique, it runs but imports only one node as 'Array'.

Setting a unique field to GUID does not help - this example debug still only imports one note despite xpathparser:0 being GUID and Unique.

Wildstar Item Import 22 has been created.
context :

xpathparser:0 :
F="37671"
F="35979"
F="30406"
F="36491"
F="30662"
F="30790"
F="30918"
F="31046"
F="31174"
F="31302"
xpathparser:2 :
F="37671"
F="35979"
F="30406"
F="36491"
F="30662"
F="30790"
F="30918"
F="31046"
F="31174"
F="31302"
xpathparser:3 :
V="Mutagen Shoulder Plates"
V="Schematic Thirsty Creek Hand Spikes"
V="The Desipient Collection"
V="Flaming Smoothie"
V="Granok Portrait (Draped)"
V="Banana"
V="Serviceable Platinum Shredder"
V="Galactium Isomodular Psystar"
V="Geometric Combat Assist Module"
V="Stormcrush Bladed Psybomb"
Created 1 node.

Mizpah’s picture

Have added a but report as the base issue has been (I think ) identified and can be replicated on a new install. very keen to get this moved on, so any advice appreciated!

cristian.reea’s picture

Hi Mizpah,
I had the same problem and found the solution here: https://www.youtube.com/watch?v=n7LxjxwXtrc&feature=youtu.be

At 4:30 explains how the context and xpath is set.
Basically you have to put almost the entire path in the context. The only thing that goes in xpath field is the name of the element containing the value to be colected.

Hope it helps

twistor’s picture

Component: Miscellaneous » Documentation
Priority: Major » Normal
Status: Active » Fixed

You never want your Value XPath expression to start with a slash "/". That will start the value over parsing from the beginning of the document.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.