Hello,

I'm not certain it's an issue, maybe it's just a configuration mistake.

I trie to import XML file contains several nodes like this :

<?xml version="1.0" encoding="UTF-8"?>
<MUS_BIENS id="923839458559a7f767bdb3605532073">
    <MUS_BIEN id="599973613559a7f767bdb31337228515">
        <UNIQUE_KEY id="450026681559a7f767bdb3912243423">1</UNIQUE_KEY>
        <NUM_INVENTAIRE id="1824846907559a7f767bdb3743152593">MOU.05412</NUM_INVENTAIRE>
        <XML_FIELD id="496235036559a7f767bdb3190637713">
            <DESIGNATION id="1213450132559a7f767bdb3991977844">
                <TITRE id="1106891879559a7f767bdb32105904771">Tentation et faute d'Adam et Eve, Cain tué par Lameck du soubassement du portail nord de la façade occidentale de la cathédrale Saint-Etienne à Auxerre</TITRE>
            </DESIGNATION>
        </XML_FIELD>
    </MUS_BIEN>
    <MUS_BIEN id="1942010972559a7f767bdb31965511310">
        <UNIQUE_KEY id="933084605559a7f767bdb31141050391">2</UNIQUE_KEY>
        <NUM_INVENTAIRE id="858685603559a7f767bdb3185138638">MOU.05409-01</NUM_INVENTAIRE>
        <XML_FIELD id="146153456559a7f767bdb3723448864">
            <DESIGNATION id="1519064766559a7f767bdb31599199153">
                <TITRE id="348541745559a7f767bdb3519214060">Création d'Adam du portail nord de la façade occidentale de la cathédrale Saint-Etienne à  Auxerre</TITRE>
            </DESIGNATION>
        </XML_FIELD>
    </MUS_BIEN>
</MUS_BIENS>

but Feeds send me this information message, follow by an error :

  • context :
    • 1 MOU.05412 Tentation et faute d'Adam et Eve, Cain tué par Lameck du soubassement du portail nord de la façade occidentale de la cathédrale Saint-Etienne à Auxerre
    • 2 MOU.05409-01 Création d'Adam du portail nord de la façade occidentale de la cathédrale Saint-Etienne à Auxerre
  • xpathparser:111 :
    • MOU.05412
    • MOU.05409-01
  • xpathparser:112 :
    • Tentation et faute d'Adam et Eve, Cain tué par Lameck du soubassement du portail nord de la façade occidentale de la cathédrale Saint-Etienne à Auxerre
    • Création d'Adam du portail nord de la façade occidentale de la cathédrale Saint-Etienne à Auxerre
  • xpathparser:111 :
    • MOU.05412
    • MOU.05409-01
  • xpathparser:112 :
    • Tentation et faute d'Adam et Eve, Cain tué par Lameck du soubassement du portail nord de la façade occidentale de la cathédrale Saint-Etienne à Auxerre
    • Création d'Adam du portail nord de la façade occidentale de la cathédrale Saint-Etienne à Auxerre

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 ' 'MOU.05409-01'' at line 1

I understand it tries to insert all values for each node (for example MOU.05412 and MOU.05409-01 in the same field NUM_INVENTAIRE of MUS_BIEN1).
But I don't understand why did-it do that ?
Can you help me ?
Thanks !

Comments

twistor’s picture

Project: Feeds » Feeds XPath Parser
Version: 7.x-2.0-alpha9 » 7.x-1.x-dev
Component: Feeds Import (feature) » Code
Assigned: Karl Pineau » Unassigned
Category: Task » Support request
Status: Active » Postponed (maintainer needs more info)

It looks like your XPath values are invalid.

You should use:
context: /MUS_BIENS/MUS_BIEN
NUM_INVENTAIRE: NUM_INVENTAIRE

What is the full output of your SQL error?

Karl Pineau’s picture

You're right, my XPath values are invalid. I correct it with your indications and it works ! Thanks very much !

twistor’s picture

Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)

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