Jump to content
Server Maintenance This Week. ×

XML: related child record import?


ignotum

This topic is 5557 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I need to understand how an xml file needs to be formatted so that when I do an xml data source import into Filemaker I can get multiple child records.

For example: the xml file contains people data (name, address etc) and it contains people's item data (spoon, fork, knife). The spoon, fork and knife data are 3 children records to the one "people" record.

This is the child section of the xml:

I know to first import into the parent table then switch to the child table and do another import. I know to use the parent key field in the second import so that the records keep their relationship to the parent.

What is happening is that I get only ONE child record when there are supposed to be multiple records imported.

Any help would be appreciated.

mark

Edited by Guest
Link to comment
Share on other sites

Filemaker can export data from related tables, but it always imports into a single table only. The answer to the question "how does an xml file needs to be formatted" is "the same way it would have looked, had you exported from the child table". IOW, there must be a ROW element for each record - not just multiple DATA elements in a COL.

Link to comment
Share on other sites

THis is the xml that came OUT of FileMaker for one parent with 6 children. There is only one pair of ROW tags. If I import this I get just one of the child recs...:D

0

75594

DIGITAL D/C COUPLER DR-E4

DIGITAL A/C ADAPTER AC-E4

DIGITAL BATTERY CHARGER LC-E4

DIGITAL BATTERY PACK LP-E4

DIGITAL BATTERY PACK LP-E4

DIGITAL EOS-1Ds Mark III

Link to comment
Share on other sites

Yes, that's how it looks when you export from the parent table. Now export from the child table, and see the difference.

But what's your point? I'm trying to figure out the format I need "the web guys" on this project to give to me for data that has a parent table and 2 related child tables (that will contain multiple records related to each parent.

Are yoy saying that the format I provided here will NOT be importable into FMP in a way that will give me related child records?

Link to comment
Share on other sites

Are yoy saying that the format I provided here will NOT be importable into FMP in a way that will give me related child records?

Not directly. The child records CAN be imported, IF there is a stylesheet transforming the imported document. The result of the transformation must look the same as an export directly from the child table would (Filemaker does the transformation during import, in a single step).

ADDENDUM:

To clarify: a single XML document cannot be imported into TWO tables without at least one stylesheet.

Edited by Guest
Link to comment
Share on other sites

Not directly. The child records CAN be imported, IF there is a stylesheet transforming the imported document. The result of the transformation must look the same as an export directly from the child table would (Filemaker does the transformation during import, in a single step).

ADDENDUM:

To clarify: a single XML document cannot be imported into TWO tables without at least one stylesheet.

Ok... it's still not clear to me.

I know I CAN import a single xml file into 2 tables by doing 2 imports WITHOUT a stylesheet.

What I don't know is what the xml file needs to look like to be able to get the multiple child records contained inthe xml file into multiple records in FMP.

Are you saying that the xml file FMP creates when exporting from the parent table and including child record data CANNOT be imported back into FMP into the parent (in 1 import) and the children (in a second import) without an XSLT transformation?

If this is the case I need someone to write an XSLT for me.... (for pay of course)

Anyone?

Edited by Guest
Link to comment
Share on other sites

I know I CAN import a single xml file into 2 tables by doing 2 imports WITHOUT a stylesheet.

No - at least not correctly. In your example, there is a single parent record for each group of child records. When importing this into the child table, Filemaker creates one record for each record in the XML document - so it ends up importing one child per parent, exactly as you have observed.

Are you saying that the xml file FMP creates when exporting from the parent table and including child record data CANNOT be imported back into FMP into the parent (in 1 import) and the children (in a second import) without an XSLT transformation?

Yes.

If this is the case I need someone to write an XSLT for me

Contact me privately, if you wish.

Link to comment
Share on other sites

This topic is 5557 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.