ignotum Posted February 20, 2009 Posted February 20, 2009 (edited) 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 February 20, 2009 by Guest
comment Posted February 20, 2009 Posted February 20, 2009 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.
ignotum Posted February 20, 2009 Author Posted February 20, 2009 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... 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
comment Posted February 20, 2009 Posted February 20, 2009 Yes, that's how it looks when you export from the parent table. Now export from the child table, and see the difference.
ignotum Posted February 21, 2009 Author Posted February 21, 2009 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?
comment Posted February 21, 2009 Posted February 21, 2009 (edited) 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 February 21, 2009 by Guest
ignotum Posted February 21, 2009 Author Posted February 21, 2009 (edited) 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 February 21, 2009 by Guest
comment Posted February 21, 2009 Posted February 21, 2009 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.
Recommended Posts
This topic is 5753 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 accountSign in
Already have an account? Sign in here.
Sign In Now