You are here:  » Insert MySql


Insert MySql

Submitted by Rom on Wed, 2011-05-11 14:33 in

Hi,

This code read all group of <support_composants> but only the first line of each group.

Can you help me please?

Thanks

Rom

{code saved}

Submitted by support on Wed, 2011-05-11 14:36

Hi Rom,

I think you want to parse at one level lower, using the Format String:

xml|penelop/donnee_reguliere/DESTINATAIRE/CONTRATS/CONTRAT/SUPPORT_COMPOSANTS/

And then, in your myRecordHandler2 function, for each key instead of, for example:

$record2["SUPPORT_COMPOSANTS/SUPPORT_COMPOSANT-ID_SUPPORT_COMPOSANT"]

...use:

$record2["SUPPORT_COMPOSANT-ID_SUPPORT_COMPOSANT"]

Then you should get all <support_composants> into your myRecordHandler2 function!

Hope this helps,
Cheers
David
--
MagicParser.com

Submitted by Rom on Wed, 2011-05-11 14:41

Hi David,

Thanks for the reply but i have always the same problem..

Rom

Submitted by support on Wed, 2011-05-11 14:48

Sorry Rom, I wasn't quite right in the new Format String. Use:

xml|penelop/donnee_reguliere/DESTINATAIRE/CONTRATS/CONTRAT/SUPPORT_COMPOSANTS/SUPPORT_COMPOSANT/

The new key values into $record2 are correct still...

Hope this helps!
Cheers,
David.

Submitted by Rom on Wed, 2011-05-11 14:57

I have tried but now I have "invalid format string".

I don't know what can I do..

Thanks

Submitted by support on Wed, 2011-05-11 15:03

Hi Rom,

Could you check it is all on one line - {link saved} to see that Format String working in the demo tool; if you're not sure, could you post the section of your code calling MagicParser_parse and i'll check it out...

Submitted by Rom on Wed, 2011-05-11 15:14

I 'm not sur. Here is my code :

{code saved}

Submitted by Rom on Wed, 2011-05-11 15:17

I made tests between... Correction for the last post i have :

MagicParser_parse($xml,"myRecordHandler2","penelop/donnee_reguliere/DESTINATAIRE/CONTRATS/CONTRAT/SUPPORT_COMPOSANTS/SUPPORT_COMPOSANT");

Submitted by support on Wed, 2011-05-11 15:18

Hi Rom,

the XML| and trailing / are missing - please try;

MagicParser_parse($xml,"myRecordHandler2","XML|penelop/donnee_reguliere/DESTINATAIRE/CONTRATS/CONTRAT/SUPPORT_COMPOSANTS/SUPPORT_COMPOSANT/");

(make sure all on one line of course)

That should be all it is!

Cheers,
David.

Submitted by Rom on Wed, 2011-05-11 15:25

Hi David,

ok.. Sorry.

it's works but the result is the same. I have only the first line of each group.

Rom

Submitted by support on Wed, 2011-05-11 15:33

Hi Rom,

Please could you email me your script as it will be easier to look at and I'll check it out for you...

Cheers,
David.